mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-08 00:20:38 -09:00
For release notes since edk2-stable202511, see:
https://github.com/tianocore/edk2/releases/tag/edk2-stable202602
This commit also updates the edk2-platforms packages with the last
commit merged at the edk2 release date (2026-02-13), which corresponds
to commit [1].
The edk2-non-osi package is not updated because it did not received
any commit since the last edk2 bump.
The commit removes the package patch 0001 which is included in
this new version. It also adds a new patch to fix parallel build
failures with a large number (>16) of processors. See:
https://github.com/tianocore/edk2/pull/12199
This commit has been runtime tested with tests using EDK2 package,
with commands:
support/testing/run-tests \
-d dl -o output_folder \
tests.boot.test_edk2 \
tests.boot.test_grub.TestGrubAArch64EFI \
tests.boot.test_grub.TestGrubRiscV64EFI \
tests.boot.test_grub.TestGrubX8664EFI \
tests.package.test_fwts
It has also been runtime tested (by booting in qemu) with defconfigs
using EDK2 package:
qemu_aarch64_sbsa_defconfig
qemu_loongarch64_virt_efi_defconfig
qemu_riscv64_virt_efi_defconfig
qemu_x86_64_efi_defconfig
[1] 23625e8124
Cc: Dick Olsson <hi@senzilla.io>
Cc: Romain Naour <romain.naour@smile.fr>
Cc: Vincent Stehlé <vincent.stehle@arm.com>
Tested-by: Julien Olivain <ju.o@free.fr>
Tested-by: Vincent Stehlé <vincent.stehle@arm.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
169 lines
5.7 KiB
Makefile
169 lines
5.7 KiB
Makefile
################################################################################
|
|
#
|
|
# edk2
|
|
#
|
|
################################################################################
|
|
|
|
EDK2_VERSION = edk2-stable202602
|
|
EDK2_SITE = https://github.com/tianocore/edk2
|
|
EDK2_SITE_METHOD = git
|
|
EDK2_LICENSE = BSD-2-Clause-Patent
|
|
EDK2_LICENSE_FILES = License.txt
|
|
EDK2_CPE_ID_VENDOR = tianocore
|
|
EDK2_DEPENDENCIES = edk2-platforms host-python3 host-acpica host-util-linux
|
|
EDK2_INSTALL_TARGET = NO
|
|
EDK2_INSTALL_IMAGES = YES
|
|
|
|
ifeq ($(BR2_ENABLE_DEBUG),y)
|
|
EDK2_BUILD_TYPE = DEBUG
|
|
ifeq ($(BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL),y)
|
|
# DEBUG_ON_SERIAL_PORT is only tested to be set, so don't disable it, as
|
|
# it would still be set.
|
|
EDK2_BUILD_OPTS += -DDEBUG_ON_SERIAL_PORT
|
|
endif
|
|
else
|
|
EDK2_BUILD_TYPE = RELEASE
|
|
# DEBUG_ON_SERIAL_PORT is only valid in debug builds, so useless to set
|
|
# it (enabled or disabled) on a release build.
|
|
endif
|
|
|
|
# Build system notes.
|
|
#
|
|
# The EDK2 build system is rather unique, so here are a few useful notes.
|
|
#
|
|
# First, builds rely heavily on Git submodules to fetch various dependencies
|
|
# into specific directory structures. It might be possible to work around this
|
|
# and rely on Buildroot's infrastructure, but using Git submodules greatly
|
|
# simplifies this already complicated build system.
|
|
#
|
|
# Second, the build system is spread across various commands and stages.
|
|
# Therefore, all build variables needs to be exported to be available
|
|
# accordingly. The first stage will build $(@D)/BaseTools which contains
|
|
# various tools and scripts for the host.
|
|
#
|
|
# Third, where applicable, the dependency direction between EDK2 and
|
|
# ARM Trusted Firmware (ATF) will go in different direction for different
|
|
# platforms. Most commonly, ATF will depend on EDK2 via the BL33 payload.
|
|
# But for some platforms (e.g. QEMU SBSA) EDK2 will package the ATF
|
|
# images within its own build system. In such cases, intermediary
|
|
# "EDK2 packages" will be built in $(EDK2_BUILD_PACKAGES) in order for
|
|
# EDK2 to be able to use them in subsequent build stages.
|
|
#
|
|
# For more information about the build setup:
|
|
# https://edk2-docs.gitbook.io/edk-ii-build-specification/4_edk_ii_build_process_overview
|
|
|
|
EDK2_GIT_SUBMODULES = YES
|
|
EDK2_BUILD_PACKAGES = $(@D)/Build/Buildroot
|
|
EDK2_PACKAGES_PATHS = $(@D) $(EDK2_BUILD_PACKAGES) $(STAGING_DIR)/usr/share/edk2-platforms
|
|
|
|
ifeq ($(BR2_TARGET_EDK2_PLATFORM_OVMF_X64),y)
|
|
EDK2_ARCH = X64
|
|
EDK2_DEPENDENCIES += host-nasm
|
|
EDK2_PACKAGE_NAME = OvmfPkg
|
|
EDK2_PLATFORM_NAME = OvmfPkgX64
|
|
EDK2_BUILD_DIR = OvmfX64
|
|
|
|
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU),y)
|
|
EDK2_ARCH = AARCH64
|
|
EDK2_PACKAGE_NAME = ArmVirtPkg
|
|
EDK2_PLATFORM_NAME = ArmVirtQemu
|
|
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)-AArch64
|
|
|
|
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL),y)
|
|
EDK2_ARCH = AARCH64
|
|
EDK2_PACKAGE_NAME = ArmVirtPkg
|
|
EDK2_PLATFORM_NAME = ArmVirtQemuKernel
|
|
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)-AArch64
|
|
|
|
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_SGI575),y)
|
|
EDK2_ARCH = AARCH64
|
|
EDK2_PACKAGE_NAME = Platform/ARM/SgiPkg/Sgi575
|
|
EDK2_PLATFORM_NAME = Sgi575
|
|
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
|
|
|
|
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64),y)
|
|
EDK2_ARCH = AARCH64
|
|
EDK2_PACKAGE_NAME = Platform/ARM/VExpressPkg
|
|
EDK2_PLATFORM_NAME = ArmVExpress-FVP-AArch64
|
|
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
|
|
|
|
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN),y)
|
|
EDK2_ARCH = AARCH64
|
|
EDK2_DEPENDENCIES += host-dtc edk2-non-osi
|
|
EDK2_PACKAGE_NAME = Platform/SolidRun/Armada80x0McBin
|
|
EDK2_PLATFORM_NAME = Armada80x0McBin
|
|
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)-$(EDK2_ARCH)
|
|
EDK2_BUILD_ENV += DTC_PREFIX=$(HOST_DIR)/bin/
|
|
EDK2_BUILD_OPTS += -D INCLUDE_TFTP_COMMAND
|
|
EDK2_PACKAGES_PATHS += $(STAGING_DIR)/usr/share/edk2-non-osi
|
|
|
|
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA),y)
|
|
EDK2_ARCH = AARCH64
|
|
EDK2_DEPENDENCIES += arm-trusted-firmware
|
|
EDK2_PACKAGE_NAME = Platform/Qemu/SbsaQemu
|
|
EDK2_PLATFORM_NAME = SbsaQemu
|
|
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
|
|
EDK2_PRE_BUILD_HOOKS += EDK2_PRE_BUILD_QEMU_SBSA
|
|
|
|
define EDK2_PRE_BUILD_QEMU_SBSA
|
|
mkdir -p $(EDK2_BUILD_PACKAGES)/Platform/Qemu/Sbsa
|
|
ln -srf $(BINARIES_DIR)/{bl1.bin,fip.bin} $(EDK2_BUILD_PACKAGES)/Platform/Qemu/Sbsa/
|
|
endef
|
|
|
|
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_OVMF_RISCV),y)
|
|
EDK2_ARCH = RISCV64
|
|
EDK2_PACKAGE_NAME = OvmfPkg/RiscVVirt
|
|
EDK2_PLATFORM_NAME = RiscVVirtQemu
|
|
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
|
|
|
|
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_OVMF_LOONGARCH64),y)
|
|
EDK2_ARCH = LOONGARCH64
|
|
EDK2_PACKAGE_NAME = OvmfPkg/LoongArchVirt
|
|
EDK2_PLATFORM_NAME = LoongArchVirtQemu
|
|
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
|
|
|
|
endif
|
|
|
|
EDK2_BASETOOLS_OPTS = \
|
|
EXTRA_LDFLAGS="$(HOST_LDFLAGS)" \
|
|
EXTRA_OPTFLAGS="$(HOST_CPPFLAGS)"
|
|
|
|
EDK2_PACKAGES_PATH = $(subst $(space),:,$(strip $(EDK2_PACKAGES_PATHS)))
|
|
|
|
# EDK2 "build" script internally uses and calls "make", which controls
|
|
# its own flags. It is mainly tested while not being a sub-make. In
|
|
# order to stay in that configuration, we avoid leaking top-level
|
|
# Buildroot make flags into EDK2 build by clearing the MAKEFLAGS
|
|
# environment variable.
|
|
EDK2_BUILD_ENV += \
|
|
MAKEFLAGS= \
|
|
WORKSPACE=$(@D) \
|
|
PACKAGES_PATH=$(EDK2_PACKAGES_PATH) \
|
|
PYTHON_COMMAND=$(HOST_DIR)/bin/python3 \
|
|
IASL_PREFIX=$(HOST_DIR)/bin/ \
|
|
NASM_PREFIX=$(HOST_DIR)/bin/ \
|
|
GCC5_$(EDK2_ARCH)_PREFIX=$(TARGET_CROSS)
|
|
|
|
EDK2_BUILD_OPTS += \
|
|
-t GCC5 \
|
|
-n $(BR2_JLEVEL) \
|
|
-a $(EDK2_ARCH) \
|
|
-b $(EDK2_BUILD_TYPE) \
|
|
-p $(EDK2_PACKAGE_NAME)/$(EDK2_PLATFORM_NAME).dsc \
|
|
$(call qstrip,$(BR2_TARGET_EDK2_EXTRA_BUILD_OPTS))
|
|
|
|
define EDK2_BUILD_CMDS
|
|
mkdir -p $(EDK2_BUILD_PACKAGES)
|
|
export $(EDK2_BUILD_ENV) && \
|
|
unset ARCH && \
|
|
source $(@D)/edksetup.sh && \
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/BaseTools $(EDK2_BASETOOLS_OPTS) && \
|
|
build $(EDK2_BUILD_OPTS) all
|
|
endef
|
|
|
|
define EDK2_INSTALL_IMAGES_CMDS
|
|
cp -f $(@D)/Build/$(EDK2_BUILD_DIR)/$(EDK2_BUILD_TYPE)_GCC5/FV/*.fd $(BINARIES_DIR)
|
|
endef
|
|
|
|
$(eval $(generic-package))
|