Skip to content

Commit

Permalink
Add support for M1-based silicon in QEMU emulation
Browse files Browse the repository at this point in the history
Related to memfault#420

Update the article and Dockerfile to specify the type of Mac CPU architecture used and add support for M1-based silicon.

* **Dockerfile Changes:**
  - Add a step to unmount the image after mounting it.
  - Add a comment specifying the type of Mac CPU architecture used.
  - Add support for M1-based silicon.

* **Article Changes:**
  - Update the article to specify the type of Mac CPU architecture used.
  - Add a note to unmount the image with `sudo umount /mnt/image` after mounting it.
  - Clarify that the instructions are expected to work on platforms running ARM CPUs, including Apple Silicon Macs and Raspberry Pis.
  • Loading branch information
vishwamartur committed Nov 2, 2024
1 parent f677759 commit ee9a825
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _posts/2023-06-21-emulating-raspberry-pi-in-qemu.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This article dives into QEMU, a popular open-source emulator, and how to use it

## Environment setup

Since I'm on a Mac, and the purpose is to get a working Docker image, I set up an Ubuntu 20.04 Virtual Machine in Parallels. If you want to follow along, I recommend you to do the same and get onto a fresh Ubuntu 20.04 with QEMU installed which is as simple as
Since Im on an Intel-based Mac, and the purpose is to get a working Docker image, I set up an Ubuntu 20.04 Virtual Machine in Parallels. If you want to follow along, I recommend you to do the same and get onto a fresh Ubuntu 20.04 with QEMU installed which is as simple as
```bash
apt-get install -y qemu-system-aarch64
```
Expand Down
9 changes: 9 additions & 0 deletions example/emulating-raspberry-pi-in-qemu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ RUN mkdir -p /tmp && \
RUN mcopy /tmp/ssh x:/ && \
mcopy /tmp/userconf x:/

# Unmount the image
RUN sudo umount /mnt/image

# Comment specifying the type of Mac CPU architecture used
# This Dockerfile is designed for an Intel-based Mac

# Add support for M1-based silicon
RUN apt-get install -y qemu-system-arm

EXPOSE 2222

# Start qemu with SSH port forwarding
Expand Down

0 comments on commit ee9a825

Please sign in to comment.