From: Christoph Egger Date: Fri, 17 Jul 2009 13:23:51 +0000 (+0200) Subject: signrom.sh: portability fix X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=99772ae20895e9c72e15f8bef89c60fadd7eb0da;p=qemu.git signrom.sh: portability fix Attached patch makes signrom.sh working on NetBSD. The output of the 'od' command leads to a syntax error which breaks the build. Signed-off-by: Christoph Egger Signed-off-by: Anthony Liguori --- diff --git a/pc-bios/optionrom/signrom.sh b/pc-bios/optionrom/signrom.sh index 263ba5ffc9..4322811372 100755 --- a/pc-bios/optionrom/signrom.sh +++ b/pc-bios/optionrom/signrom.sh @@ -31,9 +31,10 @@ x=`dd if="$1" bs=1 count=1 skip=2 2>/dev/null | od -t u1 -A n` size=$(( $x * 512 - 1 )) # now get the checksum -for i in `od -A n -t u1 -v "$1"`; do +nums=`od -A n -t u1 -v "$1"` +for i in ${nums}; do # add each byte's value to sum - sum=$(( $sum + $i )) + sum=`expr $sum + $i` done sum=$(( $sum % 256 ))