[Fedora-livecd-list] [PATCH] livecd-iso-to-disk - Restore capability to load the running image

Frederick Grose fgrose at gmail.com
Mon Feb 27 04:36:11 UTC 2012


This apparently has  been broken since 15 Feb 2011 with commit
5e8c294abe448bc15839c7781174ea9b7156228b.

Sorry for not noticing sooner.

commit 357799425eefea9599c559c8e001f33bdd52f4cb
Author: Frederick Grose <fgrose at sugarlabs.org>
Date:   Sun Feb 26 20:05:42 2012 -0800

    Restore capability to load the running LiveOS image.

    If the source is /dev/live or /dev/sr0, mount it on a loop device.

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 3ae88a2..3b1add8 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -906,13 +906,15 @@ fi

 # do some basic sanity checks.
 checkMounted $TGTDEV
-
 # FIXME: would be better if we had better mountpoints
 SRCMNT=$(mktemp -d /media/srctmp.XXXXXX)
-if [ -b "$SRC" ]; then
-    mount -o ro "$SRC" $SRCMNT || exitclean
-elif [ -f "$SRC" ]; then
+if [[ -f $SRC || /dev/live == $1 || /dev/sr0 == $1 ]]; then
     mount -o loop,ro "$SRC" $SRCMNT || exitclean
+    imgtype='iso'
+    [[ /dev/live == $1 ]] && imgtype='live'
+elif [[ -b $SRC ]]; then
+    mount -o ro "$SRC" $SRCMNT || exitclean
+    imgtype='blk'
 else
     echo "$SRC is not a file or block device."
     exitclean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/livecd/attachments/20120226/0f04e5a7/attachment.html>


More information about the livecd mailing list