summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Steffen <osteffen@redhat.com>2023-04-14 10:33:22 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-05-04 14:26:58 +0000
commit8d59bbf47ea09bbf599bcc1da5e9923a456c0a52 (patch)
tree008b4e4a6014416e580359bdd0ac8b2284c3141d
parent5de2a54b2cfdb9cb3a1a564c85e99aa6b06b5dba (diff)
downloadedk2-8d59bbf47ea09bbf599bcc1da5e9923a456c0a52.tar.gz
edk2-8d59bbf47ea09bbf599bcc1da5e9923a456c0a52.tar.bz2
edk2-8d59bbf47ea09bbf599bcc1da5e9923a456c0a52.zip
OvmfPkg: allow setting Firmware Version from build command line
Initialize gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString with with the value of the variable "FIRMWARE_VER", if is is defined. Applies to all flavors of OvmfPkg. This behavior is already implemented in ArmVirtXen.dsc. It allows specifying the firmware version string on the build command line with -D FIRMARE_VER=... Introduce a common include file to be used in the .dsc files for the different OVMF flavors, and add the changes there. (ArmVirtPkg already has such a file). Signed-off-by: Oliver Steffen <osteffen@redhat.com>
-rw-r--r--OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc8
-rw-r--r--OvmfPkg/OvmfPkgIa32.dsc2
-rw-r--r--OvmfPkg/OvmfPkgIa32X64.dsc2
-rw-r--r--OvmfPkg/OvmfPkgX64.dsc2
-rw-r--r--OvmfPkg/OvmfXen.dsc2
5 files changed, 16 insertions, 0 deletions
diff --git a/OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc b/OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
new file mode 100644
index 0000000000..585545e106
--- /dev/null
+++ b/OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
@@ -0,0 +1,8 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[PcdsFixedAtBuild.common]
+!ifdef $(FIRMWARE_VER)
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
+!endif
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 86177bb948..0ee97c35b0 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -78,6 +78,8 @@
!endif
!endif
+!include OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
+
[BuildOptions]
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 065b544506..19c197a407 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -77,6 +77,8 @@
!endif
!endif
+!include OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
+
[BuildOptions]
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 3d405cd4ad..c5ab0df784 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -84,6 +84,8 @@
DEFINE UP_CPU_PEI_GUID = 280251c4-1d09-4035-9062-839acb5f18c1
DEFINE UP_CPU_DXE_GUID = 6490f1c5-ebcc-4665-8892-0075b9bb49b7
+!include OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
+
[BuildOptions]
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 8bfc16c2d3..1f44ec86c9 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -62,6 +62,8 @@
!endif
!endif
+!include OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
+
[BuildOptions]
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG