From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1160104-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 91B5D138350
	for <garchives@archives.gentoo.org>; Thu,  9 Apr 2020 17:37:05 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id D79FFE0932;
	Thu,  9 Apr 2020 17:37:04 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(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 BED09E0932
	for <gentoo-commits@lists.gentoo.org>; Thu,  9 Apr 2020 17:37:04 +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 A388434F04D
	for <gentoo-commits@lists.gentoo.org>; Thu,  9 Apr 2020 17:37:03 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 4B3A0154
	for <gentoo-commits@lists.gentoo.org>; Thu,  9 Apr 2020 17:37:02 +0000 (UTC)
From: "Rick Farina" <zerochaos@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, "Rick Farina" <zerochaos@gentoo.org>
Message-ID: <1586453815.621a5e4659939f0d4d447e16667004fc41384f7d.zerochaos@gentoo>
Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/
X-VCS-Repository: proj/genkernel
X-VCS-Files: defaults/initrd.scripts
X-VCS-Directories: defaults/
X-VCS-Committer: zerochaos
X-VCS-Committer-Name: Rick Farina
X-VCS-Revision: 621a5e4659939f0d4d447e16667004fc41384f7d
X-VCS-Branch: master
Date: Thu,  9 Apr 2020 17:37:02 +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: e2cf4789-e825-4e1b-9cb0-fae81a72a85e
X-Archives-Hash: 59900d8fca9c166807bf5f7b6fc53ec2

commit:     621a5e4659939f0d4d447e16667004fc41384f7d
Author:     Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  9 17:35:46 2020 +0000
Commit:     Rick Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Thu Apr  9 17:36:55 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=621a5e46

defaults/initrd.scripts: proper b2sum missing error

sanify checks a little

Signed-off-by: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo.org>

 defaults/initrd.scripts | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 7c115cb..b5da21a 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -320,15 +320,28 @@ bootstrapCD() {
 		cd "${CDROOT_PATH}"
 		checkfile=""
 		checker=""
-		if [ -r "isoroot_b2sums" ] && [ -x "$(command -v b2sum 2>&1)" ]
-		then
-			checkfile="isoroot_b2sums"
-			checker="b2sum"
-		elif [ -r "isoroot_checksums" ]
+		if [ -r "isoroot_checksums" ] && [ -z "${checkfile}" ]
 		then
 			checkfile="isoroot_checksums"
 			checker="sha512sum"
 		fi
+		if [ -r "isoroot_b2sums" ]
+		then
+			if [ -x "$(command -v b2sum 2>&1)" ]
+			then
+				checkfile="isoroot_b2sums"
+				checker="b2sum"
+			else
+				bad_msg "Unable to verify isoroot_b2sums due to missing b2sums"
+				bad_msg "Please use 'genkernel --b2sums' to generate initramfs"
+				if [ -z "${checkfile" ]
+				then
+					bad_msg "Press any key to skip ..."
+					read -n1 -s
+					return
+				fi
+			fi
+		fi
 
 		if [ -n "${checkfile}" ]
 		then