From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MutzM-0008F3-2L for qemu-devel@nongnu.org; Mon, 05 Oct 2009 16:16:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MutzD-0008Ar-TU for qemu-devel@nongnu.org; Mon, 05 Oct 2009 16:16:54 -0400 Received: from [199.232.76.173] (port=40833 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MutzD-0008Ak-RC for qemu-devel@nongnu.org; Mon, 05 Oct 2009 16:16:47 -0400 Received: from purcell.dcs.kcl.ac.uk ([137.73.8.80]:27888 helo=echo.tratt.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MutzD-0002lZ-Ce for qemu-devel@nongnu.org; Mon, 05 Oct 2009 16:16:47 -0400 Date: Mon, 5 Oct 2009 21:16:28 +0100 From: Laurence Tratt Message-ID: <20091005201628.GP25308@overdrive.home.tratt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] OpenBSD build fixes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 blauwirbel@gmail.com 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