From 0c753d910f71e5499bf11c7e4779d7695df7e31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Wed, 13 May 2026 15:36:41 +0200 Subject: [PATCH] payloads/edk2: Set System Table firmware information PCDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set the EFI System Table fields with the PCDs containing firmware information, such as vendor, release date, version and revision. Do it so the information is the same in coreboot, EDK2 and SMBIOS. Upstream-Status: Inappropriate [Dasharo downstream] Signed-off-by: Michał Żygowski --- Makefile.mk | 2 ++ payloads/external/Makefile.mk | 6 +++++- payloads/external/edk2/Makefile | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile.mk b/Makefile.mk index d412185593..8a09be8a9b 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -173,6 +173,7 @@ $(foreach supported_arch,$(ARCH_SUPPORTED), \ # toupper: returns the value in all uppercase # ws_to_under: returns the value with any whitespace changed to underscores # get_fmap_value returns the value of a given FMAP field from fmap_config.h +# get_build_value returns the value of a given FMAP field from build.h _toint=$(shell printf "%d" $1) _tohex=$(shell printf 0x"%x" $1) _int-add2=$(shell expr $(call _toint,$1) + $(call _toint,$2)) @@ -193,6 +194,7 @@ tolower=$(shell echo '$1' | tr '[:upper:]' '[:lower:]') toupper=$(shell echo '$1' | tr '[:lower:]' '[:upper:]') ws_to_under=$(shell echo '$1' | tr ' \t' '_') get_fmap_value=$(shell awk '$$2 == "$1" {print $$3}' $(obj)/fmap_config.h) +get_build_value=$(shell awk '$$2 == "$1" {print $$3}' $(obj)/build.h) ####################################################################### # Helper functions for ramstage postprocess diff --git a/payloads/external/Makefile.mk b/payloads/external/Makefile.mk index fc8c11d412..ad7144c9db 100644 --- a/payloads/external/Makefile.mk +++ b/payloads/external/Makefile.mk @@ -299,7 +299,11 @@ $(obj)/UEFIPAYLOAD.fd: $(DOTCONFIG) $(IPXE_EFI) CONFIG_EDK2_DASHARO_IBECC_OPTION=$(CONFIG_EDK2_DASHARO_IBECC_OPTION) \ CONFIG_EDK2_DASHARO_SPD_PROFILE_OPTION=$(CONFIG_EDK2_DASHARO_SPD_PROFILE_OPTION) \ CONFIG_EDK2_CAPSULE_ON_DISK_SUPPORT=$(CONFIG_EDK2_CAPSULE_ON_DISK_SUPPORT) \ - CONFIG_EDK2_SHOW_CAPSULE_REPORT=$(CONFIG_EDK2_SHOW_CAPSULE_REPORT) + CONFIG_EDK2_SHOW_CAPSULE_REPORT=$(CONFIG_EDK2_SHOW_CAPSULE_REPORT) \ + CONFIG_EDK2_FW_VERSION=L"$(CONFIG_LOCALVERSION)" \ + CONFIG_EDK2_FW_VENDOR=L"$(CONFIG_BIOS_VENDOR)" \ + CONFIG_EDK2_FW_RELEASE_DATE=L"$(call get_build_value,COREBOOT_DMI_DATE)" \ + CONFIG_EDK2_FW_REVISION=$(shell printf 0x"%04x%04x" $(DASHARO_MAJOR_VERSION) $(DASHARO_MINOR_VERSION)) $(obj)/ShimmedUniversalPayload.elf: $(DOTCONFIG) diff --git a/payloads/external/edk2/Makefile b/payloads/external/edk2/Makefile index 3219160ccc..c4d1ba7b3c 100644 --- a/payloads/external/edk2/Makefile +++ b/payloads/external/edk2/Makefile @@ -457,6 +457,11 @@ ifneq ($(CONFIG_EDK2_FUM_AUTO_IPXE_BOOT),y) BUILD_STR += --pcd gDasharoSystemFeaturesTokenSpaceGuid.PcdFumAutoIpxeBoot=FALSE endif +BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString=$(CONFIG_EDK2_FW_VERSION) +BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor=$(CONFIG_EDK2_FW_VENDOR) +BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareReleaseDateString=$(CONFIG_EDK2_FW_RELEASE_DATE) +BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision=$(CONFIG_EDK2_FW_REVISION) + endif # !CONFIG_EDK2_REPO_OFFICIAL #