<font class="Apple-style-span" face="&#39;courier new&#39;, monospace">From <a href="https://bugzilla.redhat.com/show_bug.cgi?id=663849" style="color: rgb(0, 102, 204); text-decoration: none; ">Bug 663849</a> -<span id="summary_alias_container"> <span id="short_desc_nonedit_display">copyFile failures not trapped in livecd-iso-to-disk</span></span><br>

<br>   Trap copyFile errors<br>    <br>    Set -o pipefail is needed with the new strace-based copy function.<br>    And keep || clauses inprocess, so that an exit command applies to the<br>    main script and not just a subshell.<br>

<br>diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh<br>index 51abc0c..464b5e4 100755<br>--- a/tools/livecd-iso-to-disk.sh<br>+++ b/tools/livecd-iso-to-disk.sh<br>@@ -21,6 +21,7 @@<br> <br> <br> export PATH=/sbin:/usr/sbin:$PATH<br>

+set -o pipefail<br> <br> usage() {<br>     echo &quot;$0 [--timeout &lt;time&gt;] [--totaltimeout &lt;time&gt;] [--format] [--reset-mbr] [--noverify] [--overlay-size-mb &lt;size&gt;] [--home-size-mb &lt;size&gt;] [--unencrypted-home] [--skipcopy] [--efi] &lt;isopath&gt; &lt;usbstick device&gt;&quot;<br>

@@ -694,7 +695,8 @@ if [ &quot;$isotype&quot; = &quot;live&quot; -a -z &quot;$skipcopy&quot; ]; then<br>     [ -n &quot;$keephome&quot; -a -f &quot;$USBMNT/$HOMEFILE&quot; ] &amp;&amp; mv $USBMNT/$HOMEFILE $USBMNT/$LIVEOS/$HOMEFILE<br>

     if [ -n &quot;$skipcompress&quot; -a -f $CDMNT/LiveOS/squashfs.img ]; then<br>         mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT || exitclean<br>-        copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || (umount $CDMNT ; exitclean)<br>

+        copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || {<br>+            umount $CDMNT ; exitclean ; }<br>         umount $CDMNT<br>     elif [ -f $CDMNT/LiveOS/squashfs.img ]; then<br>         copyFile $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img || exitclean</font>