From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: Jan Ondrej <ondrejj@salstar.sk>,
Glauber Costa <glommer@redhat.com>,
Paolo Bonzini <bonzini@gnu.org>,
avi@redhat.com
Subject: [Qemu-devel] [PATCH] Fix checksum writing in signboot.sh
Date: Sat, 1 Aug 2009 11:48:31 +0200 [thread overview]
Message-ID: <1249120111-31757-1-git-send-email-agraf@suse.de> (raw)
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>
---
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.0.2
next reply other threads:[~2009-08-01 9:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-01 9:48 Alexander Graf [this message]
2009-08-02 10:04 ` [Qemu-devel] Re: [PATCH] Fix checksum writing in signboot.sh Avi Kivity
2009-08-02 10:25 ` Filip Navara
2009-08-02 11:15 ` Avi Kivity
2009-08-02 11:58 ` Alexander Graf
2009-08-02 12:21 ` Avi Kivity
2009-08-02 21:29 ` [Qemu-devel] " Sebastian Herbszt
2009-08-03 2:30 ` [Qemu-devel] " Anthony Liguori
2009-08-03 6:12 ` Paolo Bonzini
2009-08-03 12:55 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1249120111-31757-1-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=avi@redhat.com \
--cc=bonzini@gnu.org \
--cc=glommer@redhat.com \
--cc=ondrejj@salstar.sk \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).