Last active
March 5, 2025 16:04
Revisions
-
chetbox revised this gist
Jul 15, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,7 +35,7 @@ qemu-system-aarch64 \ -drive "if=sd,format=raw,file=$1" \ -kernel kernel8.img \ -m 1G -smp 4 \ -serial mon:stdio \ -device usb-net,netdev=net0 \ -netdev user,id=net0,hostfwd=tcp::5555-:22 \ -usb -device usb-mouse -device usb-kbd \ -
chetbox created this gist
Jul 15, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ #!/bin/bash # Requirements: # - macOS # - qemu - `brew install qemu` # - A raw 64-bit Raspberry Pi system image to boot (Usually a .img) set -e if [[ -z "$1" ]]; then echo "Disk image expected as argument" 1>&2 exit 1 fi # Mount disk and find where /boot is mounted BOOT_MOUNT=$( hdiutil attach -imagekey diskimage-class=CRawDiskImage "$1" | grep 'Windows_FAT_32' | sed 's/.*\t//' ) # Copy required files to local folder cp "$BOOT_MOUNT/bcm2710-rpi-3-b-plus.dtb" ./ cp "$BOOT_MOUNT/kernel8.img" ./ # Unmount disk hdiutil detach "$BOOT_MOUNT" # Make sure the disk is on a power of two boundary for QEMU qemu-img resize -f raw "$1" 8G qemu-system-aarch64 \ -M raspi3b \ -cpu cortex-a72 \ -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1" \ -dtb bcm2710-rpi-3-b-plus.dtb \ -drive "if=sd,format=raw,file=$1" \ -kernel kernel8.img \ -m 1G -smp 4 \ -serial stdio \ -device usb-net,netdev=net0 \ -netdev user,id=net0,hostfwd=tcp::5555-:22 \ -usb -device usb-mouse -device usb-kbd \