From 0d2cc22efc66e919848fe0b6559e5b59b08e0afa Mon Sep 17 00:00:00 2001 From: "Cody A.W. Somerville" Date: Thu, 21 Jul 2011 17:00:54 +0200 Subject: Adding function for more resilient detachment of loopback devices. --- scripts/build/lb_source_usb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'scripts/build/lb_source_usb') diff --git a/scripts/build/lb_source_usb b/scripts/build/lb_source_usb index 166e86ace..9a598e4f4 100755 --- a/scripts/build/lb_source_usb +++ b/scripts/build/lb_source_usb @@ -93,8 +93,7 @@ Echo_warning "!!! The following error/warning messages can be ignored !!!" Losetup $FREELO source.img 0 Chroot chroot "parted -s ${FREELO} mklabel msdos" || true Chroot chroot "parted -s ${FREELO} mkpart primary ${PARTITION_TYPE} 0.0 100%" || true -sleep 1 -${LB_LOSETUP} -d ${FREELO} +Lodetach ${FREELO} Losetup $FREELO source.img 1 @@ -122,15 +121,13 @@ ${LB_ROOT_COMMAND} mount ${FREELO} source.tmp cp -r source/* source.tmp ${LB_ROOT_COMMAND} umount source.tmp rmdir source.tmp -sleep 1 -${LB_LOSETUP} -d ${FREELO} +Lodetach ${FREELO} Echo_warning "!!! The above error/warning messages can be ignored !!!" FREELO="$(${LB_LOSETUP} -f)" Losetup "$FREELO" source.img 0 Chroot chroot "parted -s ${FREELO} set 1 lba off" || true -sleep 1 -${LB_LOSETUP} -d ${FREELO} +Lodetach ${FREELO} if [ -n "${MAKEDEV}" ] then -- cgit v1.2.3