diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2019-07-02 16:12:46 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-03 17:00:57 +0100 |
commit | 12d64d6d1a9b8242ebc03542e9e34ec67304d744 (patch) | |
tree | 97b31c84cb241ba054ca2ef86490a0e86c695dbb /scripts/contrib | |
parent | d3a9f43305f28ef229fc621ff1273c69a435dec5 (diff) | |
download | poky-12d64d6d1a9b8242ebc03542e9e34ec67304d744.tar.gz |
scripts/contrib/ddimage: be explicit whether device doesn't exist or isn't writeable
Make the error messages a little more friendly.
(From OE-Core rev: 36f308b0134c69b439152c2473a274d96b0fee89)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-x | scripts/contrib/ddimage | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/contrib/ddimage b/scripts/contrib/ddimage index a7dc5f7487..7f2ad112a6 100755 --- a/scripts/contrib/ddimage +++ b/scripts/contrib/ddimage | |||
@@ -122,6 +122,12 @@ if [ ! -e "$IMAGE" ]; then | |||
122 | exit 1 | 122 | exit 1 |
123 | fi | 123 | fi |
124 | 124 | ||
125 | if [ ! -e "$DEVICE" ]; then | ||
126 | echo "ERROR: Device $DEVICE does not exist" | ||
127 | usage | ||
128 | exit 1 | ||
129 | fi | ||
130 | |||
125 | if [ "$(uname)" = "Darwin" ]; then | 131 | if [ "$(uname)" = "Darwin" ]; then |
126 | # readlink doesn't support -f on MacOS, just assume it isn't a symlink | 132 | # readlink doesn't support -f on MacOS, just assume it isn't a symlink |
127 | ACTUAL_DEVICE=$DEVICE | 133 | ACTUAL_DEVICE=$DEVICE |
@@ -139,9 +145,8 @@ if is_inuse $ACTUAL_DEVICE ; then | |||
139 | exit 1 | 145 | exit 1 |
140 | fi | 146 | fi |
141 | 147 | ||
142 | |||
143 | if [ ! -w "$DEVICE" ]; then | 148 | if [ ! -w "$DEVICE" ]; then |
144 | echo "ERROR: Device $DEVICE does not exist or is not writable" | 149 | echo "ERROR: Device $DEVICE is not writable - possibly use sudo?" |
145 | usage | 150 | usage |
146 | exit 1 | 151 | exit 1 |
147 | fi | 152 | fi |