Support checking the iso image with checkisomd5 if available
[ -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
live_dir="LiveOS"
live_ram=0
reset_overlay=0
-check=0
# overlay setup helper function
do_live_overlay() {
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"