From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRo24-0002IU-Ri for qemu-devel@nongnu.org; Fri, 17 Jul 2009 10:03:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRo20-0002DL-71 for qemu-devel@nongnu.org; Fri, 17 Jul 2009 10:03:28 -0400 Received: from [199.232.76.173] (port=48040 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRo20-0002D8-4J for qemu-devel@nongnu.org; Fri, 17 Jul 2009 10:03:24 -0400 Received: from [217.9.48.20] (port=37312 helo=donner.amd.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MRo1z-0000Bx-Ef for qemu-devel@nongnu.org; Fri, 17 Jul 2009 10:03:23 -0400 Received: from localhost.amd.com (cegger@localhost.amd.com [127.0.0.1]) by donner.amd.com (8.14.3/8.13.6) with ESMTP id n6HDNqfu032081 for ; Fri, 17 Jul 2009 15:23:52 +0200 (CEST) From: Christoph Egger Date: Fri, 17 Jul 2009 15:23:51 +0200 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_otHYKOcYi2vUPii" Message-Id: <200907171523.52123.Christoph.Egger@amd.com> Subject: [Qemu-devel] [PATCH] signrom.sh: portability fix List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --Boundary-00=_otHYKOcYi2vUPii Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! Attached patch makes signrom.sh working on NetBSD. The output of the 'od' command leads to a syntax error which breaks the build. Signed-off-by: Christoph Egger -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --Boundary-00=_otHYKOcYi2vUPii Content-Type: text/x-diff; charset="us-ascii"; name="qemu_signrom.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="qemu_signrom.diff" diff --git a/pc-bios/optionrom/signrom.sh b/pc-bios/optionrom/signrom.sh index 263ba5f..4322811 100755 --- a/pc-bios/optionrom/signrom.sh +++ b/pc-bios/optionrom/signrom.sh @@ -31,9 +31,10 @@ x=`dd if="$1" bs=1 count=1 skip=2 2>/dev/null | od -t u1 -A n` size=$(( $x * 512 - 1 )) # now get the checksum -for i in `od -A n -t u1 -v "$1"`; do +nums=`od -A n -t u1 -v "$1"` +for i in ${nums}; do # add each byte's value to sum - sum=$(( $sum + $i )) + sum=`expr $sum + $i` done sum=$(( $sum % 256 )) --Boundary-00=_otHYKOcYi2vUPii--