[oe-commits] Paul Eggleton : mkefidisk.sh: be more explicit with device error

git at git.openembedded.org git at git.openembedded.org
Mon Apr 27 14:37:48 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 92b58e1c789ee412d936285144e8e549c99ff979
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=92b58e1c789ee412d936285144e8e549c99ff979

Author: Paul Eggleton <paul.eggleton at linux.intel.com>
Date:   Tue Apr 21 14:01:56 2015 +0100

mkefidisk.sh: be more explicit with device error

* Specify whether the device can't be found or can't be written to
* Give a hint to use sudo

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 scripts/contrib/mkefidisk.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index d6bc965..55f72b0 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -173,7 +173,11 @@ fi
 
 if [ ! -w "$DEVICE" ]; then
 	usage
-	die "Device $DEVICE does not exist or is not writable"
+	if [ ! -e "${DEVICE}" ] ; then
+		die "Device $DEVICE cannot be found"
+	else
+		die "Device $DEVICE is not writable (need to run under sudo?)"
+	fi
 fi
 
 if [ ! -e "$HDDIMG" ]; then



More information about the Openembedded-commits mailing list