Commit 99772ae20895e9c72e15f8bef89c60fadd7eb0da

Authored by Christoph Egger
Committed by Anthony Liguori
1 parent a61d1f67

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 <Christoph.Egger@amd.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing 1 changed file with 3 additions and 2 deletions
pc-bios/optionrom/signrom.sh
... ... @@ -31,9 +31,10 @@ x=`dd if=&quot;$1&quot; bs=1 count=1 skip=2 2&gt;/dev/null | od -t u1 -A n`
31 31 size=$(( $x * 512 - 1 ))
32 32  
33 33 # now get the checksum
34   -for i in `od -A n -t u1 -v "$1"`; do
  34 +nums=`od -A n -t u1 -v "$1"`
  35 +for i in ${nums}; do
35 36 # add each byte's value to sum
36   - sum=$(( $sum + $i ))
  37 + sum=`expr $sum + $i`
37 38 done
38 39  
39 40 sum=$(( $sum % 256 ))
... ...