[Buildroot] [PATCH 1/4] boot/ovmf-bin: new package

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Jul 19 07:40:39 UTC 2022


This package allows to easily grab and install pre-compiled UEFI
firmware files suitable for testing in Qemu. They are going to be used
by the Grub test cases.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 DEVELOPERS                  |  1 +
 boot/Config.in              |  1 +
 boot/ovmf-bin/Config.in     | 15 +++++++++++++
 boot/ovmf-bin/ovmf-bin.hash |  3 +++
 boot/ovmf-bin/ovmf-bin.mk   | 45 +++++++++++++++++++++++++++++++++++++
 5 files changed, 65 insertions(+)
 create mode 100644 boot/ovmf-bin/Config.in
 create mode 100644 boot/ovmf-bin/ovmf-bin.hash
 create mode 100644 boot/ovmf-bin/ovmf-bin.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 5c3c24ff7a..34effa6005 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2796,6 +2796,7 @@ F:	boot/beaglev-secondboot/
 F:	boot/boot-wrapper-aarch64/
 F:	boot/grub2/
 F:	boot/gummiboot/
+F:	boot/ovmf-bin/
 F:	configs/beaglev_defconfig
 F:	configs/stm32mp157c_dk2_defconfig
 F:	package/android-tools/
diff --git a/boot/Config.in b/boot/Config.in
index 40472ae07d..470bb4361f 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -18,6 +18,7 @@ source "boot/mv-ddr-marvell/Config.in"
 source "boot/mxs-bootlets/Config.in"
 source "boot/optee-os/Config.in"
 source "boot/opensbi/Config.in"
+source "boot/ovmf-bin/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/shim/Config.in"
 source "boot/sun20i-d1-spl/Config.in"
diff --git a/boot/ovmf-bin/Config.in b/boot/ovmf-bin/Config.in
new file mode 100644
index 0000000000..921e7e82fc
--- /dev/null
+++ b/boot/ovmf-bin/Config.in
@@ -0,0 +1,15 @@
+config BR2_TARGET_OVMF_BIN_ARCH_SUPPORTS
+	bool
+	default y if BR2_arm
+	default y if BR2_aarch64
+	default y if BR2_i386
+	default y if BR2_x86_64
+
+config BR2_TARGET_OVMF_BIN
+	bool "ovmf-bin"
+	depends on BR2_TARGET_OVMF_BIN_ARCH_SUPPORTS
+	help
+	  This package downloads and installs pre-compiled versions of
+	  EDK2, called OVMF, that target Qemu.
+
+	  https://retrage.github.io/edk2-nightly/
diff --git a/boot/ovmf-bin/ovmf-bin.hash b/boot/ovmf-bin/ovmf-bin.hash
new file mode 100644
index 0000000000..6b8ddb58f7
--- /dev/null
+++ b/boot/ovmf-bin/ovmf-bin.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  00bed311df18cdfcf344d1334501efc88767e2f1896bd28692896ab5996e0801  ovmf-bin-cb6914fad57eb57164d1cd3f23b7c09797793d5d.tar.gz
+sha256  50ce20c9cfdb0e19ee34fe0a51fc0afe961f743697b068359ab2f862b494df80  License.txt
diff --git a/boot/ovmf-bin/ovmf-bin.mk b/boot/ovmf-bin/ovmf-bin.mk
new file mode 100644
index 0000000000..591190d63b
--- /dev/null
+++ b/boot/ovmf-bin/ovmf-bin.mk
@@ -0,0 +1,45 @@
+################################################################################
+#
+# ovmf-bin
+#
+################################################################################
+
+OVMF_BIN_VERSION = cb6914fad57eb57164d1cd3f23b7c09797793d5d
+OVMF_BIN_SITE = $(call github,retrage,edk2-nightly,$(OVMF_BIN_VERSION))
+OVMF_BIN_EXTRA_DOWNLOADS = https://raw.githubusercontent.com/tianocore/edk2/edk2-stable202205/License.txt
+# The license at
+# https://github.com/retrage/edk2-nightly/blob/master/LICENSE is
+# BSD-3-Clause, but this license is only the one for the build
+# infrastructure used to produce the nightly EDK2 builds. The actual
+# license of the EDK2 binaries is
+# https://github.com/tianocore/edk2/blob/master/License.txt, which is
+# BSD-2-Clause-Patent.
+OVMF_BIN_LICENSE = BSD-2-Clause-Patent
+OVMF_BIN_LICENSE_FILES = License.txt
+
+OVMF_BIN_INSTALL_IMAGES = YES
+OVMF_BIN_INSTALL_TARGET = NO
+
+define OVMF_BIN_INSTALL_LICENSE_FILE
+	cp $(OVMF_BIN_DL_DIR)/License.txt $(@D)
+endef
+
+OVMF_BIN_POST_EXTRACT_HOOKS += OVMF_BIN_INSTALL_LICENSE_FILE
+
+ifeq ($(BR2_arm),y)
+OVMF_BIN_FILES = RELEASEARM_QEMU_EFI.fd RELEASEARM_QEMU_VARS.fd
+else ifeq ($(BR2_aarch64),y)
+OVMF_BIN_FILES = RELEASEAARCH64_QEMU_EFI.fd RELEASEAARCH64_QEMU_VARS.fd
+else ifeq ($(BR2_i386),y)
+OVMF_BIN_FILES = RELEASEIa32_OVMF.fd RELEASEIa32_OVMF_CODE.fd RELEASEIa32_OVMF_VARS.fd
+else ifeq ($(BR2_x86_64),y)
+OVMF_BIN_FILES = RELEASEX64_OVMF.fd RELEASEX64_OVMF_CODE.fd RELEASEX64_OVMF_VARS.fd
+endif
+
+define OVMF_BIN_INSTALL_IMAGES_CMDS
+	$(foreach f,$(OVMF_BIN_FILES),\
+		$(INSTALL) -D -m 0644 $(@D)/bin/$(f) $(BINARIES_DIR)/$(f)
+	)
+endef
+
+$(eval $(generic-package))
-- 
2.36.1




More information about the buildroot mailing list