<font class="Apple-style-span" face="'courier new', 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 "$0 [--timeout <time>] [--totaltimeout <time>] [--format] [--reset-mbr] [--noverify] [--overlay-size-mb <size>] [--home-size-mb <size>] [--unencrypted-home] [--skipcopy] [--efi] <isopath> <usbstick device>"<br>
@@ -694,7 +695,8 @@ if [ "$isotype" = "live" -a -z "$skipcopy" ]; then<br> [ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE $USBMNT/$LIVEOS/$HOMEFILE<br>
if [ -n "$skipcompress" -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>