commit:     8d1b1ff68fc56f79739c02bbe5ebe9ef14933825
Author:     Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 20 02:25:56 2015 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Thu Aug 20 02:25:56 2015 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=8d1b1ff6

add in the isoroot/cdroot verification patch from pentoo

 defaults/busy-config     |  2 +-
 defaults/initrd.defaults |  1 +
 defaults/initrd.scripts  | 16 ++++++++++++++++
 defaults/linuxrc         |  3 +++
 4 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/defaults/busy-config b/defaults/busy-config
index b1188e9..aed797e 100644
--- a/defaults/busy-config
+++ b/defaults/busy-config
@@ -306,7 +306,7 @@ CONFIG_FEATURE_HUMAN_READABLE=y
 #
 # Common options for md5sum, sha1sum, sha256sum, sha512sum
 #
-# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
 
 #
 # Console Utilities

diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
index 5e8fdbe..a5eb3ba 100755
--- a/defaults/initrd.defaults
+++ b/defaults/initrd.defaults
@@ -67,6 +67,7 @@ CDROOT_PATH='/mnt/cdrom'
 # This is the file that the cdroot will be checked for as a
 # marker. It must exist RELATIVE to the cdroot.
 CDROOT_MARKER='/livecd'
+VERIFY=0
 
 # AUFS variables
 aufs=0

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index a07a408..2612574 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -233,6 +233,22 @@ bootstrapCD() {
 
        findmediamount "cdrom" "${SUBDIR}/${CDROOT_MARKER}" \
                "REAL_ROOT" "${CDROOT_PATH}" ${DEVICES}
+       if [ $VERIFY = 1 ]; then
+               cd "${CDROOT_PATH}"
+               if [ -f isoroot_checksums ]; then
+                       good_msg "Verifying checksums, this may take some 
time..."
+                       if ! busybox sha512sum -c isoroot_checksums; then
+                               bad_msg "Some checksums failed, press any key 
to poweroff..."
+                               read -n1 -s
+                               busybox poweroff -f
+                       else
+                               good_msg "Checksums all valid, continuing 
boot..."
+                       fi
+                       cd $OLDPWD
+               else
+                       bad_msg "Verify enabled but no checksums file exists, 
skipping"
+               fi
+       fi
 }
 
 bootstrapKey() {

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 46b2151..ebf26b5 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -283,6 +283,9 @@ do
                nounionfs)
                        USE_UNIONFS_NORMAL=0
                        ;;
+               verify)
+                       VERIFY=1
+               ;;
        esac
 done
 

Reply via email to