From: Guido Trotter Date: Thu, 14 Aug 2008 15:15:12 +0000 (+0000) Subject: debootstrap create: activate serial console X-Git-Tag: v0.6~20 X-Git-Url: http://git.equinoxoli.org/?p=ext%2Finstance-debootstrap.git;a=commitdiff_plain;h=b93026c10716e23e5af7b3477fe8abf9ba53a9cc debootstrap create: activate serial console 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 --- diff --git a/create.in b/create.in index 16c16ad..123e081 100755 --- a/create.in +++ b/create.in @@ -142,6 +142,16 @@ auto lo 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