From e186d9bb47bf619587b7d8880a4be790ba4747c4 Mon Sep 17 00:00:00 2001 From: godalming123 Date: Sun, 27 Feb 2022 10:53:10 +0000 Subject: [PATCH] add option to install grub or not --- scripts/0-preinstall.sh | 2 ++ scripts/3-post-setup.sh | 4 +++- scripts/startup.sh | 23 ++++++++++++++++++----- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/scripts/0-preinstall.sh b/scripts/0-preinstall.sh index b289307..e87e45d 100755 --- a/scripts/0-preinstall.sh +++ b/scripts/0-preinstall.sh @@ -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 diff --git a/scripts/3-post-setup.sh b/scripts/3-post-setup.sh index ea57c33..f3e1857 100755 --- a/scripts/3-post-setup.sh +++ b/scripts/3-post-setup.sh @@ -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 " ------------------------------------------------------------------------- diff --git a/scripts/startup.sh b/scripts/startup.sh index 2c3cfed..8d40464 100755 --- a/scripts/startup.sh +++ b/scripts/startup.sh @@ -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 ===