[PATCH] run checkisomd5 from anaconda-diskroot (#848764)
Brian C. Lane
bcl at redhat.com
Sat Oct 27 00:34:12 UTC 2012
From: "Brian C. Lane" <bcl at redhat.com>
anaconda-dracut always passes a path to dmsquash-live-root so its
checkisomd5 never runs (it needs a block device).
NOTE: Tested on real CDs, a good one and a bad one.
---
dracut/anaconda-diskroot | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/dracut/anaconda-diskroot b/dracut/anaconda-diskroot
index 612a131..051081b 100755
--- a/dracut/anaconda-diskroot
+++ b/dracut/anaconda-diskroot
@@ -3,8 +3,24 @@
# usage: anaconda-diskroot DEVICE [PATH]
. /lib/anaconda-lib.sh
-command -v getarg >/dev/null || . /lib/dracut-lib.sh
+command -v getargbool >/dev/null || . /lib/dracut-lib.sh
+# Run checkisomd5 on a device
+run_checkisomd5() {
+ livedev=$1
+ if getargbool 0 rd.live.check -d check; then
+ [ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
+ if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
+ [ -x /bin/plymouth ] && /bin/plymouth --hide-splash
+ checkisomd5 --verbose $livedev
+ if [ $? -ne 0 ]; then
+ die "CD check failed!"
+ exit 1
+ fi
+ [ -x /bin/plymouth ] && /bin/plymouth --show-splash
+ fi
+ fi
+}
dev="$1"
path="$2" # optional, could be empty
@@ -14,3 +30,4 @@ path="$2" # optional, could be empty
info "anaconda using disk root at $dev"
mount $dev $repodir || warn "Couldn't mount $dev"
anaconda_live_root_dir $repodir $path
+run_checkisomd5 $dev
--
1.7.11.7
More information about the anaconda-patches
mailing list