mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
d3a9f43305
commit
12d64d6d1a
@@ -122,6 +122,12 @@ if [ ! -e "$IMAGE" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "$DEVICE" ]; then
|
||||||
|
echo "ERROR: Device $DEVICE does not exist"
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$(uname)" = "Darwin" ]; then
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
# readlink doesn't support -f on MacOS, just assume it isn't a symlink
|
# readlink doesn't support -f on MacOS, just assume it isn't a symlink
|
||||||
ACTUAL_DEVICE=$DEVICE
|
ACTUAL_DEVICE=$DEVICE
|
||||||
@@ -139,9 +145,8 @@ if is_inuse $ACTUAL_DEVICE ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ ! -w "$DEVICE" ]; then
|
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
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user