scripts to boot a Raspberry Pi OS image on its native kernel and dtb with QEMU
Download the newest Raspberry Pi OS image:
https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz
Decompress the image:
xz --decompress raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz --verbose
Resize the image to base-2:
qemu-img resize -f raw raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img 4096M
Rename the image:
mv raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img -v pi.img
I copied the DTB and kernel from one of my Raspberry Pi Zero W
I updated the Pi Zero's software and firmware before copying the kernel and DTB:
sudo apt update
sudo apt upgrade -y
sudo rpi-update
sudo reboot