commit:     98eb64bd3194ad77b093b68612d345f62bee30e5
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 23 02:01:51 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Mar 23 08:06:17 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=98eb64bd

Update bootloader handling

- Add --no-bootloader parameter

- Treat empty BOOTLOADER like "no" value

- Output information when bootloader update was skipped

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_bootloader.sh    |  7 ++++++-
 gen_cmdline.sh       | 18 ++++++++++++++++--
 gen_determineargs.sh |  1 +
 genkernel.conf       |  2 +-
 4 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/gen_bootloader.sh b/gen_bootloader.sh
index 2a0a43d..3e3ecb0 100755
--- a/gen_bootloader.sh
+++ b/gen_bootloader.sh
@@ -1,6 +1,8 @@
 # $Id$
 
 set_bootloader() {
+       print_info 1 ''
+
        case "${BOOTLOADER}" in
                grub)
                        set_bootloader_grub
@@ -8,8 +10,11 @@ set_bootloader() {
                grub2)
                        set_bootloader_grub2
                        ;;
+               no)
+                       print_info 1 "No bootloader set: Skipping bootloader 
update!"
+                       ;;
                *)
-                       print_warning "Bootloader ${BOOTLOADER} is not 
currently supported"
+                       print_warning 1 "Bootloader '${BOOTLOADER}' is 
currently not supported"
                        ;;
        esac
 }

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 6388e93..2fb9ace 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -118,8 +118,10 @@ longusage() {
   echo "       --hyperv                Include Microsoft Hyper-V support"
   echo "       --no-hyperv             Exclude Microsoft Hyper-V support"
   echo "       --ssh                   Include SSH (dropbear) support"
-  echo "       --no-ssh                Exclude SSH (dropbear) support"
-  echo "       --bootloader=grub       Add new kernel to GRUB configuration"
+  echo "       --no-ssh                Exclude SSH (dropbear) support"
+  echo "       --bootloader=(grub|grub2)"
+  echo "                               Add new kernel to GRUB (grub) or GRUB2 
(grub2) bootloader"
+  echo "       --no-bootloader         Skip bootloader update"
   echo "       --linuxrc=<file>        Specifies a user created linuxrc"
   echo "       --busybox-config=<file> Specifies a user created busybox config"
   echo "       --genzimage             Make and install kernelz image 
(PowerPC)"
@@ -411,6 +413,18 @@ parse_cmdline() {
                        ;;
                --bootloader=*)
                        CMD_BOOTLOADER="${*#*=}"
+                       [ -z "${CMD_BOOTLOADER}" ] && CMD_BOOTLOADER="no"
+                       case "${CMD_BOOTLOADER}" in
+                               no|grub|grub2)
+                                       ;;
+                               *)
+                                       echo "Error: Bootloader 
'${CMD_BOOTLOADER}' is unsupported."
+                                       exit 1
+                       esac
+                       print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}"
+                       ;;
+               --no-bootloader)
+                       CMD_BOOTLOADER="no"
                        print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}"
                        ;;
                --iscsi|--no-iscsi)

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index fdfcef9..2a7d008 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -119,6 +119,7 @@ determine_real_args() {
        set_config_with_override BOOL   DMRAID               CMD_DMRAID
        set_config_with_override BOOL   ISCSI                CMD_ISCSI
        set_config_with_override BOOL   HYPERV               CMD_HYPERV
+       set_config_with_override STRING BOOTLOADER           CMD_BOOTLOADER     
      "no"
        set_config_with_override BOOL   BUSYBOX              CMD_BUSYBOX        
      "yes"
        set_config_with_override BOOL   NFS                  CMD_NFS            
      "yes"
        set_config_with_override STRING MICROCODE            CMD_MICROCODE      
      "all"

diff --git a/genkernel.conf b/genkernel.conf
index 38f6bbf..687db35 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -144,7 +144,7 @@ DISKLABEL="yes"
 
 # Add new kernel to grub
 # Possible values: empty/"no", "grub", "grub2"
-#BOOTLOADER=""
+#BOOTLOADER="no"
 
 # Add boot splash using splashutils
 #SPLASH="no"

Reply via email to