remove bashisms from scripts/extract-ikconfig

unbashify-extract-ikconfig.patch

scripts/extract-ikconfig contains a lot of gratuituous bashisms,
which make it fail if /bin/sh isn't bash. This patch replaces them
with regular Bourne shell constructs.

Signed-off-by: Werner Almesberger <werner@openmoko.org>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com> # as file author
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
Werner Almesberger 2008-11-12 16:39:35 -02:00 committed by Sam Ravnborg
parent d2301249e2
commit efddd79512

View file

@ -8,8 +8,8 @@ test -e $binoffset || cc -o $binoffset ./scripts/binoffset.c || exit 1
IKCFG_ST="0x49 0x4b 0x43 0x46 0x47 0x5f 0x53 0x54" IKCFG_ST="0x49 0x4b 0x43 0x46 0x47 0x5f 0x53 0x54"
IKCFG_ED="0x49 0x4b 0x43 0x46 0x47 0x5f 0x45 0x44" IKCFG_ED="0x49 0x4b 0x43 0x46 0x47 0x5f 0x45 0x44"
function dump_config { dump_config() {
typeset file="$1" file="$1"
start=`$binoffset $file $IKCFG_ST 2>/dev/null` start=`$binoffset $file $IKCFG_ST 2>/dev/null`
[ "$?" != "0" ] && start="-1" [ "$?" != "0" ] && start="-1"
@ -18,8 +18,8 @@ function dump_config {
fi fi
end=`$binoffset $file $IKCFG_ED 2>/dev/null` end=`$binoffset $file $IKCFG_ED 2>/dev/null`
let start="$start + 8" start=`expr $start + 8`
let size="$end - $start" size=`expr $end - $start`
dd if="$file" ibs=1 skip="$start" count="$size" 2>/dev/null | zcat dd if="$file" ibs=1 skip="$start" count="$size" 2>/dev/null | zcat