diskimage-builder/elements/vm/finalise.d/52-force-text-mode-console
Chris Jones b50dbb0571 Move textmode forcer to vm element.
Changing the grub config makes no sense in a build not heading for a vm
and may fail because grub is removed from images not including the vm
element. Forcing textmode for those images would be better done in nova.

Change-Id: I1c5b89e551e62df2463200b1889cb2342498c7dd
2013-09-18 01:57:35 +01:00

27 lines
730 B
Bash
Executable File

#!/bin/sh
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