qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] OpenBSD build fixes


From: Laurence Tratt
Subject: [Qemu-devel] OpenBSD build fixes
Date: Mon, 5 Oct 2009 21:16:28 +0100
User-agent: mutt

This mail contains two simple patches - after the .sig - which make most of
qemu build under OpenBSD. The first is a patch to signrom.sh to work around
the fact that OpenBSD's od does not have a -A option; this change should be
compatible with other OS's and not lead to any detectable change in
functionality. The other patch is to configure, which makes INSTALL_DIR call
both -d and -p; -p is invalid with -d under OpenBSD (and, I suspect, some
other Unix's too).

It would be good if we could get these patches into the mainline qemu. From
here, there are a couple of more obviously OpenBSD-only patches that aren't
suitable for the main qemu tree, and will need to be maintained seperately.
But with all of them in place, I have a functioning qemu and, for the first
time under OpenBSD/amd64, a qemu that doesn't crash when it uses the network
- which is a big improvement!

Thanks to Juergen Lock and address@hidden for help in getting qemu
working under OpenBSD.


Laurie
-- 
http://tratt.net/laurie/ -- Personal
http://fetegeo.org/      -- Free text geocoding
http://convergepl.org/   -- The Converge programming language
http://www.model-transformation.org/ICMT2010/ -- ICMT 2010

diff --git a/pc-bios/optionrom/signrom.sh b/pc-bios/optionrom/signrom.sh
index 975b27d..0eb091d 100755
--- a/pc-bios/optionrom/signrom.sh
+++ b/pc-bios/optionrom/signrom.sh
@@ -26,12 +26,16 @@ test "$1" -a "$2" || exit 1
 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`
+tmp=`mktemp`
+dd if="$1" bs=1 count=1 skip=2 2>/dev/null > $tmp
+x=`od -v -t u1 $tmp | head -n 1 | cut -d " " -f 2- | sed "s/ //g" | sed 
"s/^0*//g"`
+rm $tmp
 #size=`expr $x \* 512 - 1`
 size=$(( $x * 512 - 1 ))
 
 # now get the checksum
-nums=`od -A n -t u1 -v "$1"`
+num_lines=`od -v -t u1 "$1" | wc -l`
+nums=`od -v -t u1 "$1" | head -n $(( num_lines - 1 ))  | cut -d " " -f 2-`
 for i in ${nums}; do
     # add each byte's value to sum
     sum=`expr $sum + $i`
diff --git a/configure b/configure
index 69a5502..64a920a 100755
--- a/configure
+++ b/configure
@@ -2042,7 +2042,7 @@ echo "datadir=\${prefix}$datasuffix" >> $config_host_mak
 echo "docdir=\${prefix}$docsuffix" >> $config_host_mak
 echo "MAKE=$make" >> $config_host_mak
 echo "INSTALL=$install" >> $config_host_mak
-echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak
+echo "INSTALL_DIR=$install -d -m0755" >> $config_host_mak
 echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak
 echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak




reply via email to

[Prev in Thread] Current Thread [Next in Thread]