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>
This commit is contained in:
Christoph Egger 2009-07-17 15:23:51 +02:00 committed by Anthony Liguori
parent a61d1f6701
commit 99772ae208

View File

@ -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 ))