public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Oliver Steffen" <osteffen@redhat.com>
To: devel@edk2.groups.io
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Julien Grall <julien@xen.org>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Ray Ni <ray.ni@intel.com>, Sami Mujawar <sami.mujawar@arm.com>,
	Zhichao Gao <zhichao.gao@intel.com>,
	Oliver Steffen <osteffen@redhat.com>
Subject: [PATCH v4 1/2] OvmfPkg: allow setting Firmware Version from build command line
Date: Fri, 14 Apr 2023 10:33:22 +0200	[thread overview]
Message-ID: <20230414083323.153731-2-osteffen@redhat.com> (raw)
In-Reply-To: <20230414083323.153731-1-osteffen@redhat.com>

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>
---
 OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc | 9 +++++++++
 OvmfPkg/OvmfPkgIa32.dsc             | 2 ++
 OvmfPkg/OvmfPkgIa32X64.dsc          | 2 ++
 OvmfPkg/OvmfPkgX64.dsc              | 3 +++
 OvmfPkg/OvmfXen.dsc                 | 2 ++
 5 files changed, 18 insertions(+)
 create mode 100644 OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc

diff --git a/OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc b/OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
new file mode 100644
index 000000000000..f0bc73ede3df
--- /dev/null
+++ b/OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
@@ -0,0 +1,9 @@
+##
+#  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 86177bb94899..0ee97c35b05c 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -78,6 +78,8 @@ [Defines]
 !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 065b54450647..19c197a4075c 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -77,6 +77,8 @@ [Defines]
 !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 3d405cd4ade0..0d8fb54a88d1 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -84,6 +84,8 @@ [Defines]
   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
@@ -514,6 +516,7 @@ [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdRequireSelfSignedPk|TRUE
 !endif
 
+
 [PcdsFixedAtBuild]
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1
 !if $(SMM_REQUIRE) == FALSE
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 8bfc16c2d3d6..1f44ec86c9c7 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -62,6 +62,8 @@ [Defines]
 !endif
 !endif
 
+!include OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
+
 [BuildOptions]
   GCC:RELEASE_*_*_CC_FLAGS             = -DMDEPKG_NDEBUG
   INTEL:RELEASE_*_*_CC_FLAGS           = /D MDEPKG_NDEBUG
-- 
2.40.0


  reply	other threads:[~2023-04-14  8:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14  8:33 [PATCH v4 0/2] Set Firmware Version from build command line Oliver Steffen
2023-04-14  8:33 ` Oliver Steffen [this message]
2023-04-14  8:33 ` [PATCH v4 2/2] ArmVirtPkg: allow setting " Oliver Steffen
2023-04-14 12:13 ` [edk2-devel] [PATCH v4 0/2] Set " Rebecca Cran
2023-04-17 10:17   ` Gerd Hoffmann
2023-04-17 14:23     ` Rebecca Cran
2023-05-04 10:13 ` Gerd Hoffmann
2023-05-04 10:55   ` [edk2-devel] " Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230414083323.153731-2-osteffen@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox