Skip to contentSkip to conversation

arm/edk2-firmware: add version to be printed out

PATCH Applied Jon Mason 2 participants 4 messages Apr 11, 2025

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/3 arm/edk2-firmware: add version to be printed out

Currently, the version number is not being specified, which is causing the version to be printed as an empty string. Such as:

    UEFI firmware (version  built at 00:50:36 on Feb 21 2025)

and
Tianocore/EDK2 firmware version

Add the package version as the version to be printed out, which results in:

    UEFI firmware (version 202502 built at 00:50:36 on Feb 21 2025)

and
Tianocore/EDK2 firmware version 202502

An intermediate variable was used instead of PV to allow for the variable to be overridden if necessary.

Also, minor white space clean-up to match the style in the rest of the file.

---
 meta-arm/recipes-bsp/uefi/edk2-firmware.inc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta-arm/recipes-bsp/uefi/edk2-firmware.inc +5 -1
index 5475b0a1bc5c..6d86a68f6ed5 100644
@@ -22,7 +22,7 @@ SRC_URI = "\
     ${SRC_URI_EDK2_PLATFORMS};branch=${SRCBRANCH_edk2_platforms};name=edk2-platforms;destsuffix=edk2/edk2-platforms \
 "
 
-SRCREV_FORMAT         = "edk2_edk2-platforms"
+SRCREV_FORMAT = "edk2_edk2-platforms"
 UPSTREAM_CHECK_GITTAGREGEX = "^edk2-stable(?P<pver>\d+)$"
 
 COMPATIBLE_MACHINE ?= "invalid"
@@ -42,6 +42,9 @@ EDK2_ARCH:x86      = "IA32"
 EDK2_ARCH:x86-64   = "X64"
 EDK2_ARCH:riscv64  = "RISCV64"
 
+# Use the package version as the version to be printed out but allow for it to be overridden
+EDK2_VERSION ?= "${PV}"
+
 # Extra arguments passed to build
 EDK2_EXTRA_BUILD   = ""
 
@@ -115,6 +118,7 @@ do_compile() {
        --tagname ${EDK_COMPILER} \
        --platform ${EDK2_PLATFORM_DSC} \
        ${@oe.utils.parallel_make_argument(d, "-n %d")} \
+       -D FIRMWARE_VER="${EDK2_VERSION}" \
        ${EDK2_EXTRA_BUILD}
 }
 
Signature · 1 line
2.39.5 (Apple Git-154)
author
#1 lore raw

PATCH 2/3 arm/edk2-firmware: update to 202502

Update to the latest tagged version of edk2-firmware. This requires rebasing the sbsa-acs patches. Also, sgi575 works with the latest version but requires a patch to compile cleanly.

There is an issue with qemuarm/qemuarm64 where the boot device is not found in edk2 if 'RELEASE' is set as the build mode. Temporarily changing that to DEBUG while the issue is being worked on (in
https://github.com/tianocore/edk2/issues/10942).

---
 meta-arm-bsp/conf/machine/sgi575.conf         |  3 --
 .../recipes-bsp/uefi/edk2-firmware-sgi575.inc |  3 ++
 ...tform-Sgi-workaround-ArmFfaLib-error.patch | 41 +++++++++++++++++++
 ...411.bb => edk2-basetools-native_202502.bb} |  0
 .../recipes-bsp/uefi/edk2-firmware_%.bbappend | 10 +++++
 .../recipes-bsp/uefi/edk2-firmware_202411.bb  | 11 -----
 .../recipes-bsp/uefi/edk2-firmware_202502.bb  |  9 ++++
 ...-in-the-paths-to-the-SBSA-test-suite.patch | 12 +++---
 ...02-Enforce-using-good-old-BFD-linker.patch | 30 +++++++++-----
 meta-arm/recipes-bsp/uefi/sbsa-acs_7.1.4.bb   |  2 +-
 10 files changed, 89 insertions(+), 32 deletions(-)
 create mode 100644 meta-arm-bsp/recipes-bsp/uefi/files/0001-Platform-Sgi-workaround-ArmFfaLib-error.patch
 rename meta-arm/recipes-bsp/uefi/{edk2-basetools-native_202411.bb => edk2-basetools-native_202502.bb} (100%)
 delete mode 100644 meta-arm/recipes-bsp/uefi/edk2-firmware_202411.bb
 create mode 100644 meta-arm/recipes-bsp/uefi/edk2-firmware_202502.bb
meta-arm-bsp/conf/machine/sgi575.conf +0 -3
index dea764e8cdb6..048e072664b4 100644
@@ -13,9 +13,6 @@ KERNEL_IMAGETYPE ?= "Image"
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
 SERIAL_CONSOLES = "115200;ttyAMA0"
 
-#FIXME - for some reason newer EDK2 refuses to boot the kernel
-PREFERRED_VERSION_edk2-firmware ?= "202408%"
-
 EFI_PROVIDER ?= "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd-boot", "grub-efi", d)}"
 MACHINE_FEATURES += "efi"
 
meta-arm-bsp/recipes-bsp/uefi/edk2-firmware-sgi575.inc +3 -0
index e26225f87a07..042ed59a1ad8 100644
@@ -5,3 +5,6 @@ EDK2_PLATFORM_DSC  = "Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc"
 EDK2_BIN_NAME      = "BL33_AP_UEFI.fd"
 
 COMPATIBLE_MACHINE = "sgi575"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+SRC_URI += " file://0001-Platform-Sgi-workaround-ArmFfaLib-error.patch;patchdir=edk2-platforms"
meta-arm-bsp/recipes-bsp/uefi/files/0001-Platform-Sgi-workaround-ArmFfaLib-error.patch new file +41 -0

41 lines not on this page · raw message

meta-arm/recipes-bsp/uefi/edk2-basetools-native_202502.bb renamed from meta-arm/recipes-bsp/uefi/edk2-basetools-native_202411.bb +0 -0
similarity index 100%
rename from meta-arm/recipes-bsp/uefi/edk2-basetools-native_202411.bb
rename to meta-arm/recipes-bsp/uefi/edk2-basetools-native_202502.bb
meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend +10 -0
index e923d9f034fd..25b52511e4a0 100644
@@ -7,11 +7,21 @@ COMPATIBLE_MACHINE:qemuarm64 = "qemuarm64"
 EDK2_PLATFORM:qemuarm64      = "ArmVirtQemu-AARCH64"
 EDK2_PLATFORM_DSC:qemuarm64  = "ArmVirtPkg/ArmVirtQemu.dsc"
 EDK2_BIN_NAME:qemuarm64      = "QEMU_EFI.fd"
+# No need for PXE booting in qemu, disable to reduce unnecessary noise
+EDK2_EXTRA_BUILD:qemuarm64 += " -D NETWORK_PXE_BOOT_ENABLE=FALSE "
+# FIXME - issue with 'RELEASE' firmware, use 'DEBUG'.  This is being tracked in
+# https://github.com/tianocore/edk2/issues/10942
+EDK2_BUILD_RELEASE:qemuarm64 = "0"
 
 COMPATIBLE_MACHINE:qemuarm = "qemuarm"
 EDK2_PLATFORM:qemuarm      = "ArmVirtQemu-ARM"
 EDK2_PLATFORM_DSC:qemuarm  = "ArmVirtPkg/ArmVirtQemu.dsc"
 EDK2_BIN_NAME:qemuarm      = "QEMU_EFI.fd"
+# No need for PXE booting in qemu, disable to reduce unnecessary noise
+EDK2_EXTRA_BUILD:qemuarm += " -D NETWORK_PXE_BOOT_ENABLE=FALSE "
+# FIXME - issue with 'RELEASE' firmware, use 'DEBUG'.  This is being tracked in
+# https://github.com/tianocore/edk2/issues/10942
+EDK2_BUILD_RELEASE:qemuarm = "0"
 
 do_install:append:qemuarm64() {
     install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/FV/${EDK2_BIN_NAME} ${D}/firmware/
meta-arm/recipes-bsp/uefi/edk2-firmware_202411.bb deleted +0 -11
deleted file mode 100644
index 22e724340ec8..000000000000
@@ -1,11 +0,0 @@
-SRCREV_edk2           ?= "0f3867fa6ef0553e26c42f7d71ff6bdb98429742"
-SRCREV_edk2-platforms ?= "2d66a9e048285af8ba4bfe4bdaab37a8e98288b3"
-
-# FIXME - clang is having issues with antlr
-TOOLCHAIN:aarch64 = "gcc"
-
-require recipes-bsp/uefi/edk2-firmware.inc
-
-SRC_URI += "\
-    file://edk2_fix_epoch.patch \
-"
meta-arm/recipes-bsp/uefi/edk2-firmware_202502.bb new file +9 -0
new file mode 100644
index 000000000000..1ea9f0751414
@@ -0,0 +1,9 @@
+require recipes-bsp/uefi/edk2-firmware.inc
+
+SRCREV_edk2           ?= "fbe0805b2091393406952e84724188f8c1941837"
+SRCREV_edk2-platforms ?= "728c8bb974be69b4034fad7a1c60917cca2dd03d"
+
+# FIXME - clang is having issues with antlr
+TOOLCHAIN:aarch64 = "gcc"
+
+SRC_URI += " file://edk2_fix_epoch.patch"
meta-arm/recipes-bsp/uefi/sbsa-acs/0001-Patch-in-the-paths-to-the-SBSA-test-suite.patch +6 -6
index e9f8c4173677..c9aa014cb759 100644
@@ -1,6 +1,6 @@
-From e7918dbd4a02be2a474534da3f1e565931a5e632 Mon Sep 17 00:00:00 2001
+From 17df0e93949097c18c65567bdf8c7ad2478f63b4 Mon Sep 17 00:00:00 2001
 From: Ross Burton <[email protected]>
-Date: Thu, 16 Feb 2023 21:53:25 +0000
+Date: Thu, 16 Feb 2023 21:53:25 -0500
 Subject: [PATCH] Patch in the paths to the SBSA test suite
 
 Upstream-Status: Inappropriate (required action)
@@ -10,15 +10,15 @@ Signed-off-by: Ross Burton <[email protected]>
  1 file changed, 3 insertions(+)
 
 diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
-index 7e985f8280a7..ca7a716fadc7 100644
+index 7e985f8280a7..052510236cae 100644
 --- a/ShellPkg/ShellPkg.dsc
 +++ b/ShellPkg/ShellPkg.dsc
 @@ -23,6 +23,8 @@
  !include MdePkg/MdeLibs.dsc.inc
  
  [LibraryClasses.common]
-+  SbsaValLib|ShellPkg/Application/sbsa-acs/val/SbsaValLib.inf
-+  SbsaPalLib|ShellPkg/Application/sbsa-acs/platform/pal_uefi/SbsaPalLib.inf
++  SbsaValLib|ShellPkg/Application/sbsa-acs/val/SbsaValLib.inf
++  SbsaPalLib|ShellPkg/Application/sbsa-acs/platform/pal_uefi/SbsaPalLib.inf
    UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
    UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
    UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
@@ -26,7 +26,7 @@ index 7e985f8280a7..ca7a716fadc7 100644
    # Build all the libraries when building this package.
    # This helps developers test changes and how they affect the package.
    #
-+  ShellPkg/Application/sbsa-acs/uefi_app/SbsaAvs.inf
++  ShellPkg/Application/sbsa-acs/uefi_app/SbsaAvs.inf
    ShellPkg/Library/UefiShellLib/UefiShellLib.inf
    ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
    ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
meta-arm/recipes-bsp/uefi/sbsa-acs/0002-Enforce-using-good-old-BFD-linker.patch +19 -11
index 2d8a33f4a9da..f73194d265b8 100644
@@ -1,13 +1,21 @@
-From a91273485735b89e67050bb39a09b60a16055dbd Mon Sep 17 00:00:00 2001
+From 76665f48f5a4672d8c8bed3c57822307193b2b72 Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
-Date: Wed, 7 Apr 2021 00:16:07 -0700
+Date: Wed, 7 Apr 2021 00:16:07 -0400
 Subject: [PATCH] Enforce using good old BFD linker
 
-some distros may use gold as system linker and it crashes while linking the app
+some distros may use gold as system linker and it crashes while linking
+the app
 
-TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld: error: TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/edk2/BaseTools/Scripts/GccBase.lds:54:10: INFO section type is unsupported
-TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld: error: TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/edk2/BaseTools/Scripts/GccBase.lds:66:14: INFO section type is unsupported
-TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld: internal error in do_layout, at ../../gold/object.cc:1939
+TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld:
+error:
+TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/edk2/BaseTools/Scripts/GccBase.lds:54:10:
+INFO section type is unsupported
+TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld:
+error:
+TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/edk2/BaseTools/Scripts/GccBase.lds:66:14:
+INFO section type is unsupported
+TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld:
+internal error in do_layout, at ../../gold/object.cc:1939
 collect2: error: ld returned 1 exit status
 
 Upstream-Status: Pending
@@ -17,15 +25,15 @@ Signed-off-by: Khem Raj <[email protected]>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
-index 14f3b643c43d..ce3d969625de 100755
+index ffeb22742142..ba24113d216c 100755
 --- a/BaseTools/Conf/tools_def.template
 +++ b/BaseTools/Conf/tools_def.template
-@@ -905,7 +905,7 @@ DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-
+@@ -928,7 +928,7 @@ DEFINE GCC_ARM_CC_XIPFLAGS         = -mno-unaligned-access
+ DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char  -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 -mstack-protector-guard=global
  DEFINE GCC_AARCH64_CC_XIPFLAGS     = -mstrict-align -mgeneral-regs-only
  DEFINE GCC_RISCV64_CC_XIPFLAGS     = -mstrict-align -mgeneral-regs-only
- DEFINE GCC_DLINK_FLAGS_COMMON      = -nostdlib --pie
 -DEFINE GCC_DLINK2_FLAGS_COMMON     = -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
 +DEFINE GCC_DLINK2_FLAGS_COMMON     = -fuse-ld=bfd -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
- DEFINE GCC_IA32_X64_DLINK_COMMON   = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
- DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
+ DEFINE GCC_IA32_X64_DLINK_COMMON   = -nostdlib --pie --fatal-warnings -z,noexecstack --gc-sections
+ DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map -Wl,--fatal-warnings -Wl,-z,noexecstack
  DEFINE GCC_LOONGARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
meta-arm/recipes-bsp/uefi/sbsa-acs_7.1.4.bb +1 -1
index bb668bb48717..961a0c4344c8 100644
@@ -1,4 +1,4 @@
-require recipes-bsp/uefi/edk2-firmware_202411.bb
+require recipes-bsp/uefi/edk2-firmware_202502.bb
 PROVIDES:remove = "virtual/bootloader"
 
 LICENSE += "& Apache-2.0"
Signature · 1 line
2.39.5 (Apple Git-154)
author
#2 lore raw

PATCH 3/3 arm/edk2-firmware: remove qemuarm64-secureboot

In reply to Jon Mason

edk2 isn't booting on qemuarm64-secureboot, and hasn't for some time. Also, it's not being tested as part of CI. Remove until it is working again.

---
 meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend | 5 -----
 1 file changed, 5 deletions(-)
meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend +0 -5
index 25b52511e4a0..56e785aeb13d 100644
@@ -1,8 +1,3 @@
-COMPATIBLE_MACHINE:qemuarm64-secureboot = "qemuarm64-secureboot"
-EDK2_PLATFORM:qemuarm64-secureboot      = "ArmVirtQemu-AARCH64"
-EDK2_PLATFORM_DSC:qemuarm64-secureboot  = "ArmVirtPkg/ArmVirtQemu.dsc"
-EDK2_BIN_NAME:qemuarm64-secureboot      = "QEMU_EFI.fd"
-
 COMPATIBLE_MACHINE:qemuarm64 = "qemuarm64"
 EDK2_PLATFORM:qemuarm64      = "ArmVirtQemu-AARCH64"
 EDK2_PLATFORM_DSC:qemuarm64  = "ArmVirtPkg/ArmVirtQemu.dsc"
Signature · 1 line
2.39.5 (Apple Git-154)
Applied
#3 lore raw
In reply to Jon Mason
Quoted 6 lines · Jon Mason

Currently, the version number is not being specified, which is causing the version to be printed as an empty string. Such as:

    UEFI firmware (version  built at 00:50:36 on Feb 21 2025)

and
Tianocore/EDK2 firmware version

Quoted 7 lines

Add the package version as the version to be printed out, which results in:

    UEFI firmware (version 202502 built at 00:50:36 on Feb 21 2025)

and
Tianocore/EDK2 firmware version 202502

[...]

Applied, thanks!

[1/3] arm/edk2-firmware: add version to be printed out

      commit: ce4c7f6661752554c249dc1c62d1a41cc023d771
[2/3] arm/edk2-firmware: update to 202502
      commit: 69121ff4e5b298dca16781f67f44f345e143667c
[3/3] arm/edk2-firmware: remove qemuarm64-secureboot
      commit: ca5c51e25c82ed48bfaa432cac13ae061468c256

Best regards,

Signature · 1 line
Jon Mason <[email protected]>