I use a script to boot an armv8 installation on an sd card from FreeBSD on a PC. So I need qemu-system-aarch64 to do so. I do it with the root previleges. Before to power up and after power down the virtual machine I see the device files of the sd card in the /dev directory:
ls -al /dev/da1*
crw-r----- 1 root operator 0x1b9 3 déc. 00:24 /dev/da1
crw-r----- 1 root operator 0x1ba 3 déc. 03:18 /dev/da1p1
crw-r----- 1 root operator 0x1bc 3 déc. 03:18 /dev/da1p2
crw-r----- 1 root operator 0x1bd 3 déc. 03:18 /dev/da1p3
This correspond to the sd card Gpt partition table according to geom and gpart. The problem start when I launch the qemu script. In the directory /dev on the host (FreeBSD) only the disk /dev/da1 stay and the partitions device files of the disk desappear. So, ArchLinux arm cannot boot because it cannot see the root partition. I must kill qemu to recover the prompt and than the partitions device files of the disk reappear as they where before starting Qemu.
I cannot explain this. No matter if the partition table of the sd card is Dos or Gpt I have the same desappear problem during qemu is active. The script is
#!/usr/local/bin/bash
qemu-system-aarch64 -append "audit=0 console=ttyAMA0 fbcon=scrollback:2048 loglevel=0 mitigations=off net.ifnames=0 nohz=off root=/dev/da1p3 rw selinux=0" \
-cpu cortex-a57 -display none \
-drive file=/dev/da1,format=raw,index=0,media=disk \
-full-screen -initrd Public/Alarm/initramfs-linux.img \
-kernel Public/Alarm/Image.gz -M virt -m 1024 \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no \
-net nic,model=e1000,netdev=net0 -nographic -usb -vga none
# -full-screen -nographic
exit 0
ls -al /dev/da1*
crw-r----- 1 root operator 0x1b9 3 déc. 00:24 /dev/da1
crw-r----- 1 root operator 0x1ba 3 déc. 03:18 /dev/da1p1
crw-r----- 1 root operator 0x1bc 3 déc. 03:18 /dev/da1p2
crw-r----- 1 root operator 0x1bd 3 déc. 03:18 /dev/da1p3
This correspond to the sd card Gpt partition table according to geom and gpart. The problem start when I launch the qemu script. In the directory /dev on the host (FreeBSD) only the disk /dev/da1 stay and the partitions device files of the disk desappear. So, ArchLinux arm cannot boot because it cannot see the root partition. I must kill qemu to recover the prompt and than the partitions device files of the disk reappear as they where before starting Qemu.
I cannot explain this. No matter if the partition table of the sd card is Dos or Gpt I have the same desappear problem during qemu is active. The script is
#!/usr/local/bin/bash
qemu-system-aarch64 -append "audit=0 console=ttyAMA0 fbcon=scrollback:2048 loglevel=0 mitigations=off net.ifnames=0 nohz=off root=/dev/da1p3 rw selinux=0" \
-cpu cortex-a57 -display none \
-drive file=/dev/da1,format=raw,index=0,media=disk \
-full-screen -initrd Public/Alarm/initramfs-linux.img \
-kernel Public/Alarm/Image.gz -M virt -m 1024 \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no \
-net nic,model=e1000,netdev=net0 -nographic -usb -vga none
# -full-screen -nographic
exit 0