summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2013-04-25 10:23:51 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-04-29 14:45:06 +0100
commitd853d5b6d011088ca1078283a6c7bfd60f47e7a2 (patch)
tree475cca29fad505ecc575d9c8d2ac9b3b557b7354 /scripts
parentf9a06709d856bebbec723ccee87d4dc862c5674e (diff)
downloadpoky-d853d5b6d011088ca1078283a6c7bfd60f47e7a2.tar.gz
mkefidisk: Attempt to automatically unmount target device
With automounters abounding it makes more sense to attempt to unmount the device rather than abort, just like ddimage does. (From OE-Core rev: f522ff19ba4b80788d66a2c58ee50b86fdfea15f) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/contrib/mkefidisk.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index acadd49774..741c3ab967 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -102,10 +102,14 @@ fi
102# 102#
103grep -q $DEVICE /proc/mounts 103grep -q $DEVICE /proc/mounts
104if [ $? -eq 0 ]; then 104if [ $? -eq 0 ]; then
105 echo "ERROR: $DEVICE partitions mounted:" 105 echo -n "$DEVICE listed in /proc/mounts, attempting to unmount..."
106 grep $DEVICE /proc/mounts | cut -f 1 -d " " 106 umount $DEVICE* 2>/dev/null
107 echo "Unmount the partitions listed and try again." 107 grep -q $DEVICE /proc/mounts
108 exit 1 108 if [ $? -eq 0 ]; then
109 echo "FAILED"
110 exit 1
111 fi
112 echo "OK"
109fi 113fi
110 114
111 115
@@ -153,6 +157,7 @@ echo "Boot partition size: $BOOT_SIZE MB ($BOOTFS)"
153echo "ROOTFS partition size: $ROOTFS_SIZE MB ($ROOTFS)" 157echo "ROOTFS partition size: $ROOTFS_SIZE MB ($ROOTFS)"
154echo "Swap partition size: $SWAP_SIZE MB ($SWAP)" 158echo "Swap partition size: $SWAP_SIZE MB ($SWAP)"
155echo "*****************" 159echo "*****************"
160
156echo "Deleting partition table on $DEVICE ..." 161echo "Deleting partition table on $DEVICE ..."
157dd if=/dev/zero of=$DEVICE bs=512 count=2 162dd if=/dev/zero of=$DEVICE bs=512 count=2
158 163