From: Guido Trotter Date: Sun, 1 Nov 2009 21:23:41 +0000 (-0500) Subject: Fix serial console X-Git-Tag: v0.9~1 X-Git-Url: http://git.equinoxoli.org/?p=ext%2Finstance-debootstrap.git;a=commitdiff_plain;h=6ab7b57d0cdef722145450582440cce5faf52403 Fix serial console - Binding the console on /dev/console makes it impossible to send control characters (eg. ctrl+C). Now that we can, on the ganeti side, support a better console mode, with a proper escape character, in order to have a working console on the instance side we explicitely bind getty to ttyS0, but only when the relevant hypervisor parameter is set (of course if that's later changed one has to do the relevant change inside the instance, or he'll see init error messages on the console) - Ubuntu has changed to yet another style for init config. Support both. Signed-off-by: Guido Trotter Reviewed-by: Iustin Pop --- diff --git a/create b/create index 252a512..1f3c0bd 100755 --- a/create +++ b/create @@ -121,14 +121,35 @@ 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 +if [ "$INSTANCE_HV_serial_console" = "True" ]; then + if [ -e $TMPDIR/etc/inittab ]; then + # debian + echo "T0:23:respawn:/sbin/getty ttyS0 38400" >> $TMPDIR/etc/inittab + elif [ -e $TMPDIR/etc/init ]; then + # ubuntu (eg. karmic) + cat > $TMPDIR/etc/init/ttyS0.conf < $TMPDIR/etc/event.d/ttyS0.conf <