3

I am trying to follow the instructions under https://github.com/wimvanderbauwhede/limited-systems/wiki/Debian-%22buster%22-for-Raspberry-Pi-3-on-QEMU to have buster start in qemu. However, none of the files described in "Extracting the kernel and ramdisk images from the boot partition" exists in the 2019-06-20-raspbian-buster-lite image. The boot partition only contains:

bcm2708-rpi-b.dtb
bcm2708-rpi-zero.dtb
bcm2710-rpi-3-b.dtb   
bcm2711-rpi-4-b.dtb
config.txt
fixup4.dat
fixup_cd.dat 
fixup_x.dat
kernel7l.img
overlays
start4.elf   
start_db.elf
bcm2708-rpi-b-plus.dtb
bcm2708-rpi-zero-w.dtb 
bcm2710-rpi-3-b-plus.dtb
bootcode.bin
COPYING.linux 
fixup4db.dat
fixup.dat
issue.txt
kernel.img       
start4cd.elf
start4x.elf
start.elf
bcm2708-rpi-cm.dtb     
bcm2709-rpi-2-b.dtb
bcm2710-rpi-cm3.dtb
cmdline.txt         
fixup4cd.dat
fixup4x.dat
fixup_db.dat
kernel7.img 
LICENCE.broadcom
start4db.elf
start_cd.elf
start_x.elf

Where are vmlinuz-4.14.0-3-arm64 and initrd.img-4.14.0-3-arm64?

Alex
  • 131
  • 1
  • 2

2 Answers2

3

Late to the party, however I think I have solution for you.

As Ingo mentioned, in this tutorial custom image is used for emulation. However it does not mean you can't emulate official one like raspbian-buster-lite image. This image also contains all necessary files for QEMU emulation, however they are named differently. Also you can only emulate this kernel on:

-machine raspi* 

type machine because it had been compiled for specific Raspberry Pi hardware so you obviously need specific machine support in QEMU for that purpose. So versatile_pb won't work in this case, thats why in tutorial separate kernel and device tree blob is used. However as mentioned in tutorial this raspi machine does not support networking and USB so if you need those you better emulate on versatile_pb machine.

Anyway, from boot partition you need files specific for Raspberry Pi version you are interested in. Boot partition contains files which are enabling system to run on every Raspberry Pi hardware. So for example for Raspberry Pi 3B these files would be:

  • kernel image -> kernel8.img
  • device tree blob -> bcm2710-rpi-3-b.dtb (bcm2710 naming explanation)

Raspberry image does not use initrd, so you won't need for bootup. With these, only thing left is to assemble correct QEMU emulation command, which in my case for basic bootup was:

qemu-system-aarch64 \
    -M raspi3 \
    -append "rw earlyprintk=ttyAMA0,115200 loglevel=8 console=ttyAMA0,115200 root=PARTUUID=6c586e13-02 rootfstype=ext4 rootwait" \
    -cpu cortex-a53 \
    -dtb /path/to/bcm2710-rpi-3-b.dtb \
    -drive id=hd-root,file=/path/to/2019-09-26-raspbian-buster-lite.img,format=raw \
    -show-cursor \
    -kernel /path/to/kernel8.img \
    -m 1024 \
    -serial mon:stdio \
    -nographic

For rootfs I used PARTUUID and

rootwait

cause I had some trouble booting with standard device naming. You can check this value in fstab after you mounted img partition or from boot partition in cmdline.txt.

I also added:

-nographic 

for only console but you can ignore it if you want to work with GUI.

That should do it.

Burznazg
  • 31
  • 3
1

The author of that tutorial does not use the default Raspbian Buster Lite image. Default Raspbian is a 32 bit version. You should use the image that the author used and if there are problems you should also ask the author. It has nothing to do with default Raspbian.

Ingo
  • 42,107
  • 20
  • 85
  • 197