[edk2-devel] Printing git commit in build
Laszlo Ersek
lersek at redhat.com
Thu Jun 6 08:25:20 UTC 2019
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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#41987): https://edk2.groups.io/g/devel/message/41987
Mute This Topic: https://groups.io/mt/31948238/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list