From: Jeremy Katz Date: Wed, 22 Jul 2009 20:06:29 +0000 (-0400) Subject: Support checking the iso X-Git-Tag: 0.8~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c56b63d1bd06e3eaf149502d7c46c59a5978fd44;p=thirdparty%2Fdracut.git Support checking the iso Support checking the iso image with checkisomd5 if available --- diff --git a/modules.d/90dmsquash-live/dmsquash-live-root b/modules.d/90dmsquash-live/dmsquash-live-root index fcce65b18..b3fa0d4a4 100755 --- a/modules.d/90dmsquash-live/dmsquash-live-root +++ b/modules.d/90dmsquash-live/dmsquash-live-root @@ -14,7 +14,19 @@ fi [ -z "$1" ] && exit 1 livedev="$1" -# FIXME: do cd check here +# FIXME: we need to be able to hide the plymouth splash for the check really +[ -e $livedev ] & fs=$(blkid -s TYPE -o value $livedev) +if [ "$fs" == "iso9660" -o "$fs" = "udf" ]; then + check="yes" +fi +getarg check || check="" +if [ -n "$check" ]; then + checkisomd5 --verbose $livedev || : + if [ $? -ne 0 ]; then + echo "CD check failed!" + exit 1 + fi +fi getarg ro && liverw=ro getarg rw && liverw=rw @@ -32,7 +44,6 @@ overlay=off live_dir="LiveOS" live_ram=0 reset_overlay=0 -check=0 # overlay setup helper function do_live_overlay() { diff --git a/modules.d/90dmsquash-live/install b/modules.d/90dmsquash-live/install index ff60518e5..e8c78c042 100755 --- a/modules.d/90dmsquash-live/install +++ b/modules.d/90dmsquash-live/install @@ -5,6 +5,7 @@ inst dd inst losetup inst eject inst blockdev +which checkisomd5 >/dev/null 2>&1 && inst checkisomd5 inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh" inst_hook pre-udev 30 "$moddir/dmsquash-live-genrules.sh" inst "$moddir/dmsquash-live-root" "/sbin/dmsquash-live-root"