- Fix extboot checksum (bug #514899)

This commit is contained in:
Mark McLoughlin 2009-08-04 14:36:21 +00:00
parent fc7c34c17f
commit f4d6ad7b36
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,44 @@
From 6fb154d7d16b25d70615d33dc30927ded148dd32 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Sat, 1 Aug 2009 11:48:31 +0200
Subject: [PATCH] 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>.
(cherry picked from commit d8b69b34761f7b3fb8f476712b631d1dd3f1b2a5)
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>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Fedora-patch: qemu-fix-extboot-signrom.patch
---
pc-bios/optionrom/signrom.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pc-bios/optionrom/signrom.sh b/pc-bios/optionrom/signrom.sh
index 4322811..975b27d 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
--
1.6.2.5

View File

@ -4,7 +4,7 @@
Summary: QEMU is a FAST! processor emulator
Name: qemu
Version: 0.10.91
Release: 0.2.%{kvmvertag}%{?dist}
Release: 0.3.%{kvmvertag}%{?dist}
# Epoch because we pushed a qemu-1.0 package
Epoch: 2
License: GPLv2+ and LGPLv2+ and BSD
@ -29,6 +29,9 @@ Patch03: qemu-fix-optionrom-install.patch
# Add KSM support - see https://fedoraproject.org/wiki/Features/KSM
Patch04: qemu-add-ksm-support.patch
# Fix extboot checksum (bug #514899)
Patch05: qemu-fix-extboot-signrom.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: SDL-devel zlib-devel which texi2html gnutls-devel cyrus-sasl-devel
BuildRequires: rsync dev86 iasl
@ -213,6 +216,7 @@ such as kvmtrace and kvm_stat.
%patch02 -p1
%patch03 -p1
%patch04 -p1
%patch05 -p1
%build
# systems like rhel build system does not have a recent enough linker so
@ -477,6 +481,9 @@ getent passwd qemu >/dev/null || \
%{_mandir}/man1/qemu-img.1*
%changelog
* Tue Aug 4 2009 Mark McLoughlin <markmc@redhat.com> - 2:0.10.91-0.3.rc1.rc0
- Fix extboot checksum (bug #514899)
* Fri Jul 31 2009 Mark McLoughlin <markmc@redhat.com> - 2:0.10.91-0.2.rc1.rc0
- Add KSM support
- Require bochs-bios >= 2.3.8-0.8 for latest kvm bios updates