diff options
author | Christoph Egger <Christoph.Egger@amd.com> | 2009-07-17 15:23:51 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-07-22 10:58:49 -0500 |
commit | 99772ae20895e9c72e15f8bef89c60fadd7eb0da (patch) | |
tree | cc4e68c5a77b02ab46727198e45652c58ce67b12 /pc-bios/optionrom | |
parent | a61d1f6701a4a25428b2d4211c0740cfb7c54e8d (diff) | |
download | hqemu-99772ae20895e9c72e15f8bef89c60fadd7eb0da.zip hqemu-99772ae20895e9c72e15f8bef89c60fadd7eb0da.tar.gz |
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>
Diffstat (limited to 'pc-bios/optionrom')
-rwxr-xr-x | pc-bios/optionrom/signrom.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pc-bios/optionrom/signrom.sh b/pc-bios/optionrom/signrom.sh index 263ba5f..4322811 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 )) |