From: "Brian C. Lane" bcl@redhat.com
A. This is untested, I'm looking for comments before I go to the trouble of building an iso with it.
B. I don't really like any of these options, but this is the best one I can think of right now.
rd.live.check isn't doing anything for the non-livecd install media. The problem is that dmsquash-live-root needs the device in order for its call to checkisomd5 to work and anaconda-dracut always passes the path to the image. The options I see are:
1. move the checkisomd5 into a dracut-lib function. The problem with this is that adds dependencies (checkisomd5) to every use of dracut.
2. pass the device to anaconda_live_root_dir, pass that as an option to dmsquash-live-root and have it check for an optional device argument to run checkisomd5 on. I like this option the least.
3. copy the checkisomd5 code from dmsquash-live-root to anaconda-lib. This introduces a dep on dracut-lib inside our lib because of the getarg function. I'm not sure if that's a problem or not. If not, this would be my 1st choice.
4. copy it into anaconda-diskroot which is the only place it will be used anyway.
#4 is in the following patch. I like #3 as long as adding dracut-lib to every call of anaconda-lib won't cause problems.
Brian C. Lane (1): run checkisomd5 from anaconda-diskroot (#848764)
dracut/anaconda-diskroot | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
From: "Brian C. Lane" bcl@redhat.com
anaconda-dracut always passes a path to dmsquash-live-root so its checkisomd5 never runs (it needs a block device). --- dracut/anaconda-diskroot | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/dracut/anaconda-diskroot b/dracut/anaconda-diskroot index 612a131..1495cd8 100755 --- a/dracut/anaconda-diskroot +++ b/dracut/anaconda-diskroot @@ -5,6 +5,24 @@ . /lib/anaconda-lib.sh command -v getarg >/dev/null || . /lib/dracut-lib.sh
+# Run checkisomd5 on a device +run_checkisomd5 { + livedev=$1 + [ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev) + if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then + check="yes" + fi + getarg rd.live.check -d check || check="" + if [ -n "$check" ]; 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 +}
dev="$1" path="$2" # optional, could be empty @@ -14,3 +32,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
anaconda-patches@lists.fedorahosted.org