public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, udit.kumar@nxp.com
Subject: Re: [edk2-devel] Printing git commit in build
Date: Thu, 6 Jun 2019 10:25:20 +0200	[thread overview]
Message-ID: <1cb32f45-fedb-cec2-2d6a-8d5f90efc475@redhat.com> (raw)
In-Reply-To: <VI1PR04MB46400306112CBA97739B4CD091170@VI1PR04MB4640.eurprd04.prod.outlook.com>

On 06/06/19 07:38, Udit Kumar wrote:
> Dear Community, 
> 
> I like to print git commit id, which printing UEFI firmware build information. 
> Could you help, how I can collect ' git describe' information in C file. 

I think you should be able to do this in the PREBUILD hook in the DSC file. (Run "git describe" in a script for generating a simple C source file.)


Another option would be to introduce a PCD in your platform package DEC file, with datum type (VOID*) and access method FixedAtBuild. For example:

[PcdsFixedAtBuild]
  gMyPlatformPkgTokenSpaceGuid.PcdBuildIdentifier|""|VOID*|<token>

and when you build your platform DSC, you could pass the following option to the "build" utility:

  --pcd=gMyPlatformPkgTokenSpaceGuid.PcdBuildIdentifier="$(git describe)"

Thanks
Laszlo 

  reply	other threads:[~2019-06-06  8:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06  5:38 Printing git commit in build udit.kumar
2019-06-06  8:25 ` Laszlo Ersek [this message]
2019-06-13  6:40   ` [EXT] Re: [edk2-devel] " Udit Kumar

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=1cb32f45-fedb-cec2-2d6a-8d5f90efc475@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