From patchwork Mon Feb 11 10:36:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 219561 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A6E612C02AE for ; Mon, 11 Feb 2013 21:37:03 +1100 (EST) Received: from localhost ([::1]:42128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4qku-0007Ci-FX for incoming@patchwork.ozlabs.org; Mon, 11 Feb 2013 05:37:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4qkk-0007CI-7A for qemu-devel@nongnu.org; Mon, 11 Feb 2013 05:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4qke-0006Lc-Ao for qemu-devel@nongnu.org; Mon, 11 Feb 2013 05:36:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4qke-0006LH-2S for qemu-devel@nongnu.org; Mon, 11 Feb 2013 05:36:44 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1BAag0q028843 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 11 Feb 2013 05:36:42 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-65.ams2.redhat.com [10.36.116.65]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r1BAafpn006834; Mon, 11 Feb 2013 05:36:41 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id EDE2A40961; Mon, 11 Feb 2013 11:36:40 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2013 11:36:40 +0100 Message-Id: <1360579000-29309-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH] Add Makefile rules to build pxe rom binaries (with/without EFI support) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch adds two new targets to roms/Makefile. "make -C roms ipxerom" will build the ipxe roms and update the binaries in pc-bios/, i.e. it basically documents how the build process of our current pxe roms works. "make -C rpms epxerom" will build rom binaries with EFI support. They are composed from three images: legacy bios, efi ia32 and efi x86. So netbooting via SeaBIOS will continue to work like it does today, and additionally we get network support for EFI. This target needs the EfiRom utility (shipped with edk2) somewhere in the $PATH. Note that adding EFI support makes the pxe rom bar size jump from 64k to 256k, so before actually committing binaries with EFI support to the master branch we have to figure how to handle rom size changes on live migration. But we must do that anyway as seabios bios size is pretty close to 128k and we likely will have to jump to 256k in near future. Signed-off-by: Gerd Hoffmann --- roms/Makefile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/roms/Makefile b/roms/Makefile index 5e645bc..18c7ae2 100644 --- a/roms/Makefile +++ b/roms/Makefile @@ -1,5 +1,30 @@ vgabios_variants := stdvga cirrus vmware qxl +pxerom_variants := e1000 eepro100 ne2k_pci pcnet rtl8139 virtio + +ipxerom-e1000 epxerom-e1000 : VID := 8086 +ipxerom-e1000 epxerom-e1000 : DID := 100e +ipxerom-eepro100 epxerom-eepro100 : VID := 8086 +ipxerom-eepro100 epxerom-eepro100 : DID := 1209 +ipxerom-ne2k_pci epxerom-ne2k_pci : VID := 1050 +ipxerom-ne2k_pci epxerom-ne2k_pci : DID := 0940 +ipxerom-pcnet epxerom-pcnet : VID := 1022 +ipxerom-pcnet epxerom-pcnet : DID := 2000 +ipxerom-rtl8139 epxerom-rtl8139 : VID := 10ec +ipxerom-rtl8139 epxerom-rtl8139 : DID := 8139 +ipxerom-virtio epxerom-virtio : VID := 1af4 +ipxerom-virtio epxerom-virtio : DID := 1000 + +# +# EfiRom utility is shipped with edk2 / tianocore, in BaseTools/ +# +# We need that to combine multiple images (legacy bios, +# efi ia32, efi x64) into a single rom binary. +# +# We try to find it in the path. You can also pass the location on +# the command line, i.e. "make EFIROM=/path/to/EfiRom epxerom" +# +EFIROM ?= $(shell which EfiRom 2>/dev/null) default: @echo "nothing is build by default" @@ -7,6 +32,9 @@ default: @echo " bios -- update bios.bin (seabios)" @echo " seavgabios -- update vgabios binaries (seabios)" @echo " lgplvgabios -- update vgabios binaries (lgpl)" + @echo " ipxerom -- update pxe roms (bios only)" + @echo " epxerom -- update pxe roms (bios+efi, this needs" + @echo " the EfiRom utility from edk2 / tianocore)" bios: config.seabios sh configure-seabios.sh $< @@ -26,3 +54,21 @@ lgplvgabios: $(patsubst %,lgplvgabios-%,$(vgabios_variants)) lgplvgabios-%: make -C vgabios vgabios-$*.bin cp vgabios/VGABIOS-lgpl-latest.$*.bin ../pc-bios/vgabios-$*.bin + +ipxerom: $(patsubst %,ipxerom-%,$(pxerom_variants)) + +ipxerom-%: + make -C ipxe/src bin/$(VID)$(DID).rom + cp ipxe/src/bin/$(VID)$(DID).rom ../pc-bios/pxe-$*.rom + +epxerom: $(patsubst %,epxerom-%,$(pxerom_variants)) + +epxerom-%: + make -C ipxe/src bin/$(VID)$(DID).rom + make -C ipxe/src bin-i386-efi/$(VID)$(DID).efidrv + make -C ipxe/src bin-x86_64-efi/$(VID)$(DID).efidrv + $(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \ + -b ipxe/src/bin/$(VID)$(DID).rom \ + -ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \ + -ec ipxe/src/bin-x86_64-efi/$(VID)$(DID).efidrv \ + -o ../pc-bios/pxe-$*.rom