add option to install grub or not

This commit is contained in:
godalming123 2022-02-27 10:53:10 +00:00 committed by GitHub
parent dee731352d
commit e186d9bb47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 6 deletions

View File

@ -155,6 +155,7 @@ echo "
Generated /etc/fstab:
"
cat /mnt/etc/fstab
if [${GRUB_INSTALL} == "yes"]; then
echo -ne "
-------------------------------------------------------------------------
GRUB BIOS Bootloader Install & Check
@ -165,6 +166,7 @@ if [[ ! -d "/sys/firmware/efi" ]]; then
else
pacstrap /mnt efibootmgr --noconfirm --needed
fi
fi
echo -ne "
-------------------------------------------------------------------------
Checking for low memory systems <8G

View File

@ -33,8 +33,8 @@ fi
# set kernel parameter for adding splash screen
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="[^"]*/& splash /' /etc/default/grub
echo -e "Installing CyberRe Grub theme..."
if [ "$GRUB_THEME" == "cyberRE"]; then
echo -e "Installing CyberRe Grub theme..."
THEME_DIR="/boot/grub/themes"
THEME_NAME=CyberRe
echo -e "Creating the theme directory..."
@ -49,9 +49,11 @@ if [ "$GRUB_THEME" == "cyberRE"]; then
echo "GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"" >> /etc/default/grub
fi
if [ "$GRUB_INSTALL" == "yes"]; then
echo -e "Updating grub..."
grub-mkconfig -o /boot/grub/grub.cfg
echo -e "All set!"
fi
echo -ne "
-------------------------------------------------------------------------

View File

@ -287,15 +287,28 @@ read -rep "Please enter your hostname: " nameofmachine
set_option NAME_OF_MACHINE $nameofmachine
}
# === install grub or not ===
grubInstall () {
echo -ne "Install grub?:\n"
options=(yes no)
select_option $? 4 "${options[@]}"
grub_install=${options[$?]}
set_option GRUB_INSTALL $grub_install
}
# === select grub theme ===
grubTheme () {
clear
logo
echo -ne "Select your grub theme:\n"
options=(cyberRE none)
select_option $? 4 "${options[@]}"
grub_theme=${options[$?]}
set_option GRUB_THEME $grub_theme
grub_install
if ["$GRUB_INSTALL" == "yes"]; then
echo -ne "Select your grub theme:\n"
options=(cyberRE none)
select_option $? 4 "${options[@]}"
grub_theme=${options[$?]}
set_option GRUB_THEME $grub_theme
else
set_option GRUB_THEME none
}
# === Let the user choose AUR helper from predefined list ===