d799ad5beb
Apply a wider range of hammers to the recurring issue of images booting with graphical consoles. Change-Id: I96345bf8f2f13d615131557b572201b9d41b6c75
26 lines
730 B
Bash
Executable file
26 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
|