aboutsummaryrefslogtreecommitdiff
path: root/pc-bios
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2009-08-01 11:48:31 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-10 13:05:30 -0500
commitc66b57fc144345e7f4b5f2bfc6a389d57d927647 (patch)
tree9879efa937041f6ab886d808d3f2e9837cb9fac6 /pc-bios
parent9aebd98aabfe972a7b172794c5350b7d404b7eba (diff)
Fix checksum writing in signboot.sh
The printf command takes an octal value after \, so we have to convert our decimal representation to octal first and then write it. This unbreaks extboot signing. Multiboot wasn't affected yet because the checksum was < 8. Spotted and first patch by Glauber Costa <glommer@redhat.com>. Printf idea by Paolo Bonzini <bonzini@gnu.org>. Signed-off-by: Alexander Graf <agraf@suse.de> CC: Glauber Costa <glommer@redhat.com> CC: Paolo Bonzini <bonzini@gnu.org> CC: Jan Ondrej <ondrejj@salstar.sk> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
Diffstat (limited to 'pc-bios')
-rwxr-xr-xpc-bios/optionrom/signrom.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/pc-bios/optionrom/signrom.sh b/pc-bios/optionrom/signrom.sh
index 4322811372..975b27dd60 100755
--- a/pc-bios/optionrom/signrom.sh
+++ b/pc-bios/optionrom/signrom.sh
@@ -39,7 +39,8 @@ done
sum=$(( $sum % 256 ))
sum=$(( 256 - $sum ))
+sum_octal=$( printf "%o" $sum )
# and write the output file
cp "$1" "$2"
-printf "\\$sum" | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/dev/null
+printf "\\$sum_octal" | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/dev/null