optionrom: fix bugs in signrom.sh
authorAvi Kivity <avi@redhat.com>
Tue, 16 Nov 2010 14:33:17 +0000 (16:33 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Sun, 21 Nov 2010 15:16:57 +0000 (09:16 -0600)
commitf9b39c92ea7eb804de7b82bff6a5f67bbd5d8c4b
tree83a5c677c69dd0da3ee94732b5ee4920743aaf7d
parent337007af877c8fe3a0a5564139f19e1d570a9153
optionrom: fix bugs in signrom.sh

signrom.sh has multiple bugs:

- the last byte is considered when calculating the existing checksum, but not
  when computing the correction
- apprently the 'expr' expression overflows and produces incorrect results with
  larger roms
- if the checksum happened to be zero, we calculated the correction byte to be
  256

Instead of rewriting this in half a line of python, this patch fixes the bugs.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc-bios/optionrom/signrom.sh