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

Jon Mason <[email protected]>
Newsgroups org.yoctoproject.lists.meta-arm
Message-ID <[email protected]>
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.

Signed-off-by: Jon Mason <[email protected]>
---
 meta-arm/recipes-bsp/uefi/edk2-firmware.inc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc b/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
index 5475b0a1bc5c..6d86a68f6ed5 100644
--- a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
+++ b/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
@@ -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}
 }
 
-- 
2.39.5 (Apple Git-154)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.