[oe-commits] [openembedded-core] 06/18: scripts/contrib/ddimage: be explicit whether device doesn't exist or isn't writeable

git at git.openembedded.org git at git.openembedded.org
Tue Jul 2 09:07:18 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 878174f3e703a45198207c87af45ef423a80b7c7
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Tue Jul 2 16:12:46 2019 +1200

    scripts/contrib/ddimage: be explicit whether device doesn't exist or isn't writeable
    
    Make the error messages a little more friendly.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/contrib/ddimage | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/contrib/ddimage b/scripts/contrib/ddimage
index a7dc5f7..7f2ad11 100755
--- a/scripts/contrib/ddimage
+++ b/scripts/contrib/ddimage
@@ -122,6 +122,12 @@ if [ ! -e "$IMAGE" ]; then
 	exit 1
 fi
 
+if [ ! -e "$DEVICE" ]; then
+	echo "ERROR: Device $DEVICE does not exist"
+	usage
+	exit 1
+fi
+
 if [ "$(uname)" = "Darwin" ]; then
 	# readlink doesn't support -f on MacOS, just assume it isn't a symlink
 	ACTUAL_DEVICE=$DEVICE
@@ -139,9 +145,8 @@ if is_inuse $ACTUAL_DEVICE ; then
 	exit 1
 fi
 
-
 if [ ! -w "$DEVICE" ]; then
-	echo "ERROR: Device $DEVICE does not exist or is not writable"
+	echo "ERROR: Device $DEVICE is not writable - possibly use sudo?"
 	usage
 	exit 1
 fi

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list