From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1114246-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 4768F138334
	for <garchives@archives.gentoo.org>; Wed,  2 Oct 2019 22:45:35 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id A5D77E0919;
	Wed,  2 Oct 2019 22:45:31 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 91132E0919
	for <gentoo-commits@lists.gentoo.org>; Wed,  2 Oct 2019 22:45:31 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 64C2334B7CF
	for <gentoo-commits@lists.gentoo.org>; Wed,  2 Oct 2019 22:45:30 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 9F034830
	for <gentoo-commits@lists.gentoo.org>; Wed,  2 Oct 2019 22:45:27 +0000 (UTC)
From: "Thomas Deutschmann" <whissi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" <whissi@gentoo.org>
Message-ID: <1570019354.80cb0abc18d2ff9143f657c960eebd7aa082f61a.whissi@gentoo>
Subject: [gentoo-commits] proj/genkernel:master commit in: /
X-VCS-Repository: proj/genkernel
X-VCS-Files: gen_cmdline.sh gen_determineargs.sh
X-VCS-Directories: /
X-VCS-Committer: whissi
X-VCS-Committer-Name: Thomas Deutschmann
X-VCS-Revision: 80cb0abc18d2ff9143f657c960eebd7aa082f61a
X-VCS-Branch: master
Date: Wed,  2 Oct 2019 22:45:27 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 05dac1f4-3fd0-4e95-89ca-c46bb1fb7fd8
X-Archives-Hash: 9de982807f39bd786801620617663cd1

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} ]