Fix the grub2 config location for non Ubuntu/Debian systems
Fedora and openSUSE use /boot/grub2/grub.cfg for the grub2 configuration. The path that was used for Fedora before (/boot/grub/grub.conf) is only valid for older grub releases. Change-Id: I1e532c73a373a2c3f92211eff52719c2b635b7e3
This commit is contained in:
parent
c04d472064
commit
0661fa168b
|
@ -2,9 +2,18 @@
|
|||
|
||||
sed -i -e 's/ console=ttyS0//' /etc/default/grub
|
||||
|
||||
GRUB_CONFIG_FILE=/boot/grub/grub.cfg
|
||||
if [ ! -e $GRUB_CONFIG_FILE ] ; then
|
||||
# Fedora grub config file location
|
||||
GRUB_CONFIG_FILE=/boot/grub/grub.conf
|
||||
GRUB_CONFIG_FILE=""
|
||||
|
||||
if [ -e /boot/grub/grub.cfg ] ; then
|
||||
# Ubuntu and Debian are using /boot/grub/grub.cfg for the grub2
|
||||
# configuration
|
||||
GRUB_CONFIG_FILE=/boot/grub/grub.cfg
|
||||
elif [ -e /boot/grub2/grub.cfg ]; then
|
||||
# On openSUSE and recent Fedora releases the grub2 config resides
|
||||
# in /boot/grub2/grub.cfg
|
||||
GRUB_CONFIG_FILE=/boot/grub2/grub.cfg
|
||||
fi
|
||||
|
||||
if [ "$GRUB_CONFIG_FILE" ]; then
|
||||
sed -i -e 's/ console=ttyS0//' $GRUB_CONFIG_FILE
|
||||
fi
|
||||
sed -i -e 's/ console=ttyS0//' $GRUB_CONFIG_FILE
|
||||
|
|
Loading…
Reference in New Issue