4
votes

I am investigating the source code for QEMU.

I opened it with Eclipse and configured the environment. Then I can build it for the ARM platform and run it by booting Linux.

When debugging, it fails after running through some functions. The error message is:

qemu: could not open disk image rdinit=/bin/sh": No such file or directory
1
It looks like QEMU tries to use your host's /bin/sh without architecture checks. Try to grab an already compiled binary of sh for your target platform on the internet (busybox renamed to sh will run fine) and use it with QEMU - Dmytro Sirenko
Using Eclipse, QEMU can boot Linux with busybox as file system. However, error occurs when I debug QEMU in the same environment. That is weird because if I can run QEMU, I will be able to debug it. - Tran Dung

1 Answers

0
votes

looks like there's missing " (double quote character) somewhere in project configuration files, or, maybe, a redundant one.

a typical QEMU invocation is qemu-system-arm -kernel path/to/zImage -initrd path/to/test_rootfs -append "root=/dev/ram rdinit=/test"

if you skip first double quote just after -append - qemu will think that rdinit=/test is a disk image, and try to open it as a file

one possible solution is to grep your eclipse project dir for "rdinit" keyword and examine all grep results for missing/redundant quotes

cd /your/project/dir
grep -rw rdinit .