If we make sure that the instance os spawns a getty on /dev/console we
cover both the case where console is on tty1 and the serial console one
where it's on ttyS0. In order to do this we modify /etc/inittab on
debian, and /etc/event.d on ubuntu.
Reviewed-by: imsnah
iface lo inet loopback
EOF
+if [ -e $TMPDIR/etc/inittab ]; then
+ cat $TMPDIR/etc/inittab | sed -re 's/\stty1$/ console/' \
+ > $TMPDIR/etc/inittab.new
+ mv $TMPDIR/etc/inittab.new $TMPDIR/etc/inittab
+elif [ -e $TMPDIR/etc/event.d/tty1 ]; then
+ cat $TMPDIR/etc/event.d/tty1 | sed -re 's/tty1/console/' \
+ > $TMPDIR/etc/event.d/console
+ rm $TMPDIR/etc/event.d/tty1
+fi
+
umount $TMPDIR
rmdir $TMPDIR
trap - EXIT