mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
ddimage: fix incompatibility with dash
On systems with dash as /bin/sh there were failures while invoking ddimage. Fix to let it work with both bash and dash shells. [YOCTO #4617] (From OE-Core rev: 4c6f7a5d8bd6ada434b91037ecd5db06f3eac814) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
66079795c9
commit
a3bf47abb4
@@ -6,11 +6,11 @@ BLACKLIST_DEVICES="/dev/sda"
|
|||||||
# 1MB blocksize
|
# 1MB blocksize
|
||||||
BLOCKSIZE=1048576
|
BLOCKSIZE=1048576
|
||||||
|
|
||||||
function usage() {
|
usage() {
|
||||||
echo "Usage: $(basename $0) IMAGE DEVICE"
|
echo "Usage: $(basename $0) IMAGE DEVICE"
|
||||||
}
|
}
|
||||||
|
|
||||||
function image_details() {
|
image_details() {
|
||||||
IMG=$1
|
IMG=$1
|
||||||
echo "Image details"
|
echo "Image details"
|
||||||
echo "============="
|
echo "============="
|
||||||
@@ -21,7 +21,7 @@ function image_details() {
|
|||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
function device_details() {
|
device_details() {
|
||||||
DEV=$1
|
DEV=$1
|
||||||
BLOCK_SIZE=512
|
BLOCK_SIZE=512
|
||||||
|
|
||||||
@@ -61,10 +61,12 @@ if [ ! -e "$IMAGE" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "${BLACKLIST_DEVICES/${DEVICE}/ERROR}" != "$BLACKLIST_DEVICES" ]; then
|
for i in ${BLACKLIST_DEVICES}; do
|
||||||
echo "ERROR: Device $DEVICE is blacklisted"
|
if [ "$i" = "$DEVICE" ]; then
|
||||||
exit 1
|
echo "ERROR: Device $DEVICE is blacklisted"
|
||||||
fi
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if [ ! -w "$DEVICE" ]; then
|
if [ ! -w "$DEVICE" ]; then
|
||||||
echo "ERROR: Device $DEVICE does not exist or is not writable"
|
echo "ERROR: Device $DEVICE does not exist or is not writable"
|
||||||
|
|||||||
Reference in New Issue
Block a user