summaryrefslogtreecommitdiff
path: root/emulators/qemu/patches/patch-bb
blob: de893688d3a217008673ae1ee3c15700e2f83a7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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`