Use grub2-mkconfig if update-grub isn't present
update-grub doesn't exist on fedora so if the legacy grub config file is being used use grub2-mkconfig instead. Also slightly change the sed GRUB_CMDLINE_LINUX regex so that it will match if the command line already contains entries. Change-Id: I21ce382a0023d674a4a2e6afecc9bc678791eac9
This commit is contained in:
parent
b3b5c2ba69
commit
4c674a2476
@ -19,8 +19,13 @@
|
|||||||
# cpu resources can be used without the risk of becoming dependent on more
|
# cpu resources can be used without the risk of becoming dependent on more
|
||||||
# memory.
|
# memory.
|
||||||
if [ -f /etc/default/grub ] ; then
|
if [ -f /etc/default/grub ] ; then
|
||||||
sudo sed -i -e 's/^GRUB_TIMEOUT=[0-9]\+/GRUB_TIMEOUT=0/' -e 's/#\?GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="mem=8G"/g' /etc/default/grub
|
sudo sed -i -e 's/^GRUB_TIMEOUT=[0-9]\+/GRUB_TIMEOUT=0/' -e 's/#\?GRUB_CMDLINE_LINUX="/GRUB_CMDLINE_LINUX="mem=8G /g' /etc/default/grub
|
||||||
|
if which update-grub &> /dev/null ; then
|
||||||
sudo update-grub
|
sudo update-grub
|
||||||
|
else
|
||||||
|
# If update-grub isn't available, use grub2-mkconfig directly
|
||||||
|
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||||
|
fi
|
||||||
elif [ -f /boot/grub/grub.conf ] ; then
|
elif [ -f /boot/grub/grub.conf ] ; then
|
||||||
sudo sed -i -e 's/^timeout=[0-9]\+/timeout=0/' -e 's/\(^\s\+kernel.*\)/\1 mem=8G/' /boot/grub/grub.conf
|
sudo sed -i -e 's/^timeout=[0-9]\+/timeout=0/' -e 's/\(^\s\+kernel.*\)/\1 mem=8G/' /boot/grub/grub.conf
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user