From c56b63d1bd06e3eaf149502d7c46c59a5978fd44 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Wed, 22 Jul 2009 16:06:29 -0400 Subject: [PATCH] Support checking the iso Support checking the iso image with checkisomd5 if available --- modules.d/90dmsquash-live/dmsquash-live-root | 15 +++++++++++++-- modules.d/90dmsquash-live/install | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) 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" -- 2.47.3