commit:     80cb0abc18d2ff9143f657c960eebd7aa082f61a
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  2 12:29:14 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Oct  2 12:29:14 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=80cb0abc

gen_cmdline.sh: Move --bootloader validation to determine_real_args()

This will allow us to always validate set bootloader at a single place.

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

 gen_cmdline.sh       | 7 -------
 gen_determineargs.sh | 8 ++++++++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index d74c8f8..825b80c 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -443,13 +443,6 @@ 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 3 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}"
                        ;;
                --no-bootloader)

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 28590d3..5b43160 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -557,6 +557,14 @@ determine_real_args() {
                fi
        fi
 
+       case "${BOOTLOADER}" in
+               no|grub|grub2)
+                       ;;
+               *)
+                       gen_die "Invalid bootloader '${BOOTLOADER}'; 
--bootloader=<bootloader> requires one of: no, grub, grub2"
+                       ;;
+       esac
+
        if isTrue "${KERNEL_SOURCES}"
        then
                if [ ! -d ${KERNEL_DIR} ]

Reply via email to