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

Reply via email to