From 8047151ceb2c29baec27cbc1a64998a493ac5978 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 31 Mar 2012 18:35:57 +0200 Subject: [PATCH] installer.sh: add vga=xxx and nomodeset kernel options to installed system if found in live /proc/cmdline --- VERSION | 2 +- installer/installer.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b7d790e..7af8b16 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ -VERSION=2.5.1 +VERSION=2.5.2 diff --git a/installer/installer.sh b/installer/installer.sh index c5f0101..78729eb 100755 --- a/installer/installer.sh +++ b/installer/installer.sh @@ -435,6 +435,23 @@ if [ "$INSTALL_BOOTLOADER_DEVICE" ]; then break fi done + + CMDLINE=`cat /proc/cmdline` + echo $"Current kernel command line is '$CMDLINE'" + VGA_ADD=`echo $CMDLINE | grep "vga=" | sed "s|.*\(vga=[0-9]*\).*|\1|"` + NOMODESET_ADD=`echo $CMDLINE | grep "nomodeset" | sed "s|.*\(nomodeset\).*|\1|"` + if [ "$VGA_ADD" ]; then + GRUB_CMDLINE_ADD="$VGA_ADD" + echo $"Adding $VGA_ADD to kernel command line" + fi + if [ "$NOMODESET_ADD" ]; then + GRUB_CMDLINE_ADD="$GRUB_CMDLINE_ADD $NOMODESET_ADD" + echo $"Adding '$NOMODESET_ADD' to kernel command line" + fi + if [ "$GRUB_CMDLINE_ADD" ]; then + sed -i "s|GRUB_CMDLINE_LINUX=\"\(.*\)\"|GRUB_CMDLINE_LINUX=\"\1 $GRUB_CMDLINE_ADD\"|" $MOUNTPOINT/etc/default/grub + fi + echo "GRUB_INSTALL_DEVICE=$INSTALL_BOOTLOADER_DEVICE_BYID" >> $MOUNTPOINT/etc/sysconfig/grub if [ "$INSTALL_BOOTLOADER_DEVICE_INTERNAL" != "1" ]; then echo $"Installing grub bootloader on removable device $INSTALL_BOOTLOADER_DEVICE"