From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.16744.1681399977396865360 for ; Thu, 13 Apr 2023 08:32:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Qf1fwx1y; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: osteffen@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681399975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YQ6cJDkQvMAurF66kfKf88abvy2mH0NsGhQZ5cu27Nk=; b=Qf1fwx1yYbeowCRV5jKbdqZ5rhR2WTjvyN/yAuM6ZTu8uUm0JbPhizdckNY/0T5n3ObEIR OXgr/nCFEzbBNfi9sEgyUOggxhKj8ivxmc0zdta276VxNRKp5S3npaUIr3/rv17MAHh94R mU61gWmL5+r1gXa2cx9gq3Q1+/hYV5s= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-115-pGmlCExNNqSu_PVts9X8Zw-1; Thu, 13 Apr 2023 11:32:53 -0400 X-MC-Unique: pGmlCExNNqSu_PVts9X8Zw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 01C53280AA38; Thu, 13 Apr 2023 15:32:52 +0000 (UTC) Received: from osteffen-laptop.redhat.com (unknown [10.39.195.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BC4EC16028; Thu, 13 Apr 2023 15:32:50 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Julien Grall , Leif Lindholm , Ray Ni , Sami Mujawar , Zhichao Gao , Oliver Steffen Subject: [PATCH v3 1/2] OvmfPkg: allow setting Firmware Version from build command line Date: Thu, 13 Apr 2023 17:32:08 +0200 Message-Id: <20230413153209.128585-2-osteffen@redhat.com> In-Reply-To: <20230413153209.128585-1-osteffen@redhat.com> References: <20230413153209.128585-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 --- OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc | 9 +++++++++ OvmfPkg/OvmfPkgIa32.dsc | 3 +++ OvmfPkg/OvmfPkgIa32X64.dsc | 3 +++ OvmfPkg/OvmfPkgX64.dsc | 5 ++++- OvmfPkg/OvmfXen.dsc | 3 +++ 5 files changed, 22 insertions(+), 1 deletion(-) 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..76f0d23a2648 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -488,6 +488,9 @@ [PcdsFeatureFlag] !endif [PcdsFixedAtBuild] +!ifdef $(FIRMWARE_VER) + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)" +!endif gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 !if $(SMM_REQUIRE) == FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 065b54450647..e10db29ce6f6 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -494,6 +494,9 @@ [PcdsFeatureFlag] !endif [PcdsFixedAtBuild] +!ifdef $(FIRMWARE_VER) + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)" +!endif gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 !if $(SMM_REQUIRE) == FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 3d405cd4ade0..4afbbe1f0d2f 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,7 +516,8 @@ [PcdsFeatureFlag] gEfiMdeModulePkgTokenSpaceGuid.PcdRequireSelfSignedPk|TRUE !endif -[PcdsFixedAtBuild] + +[PcdsFixedAtBuild.X64] gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 !if $(SMM_REQUIRE) == FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 8bfc16c2d3d6..c6e96a9c14e0 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -364,6 +364,9 @@ [PcdsFeatureFlag] !endif [PcdsFixedAtBuild] +!ifdef $(FIRMWARE_VER) + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)" +!endif gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE -- 2.40.0