Merge "Changed serial console setup"

This commit is contained in:
Jenkins 2014-09-09 12:42:31 +00:00 committed by Gerrit Code Review
commit bab742c854

View File

@ -120,8 +120,10 @@ function install_grub2 {
DIST=`lsb_release -is` DIST=`lsb_release -is`
[ -n "$DIST" ] [ -n "$DIST" ]
echo 'GRUB_TERMINAL=console' >>/etc/default/grub echo 'GRUB_TERMINAL="serial console"' >>/etc/default/grub
echo 'GRUB_GFXPAYLOAD_LINUX=text' >>/etc/default/grub echo 'GRUB_GFXPAYLOAD_LINUX=text' >>/etc/default/grub
echo 'GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200"' >>/etc/default/grub
echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >>/etc/default/grub
GRUB_MKCONFIG="grub2-mkconfig -o $GRUB_CFG" GRUB_MKCONFIG="grub2-mkconfig -o $GRUB_CFG"
case $DIST in case $DIST in
'Ubuntu'|'Debian') 'Ubuntu'|'Debian')
@ -167,10 +169,6 @@ function install_grub2 {
sed -i "s%$PART_DEV%LABEL=cloudimg-rootfs%" $GRUB_CFG sed -i "s%$PART_DEV%LABEL=cloudimg-rootfs%" $GRUB_CFG
sed -i "s%search --no-floppy --fs-uuid --set=root .*$%search --no-floppy --set=root --label cloudimg-rootfs%" $GRUB_CFG sed -i "s%search --no-floppy --fs-uuid --set=root .*$%search --no-floppy --set=root --label cloudimg-rootfs%" $GRUB_CFG
sed -i "s%root=UUID=[A-Za-z0-9\-]*%root=LABEL=cloudimg-rootfs%" $GRUB_CFG sed -i "s%root=UUID=[A-Za-z0-9\-]*%root=LABEL=cloudimg-rootfs%" $GRUB_CFG
if [ "$DIST" = 'Debian' ] || [ "$DIST" = 'Fedora' ]; then
# enable serial console
sed -i "s%LABEL=cloudimg-rootfs%LABEL=cloudimg-rootfs console=tty0 console=ttyS0,115200%" $GRUB_CFG
fi
if [ "$DIST" = 'Fedora' ] ; then if [ "$DIST" = 'Fedora' ] ; then
if [ $(lsb_release -rs) = '19' ]; then if [ $(lsb_release -rs) = '19' ]; then
sed -i "s%UUID=[A-Za-z0-9\-]*%LABEL=cloudimg-rootfs%" /etc/fstab sed -i "s%UUID=[A-Za-z0-9\-]*%LABEL=cloudimg-rootfs%" /etc/fstab