On 11/1/2017 1:07 PM, Peter Maydell wrote: > On 1 November 2017 at 13:34, poxyran <poxyran...@gmail.com> wrote: >> Hi all!, >> >> I'm trying to emulate a firmware from a DLink IP camera using >> qemu-system-arm but I'm facing some troubles. >> >> I'm using the following command line: >> >> fastix@bulin:~/QEMU/armel$ sudo qemu-system-arm -M versatilepb -kernel >> vmlinuz-2.6.32-5-versatile -initrd >> /home/fastix/dcs-942l/binary_blob.bin.swap_unpacked/initramfs.cpio -hda >> debian_squeeze_armel_standard.qcow2 -serial stdio -append >> "root=/dev/sda1 console=ttyAMA0 console=ttyS0 init=/bin/ash" -net nic >> -net tap >> >> Even though I get some errors related to devices that are not present, >> the firmware seems to boot OK but at the end, I got the following error: > I'm a bit surprised it worked at all, really :-) Well, with some errors but booted up :) > >> starting pid 11724, tty '': '/bin/sh < /dev/ttyS0 2>&1 > /dev/ttyS0' >> /bin/sh: can't open /dev/ttyS0: no such file[: bad number > This is because for the versatile platform the serial ports > are named ttyAMA0, ttyAMA1, not ttyS0 (and have different > device major/minor numbers). Does just dropping 'console=ttyS0' > from your command line fix this? I just removed the "console=ttys0" and tried again but I got the same result :( > > Otherwise if you need to run some script inside the guest > that assumes ttyS0 you may be able to work around it by > hacking around with the /dev/ files (assuming they're not > autocreated by udev or similar). > > You'll find that anything in the guest filesystem that > expects to know what the actual hardware is (eg that > talks to the camera) won't work, of course. I was looking around the firmware files and saw that /etc/inittab has the following information:
::sysinit:/etc/rc.d/rcS start ::respawn:/bin/sh < /dev/ttyS0 2>&1 > /dev/ttyS0 ::restart:/sbin/init is there any way to workaround this? > thanks > -- PMM