Creates a Raspberry Pi image using Packer and using QEMU to test it.
Tested with Raspberry Pi OS Lite 5.10 (March 4th 2021).
yay -S curl go packer qemu qemu-arch-extra qemu-user-static-bin
git clone https://github.com/mkaczanowski/packer-builder-arm
cd packer-builder-arm
go mod download
go build
mkdir -p ~/.packer.d/plugins
cp packer-builder-arm ~/.packer.d/plugins
sudo packer raspios-lite.pkr.hcl
sudo chown $(whoami): raspberry-pi-os.img
curl https://raw.githubusercontent.com/dhruvvyas90/qemu-rpi-kernel/master/kernel-qemu-5.4.51-buster -o kernel-qemu-5.4.51-buster
curl https://raw.githubusercontent.com/dhruvvyas90/qemu-rpi-kernel/master/versatile-pb-buster-5.4.51.dtb -o versatile-pb-buster-5.4.51.dtb
qemu-system-arm -M versatilepb -cpu arm1176 -m 256 -drive "file=raspberry-pi-os.img,if=none,index=0,media=disk,format=raw,id=disk0" -device "virtio-blk-pci,drive=disk0,disable-modern=on,disable-legacy=off" -net "user,hostfwd=tcp::5022-:22" -dtb versatile-pb-buster-5.4.51.dtb -kernel kernel-qemu-5.4.51-buster -append 'root=/dev/vda2 panic=1' -no-reboot