qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to solve: 'Please append a correct "root=" boot option' ?


From: Thomas Huth
Subject: Re: How to solve: 'Please append a correct "root=" boot option' ?
Date: Thu, 20 Apr 2023 09:46:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 20/04/2023 04.40, Freitas GDH wrote:
Hi there!

I'm using a customized qemu-4.0.0 with SOC RT3352 (implemented by Firmguide <https://github.com/cyruscyliu/firmguide>) in order to emulate D-Link DIR-615 firmware. Using an openwrt file I got a dtb file and compiled qemu successfully. But when I'm trying to emulate the firmware, I'm not able to identify the right mapping for my FS image file. I used two different squashfs files, one extracted from stock firmware and the other from openwrt lede-17.01.7 image. In both cases I got the same error. The following are the command syntax used.

//tmp/qemu-4.0.0/mipsel-softmmu/qemu-system-mipsel \
-D /dev/null \
-M fg_DIR_615_H1_ralink_rt3352_soc \
-kernel /home/fenix/firmguide/_lede-17.01.7-ramips-rt305x-dir-615-h1-squashfs-sysupgrade.bin.extracted/0.uimage \ -dtb /home/fenix/firmguide/_lede-17.01.7-ramips-rt305x-dir-615-h1-squashfs-sysupgrade.bin.extracted/_40.extracted/410.dtb,offset=0x410 \
-nographic \
-drive file=/tmp/dir-615_H1/lede-17.01.7_dir-615.squashfs,if=none,format=raw \
-append "root=/dev/vda"/

With "-drive ...,if=none,..." you only configure a *backend* for a block device, but it is not automatically wired to any of the emulated devices. You need to know which hardware device in your emulated machine should be used as block device *frontend*. Then you either have to use "-drive ...,if=ide,..." or "if=scsi" or "if=virtio" or whatever, or add an "id=xxx" parameter to the drive option and configure the device with "-device yyy,drive=xxx". It all depends on the implementation of the machine that you are using. No clue about that fg_DIR_615_H1_ralink_rt3352_soc machine, though, since it is not an upstream machine, I guess you have to look at the source code if there is no documentation available.

 HTH,
  Thomas

PS: If you feel lost in the QEMU parameter jungle, I recommend https://archive.fosdem.org/2018/schedule/event/vai_qemu_jungle/ ... block devices start around minute 25:23 in the presentation.

I used: vda, vda1, sda, sda1.

Piece of log:

[    1.544687] rt2880_wdt 10000120.watchdog: Initialized
[    1.546636] NET: Registered protocol family 10
[    1.558513] NET: Registered protocol family 17
[    1.559810] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    1.560308] 8021q: 802.1Q VLAN Support v1.8
[    1.564650] fdt: not creating '/sys/firmware/fdt': CRC check failed
*[    1.579213] VFS: Cannot open root device "vda" or unknown-block(0,0): error -6 [    1.579566] Please append a correct "root=" boot option; here are the available partitions: [    1.580137] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)*
[    1.582285] Rebooting in 1 seconds..
[    3.551589] Reboot failed -- System halted


But if instead of /-drive /I use -/initrd/ the emulation runs successfully.
-initrd 0.cpio \
-append "console=ttyS0 nowatchdog nokaslr"

O also tried to create a cpio file from the squashfs files, but I got the same error 'cannot open root device...'.

Thank you !




reply via email to

[Prev in Thread] Current Thread [Next in Thread]