From 3c3ee47e827fb5044683a1d5feefd948635f0a46 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Fri, 10 May 2013 14:59:35 +1200 Subject: [PATCH] Enable serial console for fedora Change-Id: Ic3695f643f3d00457fd97d18863793d60d3f211d --- elements/vm/finalise.d/51-grub | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/elements/vm/finalise.d/51-grub b/elements/vm/finalise.d/51-grub index b394db0d..b6bfbbba 100755 --- a/elements/vm/finalise.d/51-grub +++ b/elements/vm/finalise.d/51-grub @@ -35,6 +35,8 @@ if [ -f "/boot/grub/grub.cfg" ] ; then elif [ -f "/boot/grub2/grub.cfg" ] ; then GRUB_CFG=/boot/grub2/grub.cfg fi +DIST=`lsb_release -is` +[ -n "$DIST" ] RELEASE=`lsb_release -cs` [ -n "$RELEASE" ] # grub-mkconfig generates a config with the device in it, @@ -53,3 +55,7 @@ sed -i "s%search --no-floppy --fs-uuid --set=root .*$%search --no-floppy --set=r sed -i "s%root=UUID=[A-Za-z0-9\-]*%root=LABEL=cloudimg-rootfs%" $GRUB_CFG # Fedora sets up for root to have a label of "_/" sed -i "s%LABEL=_/%LABEL=cloudimg-rootfs%" /etc/fstab +if [ $DIST = 'Fedora' ] ; then + # enable serial console + sed -i "s%LABEL=cloudimg-rootfs%LABEL=cloudimg-rootfs console=tty0 console=ttyS0,115200%" $GRUB_CFG +fi