public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: Gerd Hoffmann <kraxel@redhat.com>, Oliver Steffen <osteffen@redhat.com>
Cc: devel@edk2.groups.io, Anthony Perard <anthony.perard@citrix.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Jian J Wang <jian.j.wang@intel.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>,
	Liming Gao <gaoliming@byosoft.com.cn>, Ray Ni <ray.ni@intel.com>,
	Zhichao Gao <zhichao.gao@intel.com>,
	Pawel Polawski <ppolawsk@redhat.com>, "nd@arm.com" <nd@arm.com>
Subject: Re: [PATCH 2/2] ArmVirtPkg: allow setting Firmware Version from build command line
Date: Wed, 12 Oct 2022 12:06:30 +0100	[thread overview]
Message-ID: <5eb550a4-a0de-9dac-d013-f55ca15a5a8f@arm.com> (raw)
In-Reply-To: <20221012103930.imhnaniw2ug2fkey@sirius.home.kraxel.org>

Hi Gerd,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 12/10/2022 11:39 am, Gerd Hoffmann wrote:
> On Wed, Oct 12, 2022 at 07:35:23AM +0000, Oliver Steffen wrote:
>> Initialize
>> gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
>> with with the value of the variable "FIRMWARE_VER"
>> in all flavors of ArmVirtPkg.
>>
>> This behavior is already implemented in ArmVirtXen.dsc.
>> It allows specifying the firmware version string on the
>> build command line with -D FIRMARE_VER=...
> I think we need to decide which approach we want support for
> setting PcdFirmwareVersionString (and write it down in armvirt/ovmf
> readme).
>
> The options we have are:
>
>    (1) -D "FIRMARE_VER=${version}" (needs this patch), or
>    (2) --pcd "PcdFirmwareVersionString=L'${version}\\0'"
>
> Advantage of (1) is that the build command line is a bit simpler.
>
> Disadvantage of (1) is that it overrides PcdFirmwareVersionString
> even in case FIRMARE_VER is not set on the command line.  Which doesn't
> make much of a difference today because the default value defined in
> MdeModulePkg is just the empty string.  In case we set the default
> to something more useful (https://edk2.groups.io/g/devel/message/94985)
> overriding it is not so nice though ...

[SAMI] Thank you for pointing me to the MdeModulePkg patch.

I think we could do the following in ArmVirtPkg:

-----

diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index c39e2506a3ea..49e96c9fb91c 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -289,6 +289,10 @@ [PcdsFeatureFlag.AARCH64]
    gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE

  [PcdsFixedAtBuild.common]
+!ifdef $(FIRMWARE_VER)
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
+!endif
+
    gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000
    gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000
    gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|0

----

With this if -D "FIRMARE_VER=${version}" is not provided, the default 
string definition from MdeModulePkg would be used.

Also, since ArmVirt.dsc.inc is included all the platforms in ArmVirtPkg, 
this change is required only in one place (ArmVirtXen.dsc would need 
updating though).

[/SAMI]

>
> take care,
>    Gerd
>

  reply	other threads:[~2022-10-12 11:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221012073504.511854-1-osteffen@redhat.com>
2022-10-12  7:35 ` [PATCH 1/2] OvmfPkg: allow setting Firmware Version from build command line Oliver Steffen
2022-10-12  7:35 ` [PATCH 2/2] ArmVirtPkg: " Oliver Steffen
2022-10-12 10:01   ` Sami Mujawar
2022-10-12 10:39   ` Gerd Hoffmann
2022-10-12 11:06     ` Sami Mujawar [this message]
2022-10-12 11:18       ` Gerd Hoffmann

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=5eb550a4-a0de-9dac-d013-f55ca15a5a8f@arm.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