diff options
author | Darren Hart <dvhart@linux.intel.com> | 2013-04-25 10:23:51 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-04-29 14:45:06 +0100 |
commit | d853d5b6d011088ca1078283a6c7bfd60f47e7a2 (patch) | |
tree | 475cca29fad505ecc575d9c8d2ac9b3b557b7354 /scripts | |
parent | f9a06709d856bebbec723ccee87d4dc862c5674e (diff) | |
download | poky-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-x | scripts/contrib/mkefidisk.sh | 13 |
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 | # |
103 | grep -q $DEVICE /proc/mounts | 103 | grep -q $DEVICE /proc/mounts |
104 | if [ $? -eq 0 ]; then | 104 | if [ $? -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" | ||
109 | fi | 113 | fi |
110 | 114 | ||
111 | 115 | ||
@@ -153,6 +157,7 @@ echo "Boot partition size: $BOOT_SIZE MB ($BOOTFS)" | |||
153 | echo "ROOTFS partition size: $ROOTFS_SIZE MB ($ROOTFS)" | 157 | echo "ROOTFS partition size: $ROOTFS_SIZE MB ($ROOTFS)" |
154 | echo "Swap partition size: $SWAP_SIZE MB ($SWAP)" | 158 | echo "Swap partition size: $SWAP_SIZE MB ($SWAP)" |
155 | echo "*****************" | 159 | echo "*****************" |
160 | |||
156 | echo "Deleting partition table on $DEVICE ..." | 161 | echo "Deleting partition table on $DEVICE ..." |
157 | dd if=/dev/zero of=$DEVICE bs=512 count=2 | 162 | dd if=/dev/zero of=$DEVICE bs=512 count=2 |
158 | 163 | ||