diskimage-builder/elements/vm/finalise.d/52-force-text-mode-console
Victor Lowther 43b70ce224 /bin/bash all the things.
Since we are using bash syntax in some of the element fragments,
we should make sure we use bash for all of them, so that things don't
break on systems where /bin/sh != /bin/bash.

Change-Id: If2f043c57aa4e1492b7f9839213ef6123f683612
2013-11-17 16:59:31 -06:00

26 lines
732 B
Bash
Executable file

#!/bin/bash
set -e
# If lsb_release is missing, just do nothing.
DISTRO=`lsb_release -si` || true
GRUBFILE=""
echo 'GRUB_TERMINAL=console' >>/etc/default/grub
echo 'GRUB_GFXPAYLOAD_LINUX=text' >>/etc/default/grub
case $DISTRO in
'Ubuntu'|'Debian')
sed -i -e 's/\(^GRUB_CMDLINE_LINUX.*\)"$/\1 nofb nomodeset vga=normal"/' /etc/default/grub
update-grub
;;
'Fedora')
# By default the F19 cloud image is using extlinux to boot the image
if [ -f /boot/grub2/grub.cfg ]; then
echo 'GRUB_CMDLINE_LINUX="nofb nomodeset vga=normal"' >/etc/default/grub
sed -i -e 's/terminal_output gfxterm/terminal_output console/' /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfg
fi
;;
esac