Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1]ddimage: fix incompatibility with dash
@ 2013-06-06  6:53 Hongxu Jia
  2013-06-06  6:53 ` [PATCH 1/1] ddimage: " Hongxu Jia
  0 siblings, 1 reply; 2+ messages in thread
From: Hongxu Jia @ 2013-06-06  6:53 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit a62aed41f2d8f874f7ae24d0e5be5dbc66ea2199:

  lrzsz: check locale.h in configure (2013-06-04 15:55:46 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib hongxu/fix-ddiamge
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-ddiamge

Hongxu Jia (1):
  ddimage: fix incompatibility with dash

 scripts/contrib/ddimage |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

-- 
1.7.10.4



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] ddimage: fix incompatibility with dash
  2013-06-06  6:53 [PATCH 0/1]ddimage: fix incompatibility with dash Hongxu Jia
@ 2013-06-06  6:53 ` Hongxu Jia
  0 siblings, 0 replies; 2+ messages in thread
From: Hongxu Jia @ 2013-06-06  6:53 UTC (permalink / raw)
  To: openembedded-core

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]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 scripts/contrib/ddimage |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/scripts/contrib/ddimage b/scripts/contrib/ddimage
index 956699c..ab1d4c7 100755
--- a/scripts/contrib/ddimage
+++ b/scripts/contrib/ddimage
@@ -6,11 +6,11 @@ BLACKLIST_DEVICES="/dev/sda"
 # 1MB blocksize
 BLOCKSIZE=1048576
 
-function usage() {
+usage() {
 	echo "Usage: $(basename $0) IMAGE DEVICE"
 }
 
-function image_details() {
+image_details() {
 	IMG=$1
 	echo "Image details"
 	echo "============="
@@ -21,7 +21,7 @@ function image_details() {
 	echo ""
 }
 
-function device_details() {
+device_details() {
 	DEV=$1
 	BLOCK_SIZE=512
 
@@ -61,10 +61,12 @@ if [ ! -e "$IMAGE" ]; then
 fi
 
 
-if [ "${BLACKLIST_DEVICES/${DEVICE}/ERROR}" != "$BLACKLIST_DEVICES" ]; then
-	echo "ERROR: Device $DEVICE is blacklisted"
-	exit 1
-fi
+for i in ${BLACKLIST_DEVICES}; do
+	if [ "$i" = "$DEVICE" ]; then
+		echo "ERROR: Device $DEVICE is blacklisted"
+		exit 1
+	fi
+done
 
 if [ ! -w "$DEVICE" ]; then
 	echo "ERROR: Device $DEVICE does not exist or is not writable"
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-06  6:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-06  6:53 [PATCH 0/1]ddimage: fix incompatibility with dash Hongxu Jia
2013-06-06  6:53 ` [PATCH 1/1] ddimage: " Hongxu Jia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox