1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-06-04 02:00:12 +00:00

arm/edk2-basetools-native: build C host tools (GenFfs, GenFv)

The recipe previously only copied the Python BaseTools into the native
sysroot, which was sufficient for capsule signing but not for Firmware
Volume (FV) creation. Downstream recipes that build UEFI capsule
update images for embedded platforms need GenFfs and GenFv to assemble
FV images - a key component of the UEFI Capsule Update format used for
system firmware updates.

Add the brotli submodule source (build-time dependency of both tools),
build the C BaseTools (Common, BrotliCompress, GenFfs, GenFv) and
install the binaries into ${bindir} together with GenerateCapsule.py
and the Common Python library so that capsule-generating recipes can
consume them from the native sysroot.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Igor Opaniuk
2026-03-19 09:23:23 +01:00
committed by Jon Mason
parent 930a65579d
commit 990f2fa7e8
@@ -1,16 +1,25 @@
# Install EDK2 Base Tools in native sysroot. Currently the BaseTools are not # Install EDK2 Base Tools in native sysroot. The Python BaseTools are copied
# built, they are just copied to native sysroot. This is sufficient for # wholesale, and the C host tools (GenFfs, GenFv) are built so that downstream
# generating UEFI capsules as it only depends on some python scripts. Other # recipes can generate UEFI FV images and capsules.
# tools need to be built first before adding to sysroot. #
# SRCREV_brotli must be kept in sync with the brotli submodule commit that
# the pinned edk2 SRCREV declares in its .gitmodules. Update it whenever
# the edk2 SRCREV is bumped.
# edk2-stable202602 (b7a715f7): brotli e230f474
SUMMARY = "EDK2 Base Tools" SUMMARY = "EDK2 Base Tools"
LICENSE = "BSD-2-Clause-Patent" LICENSE = "BSD-2-Clause-Patent"
# EDK2 # EDK2
SRC_URI = "git://github.com/tianocore/edk2.git;branch=master;protocol=https" SRC_URI = " \
git://github.com/tianocore/edk2.git;branch=master;protocol=https \
git://github.com/google/brotli.git;protocol=https;nobranch=1;name=brotli;destsuffix=${BPN}-${PV}/BaseTools/Source/C/BrotliCompress/brotli \
"
LIC_FILES_CHKSUM = "file://License.txt;md5=2b415520383f7964e96700ae12b4570a" LIC_FILES_CHKSUM = "file://License.txt;md5=2b415520383f7964e96700ae12b4570a"
SRCREV = "b7a715f7c03c45c6b4575bf88596bfd79658b8ce" SRCREV = "b7a715f7c03c45c6b4575bf88596bfd79658b8ce"
SRCREV_brotli = "e230f474b87134e8c6c85b630084c612057f253e"
SRCREV_FORMAT = "default_brotli"
UPSTREAM_CHECK_GITTAGREGEX = "^edk2-stable(?P<pver>\d+)$" UPSTREAM_CHECK_GITTAGREGEX = "^edk2-stable(?P<pver>\d+)$"
@@ -18,7 +27,31 @@ inherit native
RDEPENDS:${PN} += "python3-core" RDEPENDS:${PN} += "python3-core"
do_compile() {
BASE_C="${S}/BaseTools/Source/C"
oe_runmake -C "${BASE_C}/Common"
oe_runmake -C "${BASE_C}/BrotliCompress"
oe_runmake -C "${BASE_C}/GenFfs"
oe_runmake -C "${BASE_C}/GenFv"
}
do_install () { do_install () {
mkdir -p ${D}${bindir}/edk2-BaseTools mkdir -p ${D}${bindir}/edk2-BaseTools
cp -r ${S}/BaseTools/* ${D}${bindir}/edk2-BaseTools/ cp -r ${S}/BaseTools/* ${D}${bindir}/edk2-BaseTools/
# Install compiled binaries to bindir so downstream recipes can reference
# them via ${STAGING_BINDIR_NATIVE}/GenFfs and GenFv.
install -d "${D}${bindir}"
install -m 0755 "${S}/BaseTools/Source/C/bin/GenFfs" "${D}${bindir}/"
install -m 0755 "${S}/BaseTools/Source/C/bin/GenFv" "${D}${bindir}/"
# Install GenerateCapsule.py and Common/ Python library under a
# well-known datadir path.
install -d "${D}${datadir}/edk2-basetools"
install -m 0644 \
"${S}/BaseTools/Source/Python/Capsule/GenerateCapsule.py" \
"${D}${datadir}/edk2-basetools/"
cp -r "${S}/BaseTools/Source/Python/Common" \
"${D}${datadir}/edk2-basetools/"
} }