From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTC3n-0008U8-Aa for qemu-devel@nongnu.org; Fri, 08 Jan 2010 05:27:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTC3i-0008Or-S2 for qemu-devel@nongnu.org; Fri, 08 Jan 2010 05:27:14 -0500 Received: from [199.232.76.173] (port=52093 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTC3i-0008Ob-JQ for qemu-devel@nongnu.org; Fri, 08 Jan 2010 05:27:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19539) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NTC3i-0002X0-2G for qemu-devel@nongnu.org; Fri, 08 Jan 2010 05:27:10 -0500 Date: Fri, 8 Jan 2010 05:26:58 -0500 (EST) From: Paolo Bonzini Message-ID: <128398603.432201262946418786.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> In-Reply-To: <668989114.432161262946223474.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Subject: Re: [Qemu-devel] Re: [PATCH] write option roms in pc-bios/ MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_15914_261559316.1262946418785" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: Avi Kivity , qemu-devel@nongnu.org, Juan Quintela ------=_Part_15914_261559316.1262946418785 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit >>>>> This will wreak havoc on the tree since these are built by default and >>>>> they are replacing files in revision control. >>>> ... the next question is why are they (linuxboot.bin and multiboot.bin) >>>> in revision control since they do not require any strange tool to be built. >>> They require an i386 cross compiler, which is not available on all >>> installations. >> >> They are being built always anyway now, since their target >> pc-bios/optionrom/linuxboot.bin does not exist on a checked out tree or >> even a release tree. But no one has complained. > > They are only built on i386 and x86_64 hosts, look at the configure > script. We should continue providing all the ROM binaries, even the x86 > ones. Oops, my bad. :-( The only reason I see against my patch is that the option ROMS do not change that often; maybe I felt that it should be done different only because I screwed up and I'm blaming the code instead of myself. There is also the problem that they are not built on Darwin and Solaris, which is possibly even worse. What about adding to version control a stamp file and using it to avoid useless changes to pc-bios/*.bin? Such as overwriting the .bin files only when the .S file changes. Something like the attached patch. Paolo ------=_Part_15914_261559316.1262946418785 Content-Type: application/mbox; name=qemu-optionrom-v2.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=qemu-optionrom-v2.patch >>From 4c76452f62099f5b003a4e4416523ef6c0b141ed Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 8 Jan 2010 11:04:23 +0100 Subject: [PATCH] update option rom files in pc-bios/ when they change Some care has to be taken to avoid spurious updates. So, the source code's SHA1 checksum is stored in a file and this file is used to drive the automatic update of pc-bios/{linuxboot,multiboot}.bin. Signed-off-by: Paolo Bonzini --- create mode 100644 pc-bios/optionrom/.gitattributes create mode 100644 pc-bios/optionrom/linuxboot.stamp create mode 100644 pc-bios/optionrom/multiboot.stamp diff --git a/.gitignore b/.gitignore index d7d2146..6860122 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,9 @@ patches pc-bios/bios-pq/status pc-bios/vgabios-pq/status pc-bios/optionrom/linuxboot.bin +pc-bios/optionrom/linuxboot.img +pc-bios/optionrom/linuxboot.raw pc-bios/optionrom/multiboot.bin +pc-bios/optionrom/multiboot.img pc-bios/optionrom/multiboot.raw .stgit-* diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 54db882..16a291a 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -13,7 +13,8 @@ CFLAGS += -I$(SRC_PATH) CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector) QEMU_CFLAGS = $(CFLAGS) -build-all: multiboot.bin linuxboot.bin +build-all: multiboot.stamp linuxboot.stamp +.SECONDARY: %.img: %.o $(call quiet-command,$(LD) -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@") @@ -24,5 +25,16 @@ build-all: multiboot.bin linuxboot.bin %.bin: %.raw $(call quiet-command,$(SHELL) $(SRC_PATH)/pc-bios/optionrom/signrom.sh $< $@," Signing $(TARGET_DIR)$@") +%.stamp: %.S %.bin + $(call quiet-command,:," GEN $@") + @sha1=`sha1sum < $< | awk '{print $$1}'`; \ + if test -f "$@" && test "`cat $@`" = "$$sha1"; then \ + echo '$@ is unchanged'; \ + else \ + echo 'Updating $(TARGETDIR)../$*.bin'; \ + cp $*.bin ..; \ + fi; \ + echo $$sha1 > $@ + clean: rm -f *.o *.d *.raw *.img *.bin *~ diff --git a/pc-bios/optionrom/linuxboot.stamp b/pc-bios/optionrom/linuxboot.stamp new file mode 100644 index 0000000..8bfa45d --- /dev/null +++ b/pc-bios/optionrom/linuxboot.stamp @@ -0,0 +1 @@ +2871c1f6faabe518d8187c127d56bb8b8ba1ea3d diff --git a/pc-bios/optionrom/multiboot.stamp b/pc-bios/optionrom/multiboot.stamp new file mode 100644 index 0000000..9c7de51 --- /dev/null +++ b/pc-bios/optionrom/multiboot.stamp @@ -0,0 +1 @@ +04a71e8e3cfc29160b49c9e5eae859c7cebbf5f2 ------=_Part_15914_261559316.1262946418785--