]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Support checking the iso
authorJeremy Katz <katzj@redhat.com>
Wed, 22 Jul 2009 20:06:29 +0000 (16:06 -0400)
committerHarald Hoyer <harald@redhat.com>
Tue, 4 Aug 2009 14:25:43 +0000 (16:25 +0200)
Support checking the iso image with checkisomd5 if available

modules.d/90dmsquash-live/dmsquash-live-root
modules.d/90dmsquash-live/install

index fcce65b18db3f231e12063b7c9e0207979d26b3c..b3fa0d4a49672bc3c4c9b820dfb015a777a28f97 100755 (executable)
@@ -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() {
index ff60518e51ba81396818f06b1232eeb40fa72466..e8c78c042eadf2521c15cf66ef2d1ff2c44e37b7 100755 (executable)
@@ -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"