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.4410.1681461219927769460 for ; Fri, 14 Apr 2023 01:33:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K2KqruPJ; 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=1681461219; 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=izvKZ5fAIzIt0VJZsTHsYNnCSHRI6k2PaMWQQ09qJBo=; b=K2KqruPJK9wJy1/Tq99wXyqY19H16/wk3ug1EEjt5GWOGVD0wtVr61Yd+uEhQ9kvIVeKM3 ic+6Yys7YX/L69Ri+nDyv0Sfo5BnBzQJEwL4VHBA7mq9hmWcJW0KFy4AbHLgIzRXB6TrdV KYtJe+6sg8OjmPQ8RcQ+oRvLFr/yKMo= 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-197-e6JJ-g1nOW-3qlm22Bb8uA-1; Fri, 14 Apr 2023 04:33:33 -0400 X-MC-Unique: e6JJ-g1nOW-3qlm22Bb8uA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 675E33815F76; Fri, 14 Apr 2023 08:33:32 +0000 (UTC) Received: from osteffen-laptop.redhat.com (unknown [10.39.193.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6EDC492C13; Fri, 14 Apr 2023 08:33:30 +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 v4 1/2] OvmfPkg: allow setting Firmware Version from build command line Date: Fri, 14 Apr 2023 10:33:22 +0200 Message-Id: <20230414083323.153731-2-osteffen@redhat.com> In-Reply-To: <20230414083323.153731-1-osteffen@redhat.com> References: <20230414083323.153731-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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 | 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