From: Iustin Pop Date: Mon, 29 Oct 2012 13:27:15 +0000 (+0100) Subject: Fix console of xen-pvm X-Git-Tag: v0.12~4 X-Git-Url: http://git.equinoxoli.org/?p=ext%2Finstance-debootstrap.git;a=commitdiff_plain;h=7ce4d690b2a00a1a936caf4fd60b853e8ffb9d5d Fix console of xen-pvm This fixes issue 284: the current serial console code only activates is when HV_SERIAL_CONSOLE is set, but that's a parameter that applies only to kvm; for xen-pvm, we always want to activate the console, albeit on a different device. Signed-off-by: Iustin Pop Reviewed-by: Guido Trotter --- diff --git a/create b/create index 072905c..ff54976 100755 --- a/create +++ b/create @@ -122,22 +122,32 @@ auto lo iface lo inet loopback EOF +# for kvm, we should only activate a serial console if the +# 'serial_console' parameter is set; for xen-pvm though, we should +# always define a serial console +SERIAL_PORT="" if [ "$INSTANCE_HV_serial_console" = "True" ]; then + SERIAL_PORT="ttyS0" +elif [ "$HYPERVISOR" = "xen-pvm" ]; then + SERIAL_PORT="hvc0" +fi + +if [ -n "$SERIAL_PORT" ]; then if [ -e $TMPDIR/etc/inittab ]; then # debian - echo "T0:23:respawn:/sbin/getty ttyS0 38400" >> $TMPDIR/etc/inittab + echo "T0:23:respawn:/sbin/getty $SERIAL_PORT 38400" >> $TMPDIR/etc/inittab elif [ -e $TMPDIR/etc/init ]; then # ubuntu (eg. karmic) - cat > $TMPDIR/etc/init/ttyS0.conf < $TMPDIR/etc/init/${SERIAL_PORT}.conf < $TMPDIR/etc/event.d/ttyS0.conf < $TMPDIR/etc/event.d/${SERIAL_PORT}.conf <