]> code.ossystems Code Review - openembedded-core.git/commitdiff
mkefidisk.sh: be more explicit with device error
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 21 Apr 2015 13:01:56 +0000 (14:01 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Apr 2015 14:16:28 +0000 (15:16 +0100)
* 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@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/mkefidisk.sh

index d6bc965137f507b4d45b4456520642c89416db73..55f72b0f5422c5e2a1e40d6655a372a0fcf38afb 100755 (executable)
@@ -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