summaryrefslogtreecommitdiff
path: root/emulators/qemu/patches/patch-bb
diff options
context:
space:
mode:
authorshattered <shattered@pkgsrc.org>2011-04-03 09:56:39 +0000
committershattered <shattered@pkgsrc.org>2011-04-03 09:56:39 +0000
commitc783bbe08b7fad4dc39dcd42d66bf80724236b2a (patch)
tree033cabb698809866409fac8c7571963cefb2d7b1 /emulators/qemu/patches/patch-bb
parentb734faf6f944fd5222978bbaa8b730f0e5f7a2fa (diff)
downloadpkgsrc-c783bbe08b7fad4dc39dcd42d66bf80724236b2a.tar.gz
PR/44325 PR/42899 -- fix build on netbsd-4
Diffstat (limited to 'emulators/qemu/patches/patch-bb')
-rw-r--r--emulators/qemu/patches/patch-bb19
1 files changed, 19 insertions, 0 deletions
diff --git a/emulators/qemu/patches/patch-bb b/emulators/qemu/patches/patch-bb
new file mode 100644
index 00000000000..de893688d3a
--- /dev/null
+++ b/emulators/qemu/patches/patch-bb
@@ -0,0 +1,19 @@
+$NetBSD: patch-bb,v 1.1 2011/04/03 09:56:39 shattered Exp $
+
+--- pc-bios/optionrom/signrom.sh.orig 2010-02-23 20:54:38.000000000 +0000
++++ pc-bios/optionrom/signrom.sh 2010-04-09 06:18:25.000000000 +0000
+@@ -26,12 +26,12 @@
+ sum=0
+
+ # find out the file size
+-x=`dd if="$1" bs=1 count=1 skip=2 2>/dev/null | od -t u1 -A n`
++x=`dd if="$1" bs=1 count=1 skip=2 2>/dev/null | od -t u1 | sed -e 's/^[0-9]* *//' -e 's/^00*\([0-9]\)/\1/'`
+ #size=`expr $x \* 512 - 1`
+ size=$(( $x * 512 - 1 ))
+
+ # now get the checksum
+-nums=`od -A n -t u1 -v "$1"`
++nums=`od -t u1 -v "$1" | sed -e 's/^[0-9]* *//' -e 's/^00*\([0-9]\)/\1/' -e 's/ 00*\([0-9]\)/ \1/g'`
+ for i in ${nums}; do
+ # add each byte's value to sum
+ sum=`expr $sum + $i`