Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXaCT-00035k-58 for qemu-devel@nongnu.org; Sun, 02 Aug 2009 08:30:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXaCO-00034N-Ks for qemu-devel@nongnu.org; Sun, 02 Aug 2009 08:30:04 -0400 Received: from [199.232.76.173] (port=38625 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXaCO-00034K-FS for qemu-devel@nongnu.org; Sun, 02 Aug 2009 08:30:00 -0400 Received: from cantor.suse.de ([195.135.220.2]:37446 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MXaCO-0001q1-07 for qemu-devel@nongnu.org; Sun, 02 Aug 2009 08:30:00 -0400 From: Alexander Graf In-Reply-To: <78B8C636C3BD4BB4B145B8A31D306E3B@FSCPC> Subject: Re: [Qemu-devel] signrom.sh and MinGW References: <75404CF870024F539884B8819ECD6E60@FSCPC> <5b31733c0908011451i69a51791r7fec576fed7c41ad@mail.gmail.com> <78B8C636C3BD4BB4B145B8A31D306E3B@FSCPC> Message-Id: <25CE2FD1-7DE9-453E-B3CF-34C374BE7C18@suse.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Sun, 2 Aug 2009 14:29:56 +0200 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sebastian Herbszt Cc: Filip Navara , qemu-devel@nongnu.org On 02.08.2009, at 14:21, Sebastian Herbszt wrote: > Filip Navara wrote: >> Sebastian Herbszt wrote: >>> v0.11.0-rc0-182-g28e738d/pc-bios/optionrom/signrom.sh multiboot.raw >>> multiboot.bin >>> v0.11.0-rc0-182-g28e738d/pc-bios/optionrom/signrom.sh: * 512 - 1 : >>> syntax >>> error: operand expected (error token is "* 512 - 1 ") >>> make[1]: *** [multiboot.bin] Error 1 >>> rm multiboot.raw multiboot.img multiboot.o >>> make: *** [romsubdir-optionrom] Error 2 >>> >>> pc-bios/optionrom/signrom.sh has >>> >>> # find out the file size >>> x=`dd if="$1" bs=1 count=1 skip=2 2>/dev/null | od -t u1 -A n` >>> #size=`expr $x \* 512 - 1` >>> size=$(( $x * 512 - 1 )) >>> >>> but it seems (at least my) MinGW doesn't include "dd". >>> >> I have already reported that on the mailing list earlier. >> Workaround/fix is to download MSYS coreutils from the MinGW download >> page. > > Thanks for the hint - got it working now. > > On a closer look at the "od" tool, the use of "dd" seems redundant: > > -j, --skip-bytes=BYTES > skip BYTES input bytes first > > -N, --read-bytes=BYTES > limit dump to BYTES input bytes > > "od -N 1 -j 2 -t u1 -A n multiboot.raw" seems to do the same job and > "od" is pre-shipped on > MinGW/MSYS. But maybe "-j" and "-N" are not widely implemented. A > possible alternative could > be the use of "head" and "cut". Right, but we need dd later on anyways and I find dd parameters easier to read than the ones from od, probably because I simply use dd more often :-). > In any case signrom.sh might check for the presence of tools used. Good idea. Please post a patch! Alex