From f4d6ad7b36addbf65f64882a5379797867d0e54a Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Aug 04 2009 14:36:21 +0000 Subject: - Fix extboot checksum (bug #514899) --- diff --git a/qemu-fix-extboot-signrom.patch b/qemu-fix-extboot-signrom.patch new file mode 100644 index 0000000..1829d9d --- /dev/null +++ b/qemu-fix-extboot-signrom.patch @@ -0,0 +1,44 @@ +From 6fb154d7d16b25d70615d33dc30927ded148dd32 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +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 . +Printf idea by Paolo Bonzini . + +(cherry picked from commit d8b69b34761f7b3fb8f476712b631d1dd3f1b2a5) + +Signed-off-by: Alexander Graf +CC: Glauber Costa +CC: Paolo Bonzini +CC: Jan Ondrej +Signed-off-by: Anthony Liguori +Signed-off-by: Mark McLoughlin +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 + diff --git a/qemu.spec b/qemu.spec index 9b6ad25..b393896 100644 --- a/qemu.spec +++ b/qemu.spec @@ -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 - 2:0.10.91-0.3.rc1.rc0 +- Fix extboot checksum (bug #514899) + * Fri Jul 31 2009 Mark McLoughlin - 2:0.10.91-0.2.rc1.rc0 - Add KSM support - Require bochs-bios >= 2.3.8-0.8 for latest kvm bios updates