installer.sh: add vga=xxx and nomodeset kernel options to installed system if found in live /proc/cmdline

This commit is contained in:
Silvan Calarco 2012-03-31 18:35:57 +02:00
parent f9d8281bff
commit 8047151ceb
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,3 @@
VERSION=2.5.1
VERSION=2.5.2

View File

@ -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"