edk2: add efi firmware builds
cover edk2: add efi firmware builds
Hi,
This patch series adds a edk2 submodule in roms, also a build script and makefile rules to build ovmf and arm firmware.
The build script creates per-arch subdirs in pc-bios and places the firmware files there. They are not exactly small:
kraxel@nilsson ~/projects/qemu (work/edk2)# du -s -h pc-bios/edk2-*
2,8M pc-bios/edk2-aarch64 2,8M pc-bios/edk2-arm 2,1M pc-bios/edk2-i386 2,1M pc-bios/edk2-x86_64
So, the question is how we wanna go forward with this. Adding the submodule and rules is a no-brainer I think. But what about the binaries, which sum up to roughly 10M? Ship them all? Ship the 64bit archs only, given that efi never really took off on i386 and arm?
Other comments?
cheers,
Gerd
Gerd Hoffmann (3):
edk2: add submodule
edk2: add build script and rules
edk2: use EfiRom utility from edk2 submodule
.gitmodules | 3 +++ roms/Makefile | 50 ++++++++++++++++++++++++++++++-------------- roms/compile-edk2.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ roms/edk2 | 1 + 4 files changed, 97 insertions(+), 16 deletions(-) create mode 100755 roms/compile-edk2.sh create mode 160000 roms/edk2
Signature · 1 line
1.8.3.1
RFC PATCH 1/3 edk2: add submodule
--- .gitmodules | 3 +++ roms/edk2 | 1 + 2 files changed, 4 insertions(+) create mode 160000 roms/edk2
.gitmodules +3 -0
@@ -34,3 +34,6 @@ [submodule "roms/skiboot"] path = roms/skiboot url = git://git.qemu.org/skiboot.git +[submodule "roms/edk2"] + path = roms/edk2 + url = https://github.com/tianocore/edk2
roms/edk2 new file +1 -0
@@ -0,0 +1 @@ +Subproject commit 36e9e3e8ea0ce477504b6d2e21603ea94847efae
Signature · 1 line
1.8.3.1
RFC PATCH 2/3 edk2: add build script and rules
In reply to Gerd Hoffmann--- roms/Makefile | 28 ++++++++++++++++++++++++- roms/compile-edk2.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100755 roms/compile-edk2.sh
roms/Makefile +27 -1
@@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1)))) powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64) powerpc_cross_prefix := $(call find-cross-prefix,powerpc) x86_64_cross_prefix := $(call find-cross-prefix,x86_64) +arm_cross_prefix := $(call find-cross-prefix,arm) +aarch64_cross_prefix := $(call find-cross-prefix,aarch64) # tag our seabios builds SEABIOS_EXTRAVERSION="-prebuilt.qemu-project.org"
@@ -151,7 +153,31 @@ skiboot: $(MAKE) -C skiboot CROSS=$(powerpc64_cross_prefix) cp skiboot/skiboot.lid ../pc-bios/skiboot.lid -clean: + +edk2: edk2-ovmf32 edk2-ovmf64 edk2-arm edk2-aarch64 + +edk2-ovmf32: + sh ./compile-edk2.sh i386 $(x86_64_cross_prefix) + +edk2-ovmf64: + sh ./compile-edk2.sh x86_64 $(x86_64_cross_prefix) + +edk2-arm: + sh ./compile-edk2.sh arm $(arm_cross_prefix) + +edk2-aarch64: + sh ./compile-edk2.sh aarch64 $(aarch64_cross_prefix) + +edk2-clean: + make -C edk2/BaseTools clean + rm -rf edk2/Build + rm -rf edk2/Conf/BuildEnv.sh + rm -rf edk2/Conf/build_rule.txt + rm -rf edk2/Conf/target.txt + rm -rf edk2/Conf/tools_def.txt + + +clean: edk2-clean rm -rf seabios/.config seabios/out seabios/builds $(MAKE) -C vgabios clean rm -f vgabios/VGABIOS-lgpl-latest*
roms/compile-edk2.sh new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
1.8.3.1
RFC PATCH 3/3 edk2: use EfiRom utility from edk2 submodule
In reply to Gerd Hoffmann--- roms/Makefile | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-)
roms/Makefile +7 -15
@@ -43,17 +43,6 @@ aarch64_cross_prefix := $(call find-cross-prefix,aarch64) # tag our seabios builds SEABIOS_EXTRAVERSION="-prebuilt.qemu-project.org" -# -# 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 efirom" -# -EFIROM ?= $(shell which EfiRom 2>/dev/null) - default: @echo "nothing is build by default" @echo "available build targets:"
@@ -62,8 +51,7 @@ default: @echo " lgplvgabios -- update vgabios binaries (lgpl)" @echo " sgabios -- update sgabios binaries" @echo " pxerom -- update nic roms (bios only)" - @echo " efirom -- update nic roms (bios+efi, this needs" - @echo " the EfiRom utility from edk2 / tianocore)" + @echo " efirom -- update nic roms (bios+efi)" @echo " slof -- update slof.bin" @echo " skiboot -- update skiboot.lid" @echo " u-boot.e500 -- update u-boot.e500"
@@ -119,8 +107,9 @@ pxe-rom-%: build-pxe-roms efirom: $(patsubst %,efi-rom-%,$(pxerom_variants)) -efi-rom-%: build-pxe-roms build-efi-roms - $(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \ +efi-rom-%: build-pxe-roms build-efi-roms edk2-tools + edk2/BaseTools/Source/C/bin/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 \
@@ -168,6 +157,9 @@ edk2-arm: edk2-aarch64: sh ./compile-edk2.sh aarch64 $(aarch64_cross_prefix) +edk2-tools: + make -C edk2/BaseTools + edk2-clean: make -C edk2/BaseTools clean rm -rf edk2/Build
Signature · 1 line
1.8.3.1
Quoted 14 lines · Gerd Hoffmann
Hi,
This patch series adds a edk2 submodule in roms, also a build script and makefile rules to build ovmf and arm firmware.
The build script creates per-arch subdirs in pc-bios and places the firmware files there. They are not exactly small:
kraxel@nilsson ~/projects/qemu (work/edk2)# du -s -h pc-bios/edk2-* 2,8M pc-bios/edk2-aarch64 2,8M pc-bios/edk2-arm 2,1M pc-bios/edk2-i386 2,1M pc-bios/edk2-x86_64
Quoted 7 lines
So, the question is how we wanna go forward with this. Adding the submodule and rules is a no-brainer I think. But what about the binaries, which sum up to roughly 10M? Ship them all? Ship the 64bit archs only, given that efi never really took off on i386 and arm?
Other comments?
Should we think about our policy for distributing & shipping ROMS more generally ? Most distros will actively strip out the ROMs that we ship in the QEMU tar.gz releases, and rebuild them from pristine source in order to ensure they're fully complying with licensing requirements wrt "full & corresponding source".
So should we consider actually shipping 2 tar.gz files for QEMU releases. One minimal qemu-x.y.z.tar.gz that only contains pristine QEMU source with no pre-built artifacts, and a second qemu-full-x.y.z.tar.gz that contains the QEMU source, plus an arbitrary number of pre-built blobs.
Alternatively, instead of a qemu-full-x.y.z.tar.gz, we could just have a qemu-roms-x.y.z.tar.gz bundle which only contained the ROMs, which users would use in combination with the other releae.
Vendors would use the minimal release, while users who just want to build their own QEMU with least effort would use the full release tar.gz
If we had some split like this, then I think we would not have to really worry about the fact that the ROMs will get quite large as the size would only impact people wanting to download the full release.
In terms of GIT, we could likewise make the binary ROMS live in a submodule, so we don't bloat the main GIT repo, but I don't think that's so critical
Regards,
Daniel
Signature · 3 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
Hi,
Quoted 5 lines
Should we think about our policy for distributing & shipping ROMS more generally ? Most distros will actively strip out the ROMs that we ship in the QEMU tar.gz releases, and rebuild them from pristine source in order to ensure they're fully complying with licensing requirements wrt "full & corresponding source".
Or they don't even use the bundled rom sources and build from upstream tarball instead.
Quoted 5 lines
So should we consider actually shipping 2 tar.gz files for QEMU releases. One minimal qemu-x.y.z.tar.gz that only contains pristine QEMU source with no pre-built artifacts, and a second qemu-full-x.y.z.tar.gz that contains the QEMU source, plus an arbitrary number of pre-built blobs.
Makes sense.
Quoted 3 lines
In terms of GIT, we could likewise make the binary ROMS live in a submodule, so we don't bloat the main GIT repo, but I don't think that's so critical
Adding some submodule (roms/prebuilt?) would also make the management easier.
Basically the full tarball would be qemu plus submodules, and the minimal tarball would be qemu without submodules. You can simply use "git archive" to create the later, which is a bit problematic today as the tarball will include blobs without sources.
cheers,
Gerd