From: Yann E. MORIN Date: Sat, 22 Jun 2019 16:51:20 +0000 (+0200) Subject: board/qemu: ensure root is available before mounting it X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=626c9705d29ec93610e87517aee771c2ea500f5d;p=buildroot.git board/qemu: ensure root is available before mounting it On my machine, it happens once in a while that the virtualised machine boots too fast for the rootfs to be available at the time the kernel tries to mount it. For example, board/qemu/arm-vexpress/readme.txt suggested changing "-smp 1" up to "-smp 4". But doing so here causes a kernel panic: VFS: Cannot open root device "mmcblk0" or unknown-block(0,0): error -6 Please append a correct "root=" boot option; here are the available partitions: 1f00 131072 mtdblock0 (driver?) 1f01 32768 mtdblock1 (driver?) Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) So, add the oh-so-useful 'rootwait' option to all kernel command lines for qemu defconfigs. Signed-off-by: Yann E. MORIN Cc: Joel Stanley Cc: Mark Corbin Cc: Matt Weber Signed-off-by: Peter Korsgaard --- diff --git a/board/qemu/aarch64-virt/readme.txt b/board/qemu/aarch64-virt/readme.txt index 1ff2fba47d..f868905d91 100644 --- a/board/qemu/aarch64-virt/readme.txt +++ b/board/qemu/aarch64-virt/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 + qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/arm-versatile/readme.txt b/board/qemu/arm-versatile/readme.txt index 33cdb7b81e..f3a9e1ab47 100644 --- a/board/qemu/arm-versatile/readme.txt +++ b/board/qemu/arm-versatile/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-arm -M versatilepb -kernel output/images/zImage -dtb output/images/versatile-pb.dtb -drive file=output/images/rootfs.ext2,if=scsi,format=raw -append "root=/dev/sda console=ttyAMA0,115200" -serial stdio -net nic,model=rtl8139 -net user + qemu-system-arm -M versatilepb -kernel output/images/zImage -dtb output/images/versatile-pb.dtb -drive file=output/images/rootfs.ext2,if=scsi,format=raw -append "rootwait root=/dev/sda console=ttyAMA0,115200" -serial stdio -net nic,model=rtl8139 -net user Or for the noMMU emulation: diff --git a/board/qemu/arm-vexpress/readme.txt b/board/qemu/arm-vexpress/readme.txt index 35137e050c..7f7b43a3b3 100644 --- a/board/qemu/arm-vexpress/readme.txt +++ b/board/qemu/arm-vexpress/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-arm -M vexpress-a9 -smp 1 -m 256 -kernel output/images/zImage -dtb output/images/vexpress-v2p-ca9.dtb -drive file=output/images/rootfs.ext2,if=sd,format=raw -append "console=ttyAMA0,115200 root=/dev/mmcblk0" -serial stdio -net nic,model=lan9118 -net user + qemu-system-arm -M vexpress-a9 -smp 1 -m 256 -kernel output/images/zImage -dtb output/images/vexpress-v2p-ca9.dtb -drive file=output/images/rootfs.ext2,if=sd,format=raw -append "console=ttyAMA0,115200 rootwait root=/dev/mmcblk0" -serial stdio -net nic,model=lan9118 -net user The login prompt will appear in the terminal that started Qemu. The graphical window is the framebuffer. diff --git a/board/qemu/m68k-q800/readme.txt b/board/qemu/m68k-q800/readme.txt index bead8cdde2..b516bacdff 100644 --- a/board/qemu/m68k-q800/readme.txt +++ b/board/qemu/m68k-q800/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-m68k -M q800 -kernel output/images/vmlinux -nographic -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/sda console=ttyS0" + qemu-system-m68k -M q800 -kernel output/images/vmlinux -nographic -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/sda console=ttyS0" The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/mips32r2-malta/readme.txt b/board/qemu/mips32r2-malta/readme.txt index d1bbcc4749..9ff3c4b810 100644 --- a/board/qemu/mips32r2-malta/readme.txt +++ b/board/qemu/mips32r2-malta/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-mips -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/hda" -net nic,model=pcnet -net user + qemu-system-mips -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -net nic,model=pcnet -net user The login prompt will appear in the terminal that started Qemu. The graphical window is the framebuffer. No keyboard support has been diff --git a/board/qemu/mips32r2el-malta/readme.txt b/board/qemu/mips32r2el-malta/readme.txt index 4f59d34308..745bfea608 100644 --- a/board/qemu/mips32r2el-malta/readme.txt +++ b/board/qemu/mips32r2el-malta/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-mipsel -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/hda" -net nic,model=pcnet -net user + qemu-system-mipsel -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -net nic,model=pcnet -net user The login prompt will appear in the terminal that started Qemu. The graphical window is the framebuffer. No keyboard support has been diff --git a/board/qemu/mips32r6-malta/readme.txt b/board/qemu/mips32r6-malta/readme.txt index 04de7e5c3e..6a026b2165 100644 --- a/board/qemu/mips32r6-malta/readme.txt +++ b/board/qemu/mips32r6-malta/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: -qemu-system-mips -M malta -cpu mips32r6-generic -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/hda" -nographic +qemu-system-mips -M malta -cpu mips32r6-generic -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -nographic The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/mips32r6el-malta/readme.txt b/board/qemu/mips32r6el-malta/readme.txt index 88602de0bb..f69fd21af1 100644 --- a/board/qemu/mips32r6el-malta/readme.txt +++ b/board/qemu/mips32r6el-malta/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: -qemu-system-mipsel -M malta -cpu mips32r6-generic -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/hda" -net nic,model=pcnet -net user -nographic +qemu-system-mipsel -M malta -cpu mips32r6-generic -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -net nic,model=pcnet -net user -nographic The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/mips64-malta/readme.txt b/board/qemu/mips64-malta/readme.txt index f0e7fef795..ea3a92541e 100644 --- a/board/qemu/mips64-malta/readme.txt +++ b/board/qemu/mips64-malta/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-mips64 -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/hda" + qemu-system-mips64 -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" The login prompt will appear in the terminal that started Qemu. The graphical window is the framebuffer. diff --git a/board/qemu/mips64el-malta/readme.txt b/board/qemu/mips64el-malta/readme.txt index 03b149bc8f..144da93839 100644 --- a/board/qemu/mips64el-malta/readme.txt +++ b/board/qemu/mips64el-malta/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-mips64el -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/hda" + qemu-system-mips64el -M malta -kernel output/images/vmlinux -serial stdio -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" The login prompt will appear in the terminal that started Qemu. The graphical window is the framebuffer. diff --git a/board/qemu/mips64r6-malta/readme.txt b/board/qemu/mips64r6-malta/readme.txt index bf5b517a32..cfa16fd863 100644 --- a/board/qemu/mips64r6-malta/readme.txt +++ b/board/qemu/mips64r6-malta/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-mips64 -M malta -cpu I6400 -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/hda" -nographic + qemu-system-mips64 -M malta -cpu I6400 -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -nographic The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/mips64r6el-malta/readme.txt b/board/qemu/mips64r6el-malta/readme.txt index d51bffd08a..61a6ceb5f4 100644 --- a/board/qemu/mips64r6el-malta/readme.txt +++ b/board/qemu/mips64r6el-malta/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-mips64el -M malta -cpu I6400 -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/hda" -nographic + qemu-system-mips64el -M malta -cpu I6400 -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/hda" -nographic The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/ppc-g3beige/readme.txt b/board/qemu/ppc-g3beige/readme.txt index 1c3b515396..608814ee3b 100644 --- a/board/qemu/ppc-g3beige/readme.txt +++ b/board/qemu/ppc-g3beige/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-ppc -M g3beige -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "console=ttyS0 root=/dev/hda" -serial stdio -net nic,model=rtl8139 -net user + qemu-system-ppc -M g3beige -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "console=ttyS0 rootwait root=/dev/hda" -serial stdio -net nic,model=rtl8139 -net user The login prompt will appear in the terminal that started Qemu. The graphical window is the framebuffer. diff --git a/board/qemu/ppc64-e5500/readme.txt b/board/qemu/ppc64-e5500/readme.txt index cfc563974d..8080766984 100644 --- a/board/qemu/ppc64-e5500/readme.txt +++ b/board/qemu/ppc64-e5500/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-ppc64 -M ppce500 -cpu e5500 -m 256 -kernel output/images/uImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "console=ttyS0 root=/dev/vda" -serial mon:stdio -nographic + qemu-system-ppc64 -M ppce500 -cpu e5500 -m 256 -kernel output/images/uImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "console=ttyS0 rootwait root=/dev/vda" -serial mon:stdio -nographic The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/ppc64-pseries/readme.txt b/board/qemu/ppc64-pseries/readme.txt index 5069df9e5b..6a3e96a2e5 100644 --- a/board/qemu/ppc64-pseries/readme.txt +++ b/board/qemu/ppc64-pseries/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-ppc64 -M pseries -cpu POWER7 -m 256 -kernel output/images/vmlinux -append "console=hvc0 root=/dev/sda" -drive file=output/images/rootfs.ext2,if=scsi,index=0,format=raw -serial stdio -display curses + qemu-system-ppc64 -M pseries -cpu POWER7 -m 256 -kernel output/images/vmlinux -append "console=hvc0 rootwait root=/dev/sda" -drive file=output/images/rootfs.ext2,if=scsi,index=0,format=raw -serial stdio -display curses The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/ppc64le-pseries/readme.txt b/board/qemu/ppc64le-pseries/readme.txt index c23da70df0..2728675df2 100644 --- a/board/qemu/ppc64le-pseries/readme.txt +++ b/board/qemu/ppc64le-pseries/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: -qemu-system-ppc64 -M pseries -cpu POWER8 -m 256 -kernel output/images/vmlinux -append "console=hvc0 root=/dev/sda" -drive file=output/images/rootfs.ext2,if=scsi,index=0,format=raw -serial stdio -display curses +qemu-system-ppc64 -M pseries -cpu POWER8 -m 256 -kernel output/images/vmlinux -append "console=hvc0 rootwait root=/dev/sda" -drive file=output/images/rootfs.ext2,if=scsi,index=0,format=raw -serial stdio -display curses The login prompt will appear in the terminal window. diff --git a/board/qemu/riscv32-virt/readme.txt b/board/qemu/riscv32-virt/readme.txt index b984e47105..5d7c1988d2 100644 --- a/board/qemu/riscv32-virt/readme.txt +++ b/board/qemu/riscv32-virt/readme.txt @@ -1,6 +1,6 @@ Run Linux in emulation with: - qemu-system-riscv32 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80400000 -append "root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic + qemu-system-riscv32 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80400000 -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/riscv64-virt/readme.txt b/board/qemu/riscv64-virt/readme.txt index 84c7ab3221..c075cc464d 100644 --- a/board/qemu/riscv64-virt/readme.txt +++ b/board/qemu/riscv64-virt/readme.txt @@ -1,6 +1,6 @@ Run Linux in emulation with: - qemu-system-riscv64 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80200000 -append "root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic + qemu-system-riscv64 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80200000 -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/sh4-r2d/readme.txt b/board/qemu/sh4-r2d/readme.txt index d22af73ae3..dd80953b97 100644 --- a/board/qemu/sh4-r2d/readme.txt +++ b/board/qemu/sh4-r2d/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-sh4 -M r2d -kernel output/images/zImage -drive file=output/images/rootfs.ext2,if=ide,format=raw -append "root=/dev/sda console=ttySC1,115200 noiotrap" -serial null -serial stdio -net nic,model=rtl8139 -net user + qemu-system-sh4 -M r2d -kernel output/images/zImage -drive file=output/images/rootfs.ext2,if=ide,format=raw -append "rootwait root=/dev/sda console=ttySC1,115200 noiotrap" -serial null -serial stdio -net nic,model=rtl8139 -net user The login prompt will appear in the terminal that started Qemu. The graphical window is the framebuffer. diff --git a/board/qemu/sh4eb-r2d/readme.txt b/board/qemu/sh4eb-r2d/readme.txt index daf515ab2b..e71a9bce90 100644 --- a/board/qemu/sh4eb-r2d/readme.txt +++ b/board/qemu/sh4eb-r2d/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-sh4eb -M r2d -kernel output/images/zImage -drive file=output/images/rootfs.ext2,if=ide,format=raw -append "root=/dev/sda console=ttySC1,115200 noiotrap" -serial null -serial stdio -net nic,model=rtl8139 -net user + qemu-system-sh4eb -M r2d -kernel output/images/zImage -drive file=output/images/rootfs.ext2,if=ide,format=raw -append "rootwait root=/dev/sda console=ttySC1,115200 noiotrap" -serial null -serial stdio -net nic,model=rtl8139 -net user The login prompt will appear in the terminal that started Qemu. The graphical window is the framebuffer. diff --git a/board/qemu/sparc-ss10/readme.txt b/board/qemu/sparc-ss10/readme.txt index df6a75a3fb..33833c2d33 100644 --- a/board/qemu/sparc-ss10/readme.txt +++ b/board/qemu/sparc-ss10/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-sparc -M SS-10 -kernel output/images/zImage -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/sda console=ttyS0,115200" -serial stdio -net nic,model=lance -net user + qemu-system-sparc -M SS-10 -kernel output/images/zImage -drive file=output/images/rootfs.ext2,format=raw -append "rootwait root=/dev/sda console=ttyS0,115200" -serial stdio -net nic,model=lance -net user The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/sparc64-sun4u/readme.txt b/board/qemu/sparc64-sun4u/readme.txt index 24d5bbaffe..f2e6e81a86 100644 --- a/board/qemu/sparc64-sun4u/readme.txt +++ b/board/qemu/sparc64-sun4u/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-sparc64 -M sun4u -kernel output/images/vmlinux -append "root=/dev/sda console=ttyS0,115200" -serial stdio -drive file=output/images/rootfs.ext2,format=raw -net nic,model=e1000 -net user + qemu-system-sparc64 -M sun4u -kernel output/images/vmlinux -append "rootwait root=/dev/sda console=ttyS0,115200" -serial stdio -drive file=output/images/rootfs.ext2,format=raw -net nic,model=e1000 -net user The login prompt will appear in the terminal that started Qemu. diff --git a/board/qemu/x86/readme.txt b/board/qemu/x86/readme.txt index c5e687734c..42fc2439da 100644 --- a/board/qemu/x86/readme.txt +++ b/board/qemu/x86/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "root=/dev/vda" -net nic,model=virtio -net user + qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda" -net nic,model=virtio -net user Optionally add -smp N to emulate a SMP system with N CPUs. diff --git a/board/qemu/x86_64/readme.txt b/board/qemu/x86_64/readme.txt index 425e34b12c..4a1c0c0ff5 100644 --- a/board/qemu/x86_64/readme.txt +++ b/board/qemu/x86_64/readme.txt @@ -1,6 +1,6 @@ Run the emulation with: - qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "root=/dev/vda" -net nic,model=virtio -net user + qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda" -net nic,model=virtio -net user Optionally add -smp N to emulate a SMP system with N CPUs.