On 1 November 2017 at 18:31, poxyran <poxyran...@gmail.com> wrote: > > > 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
>> 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). > 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? (1) since you're using "init=/bin/ash" then nothing will read /etc/inittab, so it shouldn't make a difference (2) if you do want to run the guest init, then try the trick I suggest above of messing with what the filesystem has in /dev/ and/or editing inittab. (You need to have (a) a /dev/ttysomething with the right major/minor for the versatilepb ttyAMA0 and (b) inittab be using that, so either (1) leave inittab as is and make /dev/ttyS0 be (a symlink to?) the right dev node, or (2) leave /dev/ttyS0 where it is, create a correct /dev/ttyAMA0 and make inittab use that.) thanks -- PMM