X-Git-Url: http://git.equinoxoli.org/?p=ext%2Finstance-debootstrap.git;a=blobdiff_plain;f=create;h=ff549767a11a5f6b18c320b31c9389efeee5837b;hp=072905ce59207166a2ba6d4ccf026fc0f75220d6;hb=7ce4d690b2a00a1a936caf4fd60b853e8ffb9d5d;hpb=31ca0c96bfee38f2662a5fb017ff760884f4bc02 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 <