Hi,

The loop mount of the squashfs from rawhide images fails for me on F10, which makes livecd-iso-to-disk exit without cleaning up (unmounting etc.).

This make iso-to-disk handle the error and also makes it do almost what the user asked by copying the squashfs as-is. Maybe it should clean up and exit instead, telling the user to remove --skipcompress or add --compress after --xo or something like that...

/abo

---
 tools/livecd-iso-to-disk.sh |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index f0c7331..4621d45 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -462,9 +462,17 @@ else
 fi
 livesize=$(du -s -B 1M $check | awk {'print $1;'})
 if [ -n "$skipcompress" ]; then
-    mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT
-    livesize=$(du -s -B 1M $CDMNT/LiveOS/ext3fs.img | awk {'print $1;'})
-    umount $CDMNT
+    if [ -e $CDMNT/LiveOS/squashfs.img ]; then
+       if mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT; then
+           livesize=$(du -s -B 1M $CDMNT/LiveOS/ext3fs.img | awk {'print $1;'})
+           umount $CDMNT
+       else
+           echo "WARNING: --skipcompress or --xo was specified but the 
currently"
+           echo "running kernel can not mount the squashfs from the ISO file
to extract"
+           echo "it. The compressed squashfs will be copied to the USB stick."
+           skipcompress=""
+       fi
+    fi
 fi
 free=$(df  -B1M $USBDEV  |tail -n 1 |awk {'print $4;'})

@@ -505,7 +513,7 @@ if [ -z "$skipcopy" ];then
   [ ! -d $USBMNT/$LIVEOS ] && mkdir $USBMNT/$LIVEOS
   [ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE
$USBMNT/$LIVEOS/$HOMEFILE
   if [ -n "$skipcompress" -a -f $CDMNT/LiveOS/squashfs.img ]; then
-      mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT
+      mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT || exitclean
       cp $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img ||
(umount $CDMNT ; exitclean)
       umount $CDMNT
   elif [ -f $CDMNT/LiveOS/squashfs.img ]; then

--
Fedora-livecd-list mailing list
Fedora-livecd-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-livecd-list

Reply via email to