render / rpms / qemu

Forked from rpms/qemu 9 months ago
Clone

Blame qemu-fix-extboot-signrom.patch

Mark McLoughlin dc170b
From ee595f99ba7ff80b46a736a06f7e53998d926563 Mon Sep 17 00:00:00 2001
Mark McLoughlin f4d6ad
From: Alexander Graf <agraf@suse.de>
Mark McLoughlin f4d6ad
Date: Sat, 1 Aug 2009 11:48:31 +0200
Mark McLoughlin f4d6ad
Subject: [PATCH] Fix checksum writing in signboot.sh
Mark McLoughlin f4d6ad
Mark McLoughlin f4d6ad
The printf command takes an octal value after \, so we have to convert
Mark McLoughlin f4d6ad
our decimal representation to octal first and then write it.
Mark McLoughlin f4d6ad
Mark McLoughlin f4d6ad
This unbreaks extboot signing. Multiboot wasn't affected yet because
Mark McLoughlin f4d6ad
the checksum was < 8.
Mark McLoughlin f4d6ad
Mark McLoughlin f4d6ad
Spotted and first patch by Glauber Costa <glommer@redhat.com>.
Mark McLoughlin f4d6ad
Printf idea by Paolo Bonzini <bonzini@gnu.org>.
Mark McLoughlin f4d6ad
Mark McLoughlin f4d6ad
(cherry picked from commit d8b69b34761f7b3fb8f476712b631d1dd3f1b2a5)
Mark McLoughlin f4d6ad
Mark McLoughlin f4d6ad
Signed-off-by: Alexander Graf <agraf@suse.de>
Mark McLoughlin f4d6ad
CC: Glauber Costa <glommer@redhat.com>
Mark McLoughlin f4d6ad
CC: Paolo Bonzini <bonzini@gnu.org>
Mark McLoughlin f4d6ad
CC: Jan Ondrej <ondrejj@salstar.sk>
Mark McLoughlin f4d6ad
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Mark McLoughlin f4d6ad
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Mark McLoughlin f4d6ad
Fedora-patch: qemu-fix-extboot-signrom.patch
Mark McLoughlin f4d6ad
---
Mark McLoughlin f4d6ad
 pc-bios/optionrom/signrom.sh |    3 ++-
Mark McLoughlin f4d6ad
 1 files changed, 2 insertions(+), 1 deletions(-)
Mark McLoughlin f4d6ad
Mark McLoughlin f4d6ad
diff --git a/pc-bios/optionrom/signrom.sh b/pc-bios/optionrom/signrom.sh
Mark McLoughlin f4d6ad
index 4322811..975b27d 100755
Mark McLoughlin f4d6ad
--- a/pc-bios/optionrom/signrom.sh
Mark McLoughlin f4d6ad
+++ b/pc-bios/optionrom/signrom.sh
Mark McLoughlin f4d6ad
@@ -39,7 +39,8 @@ done
Mark McLoughlin f4d6ad
 
Mark McLoughlin f4d6ad
 sum=$(( $sum % 256 ))
Mark McLoughlin f4d6ad
 sum=$(( 256 - $sum ))
Mark McLoughlin f4d6ad
+sum_octal=$( printf "%o" $sum )
Mark McLoughlin f4d6ad
 
Mark McLoughlin f4d6ad
 # and write the output file
Mark McLoughlin f4d6ad
 cp "$1" "$2"
Mark McLoughlin f4d6ad
-printf "\\$sum" | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/dev/null
Mark McLoughlin f4d6ad
+printf "\\$sum_octal" | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/dev/null
Mark McLoughlin f4d6ad
-- 
Mark McLoughlin f4d6ad
1.6.2.5
Mark McLoughlin f4d6ad