]> git.proxmox.com Git - qemu.git/commitdiff
signrom.sh: portability fix
authorChristoph Egger <Christoph.Egger@amd.com>
Fri, 17 Jul 2009 13:23:51 +0000 (15:23 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 22 Jul 2009 15:58:49 +0000 (10:58 -0500)
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 <Christoph.Egger@amd.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc-bios/optionrom/signrom.sh

index 263ba5ffc93f1ff75979f3cbe56c375c330cb59f..43228113726d425f6c3a07306b286f380f12321b 100755 (executable)
@@ -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 ))