Print git tag or commit info


Pankaj Bansal <pankaj.bansal@...>
 

Hello Edk2 members,
 
I want to print the git tag info (if not available then top commit id) when booting UEFI image.
Can you please tell us how to do it?
In build environment that uses make files it’s easy to do, but I don’t know how to do it in edk2 build environment that uses inf files?
 
Regards,
Pankaj Bansal
 
 


Bob Feng
 

Hi Pankaj,

In edk2 build environment, the makefile is generated by build tool, while it also allow user to provide custom makefile for a module.

As you mentioned, git tag info is easy to do in makefile, so I think you may try to use custom makefile for a module.

In INF file, defines section, set CUSTOM_MAKEFILE attribute. For example

CUSTOM_MAKEFILE = MSFT| makefile
CUSTOM_MAKEFILE = GCC | GNUmakefile

And place your makefile and GNUmakefile to the same folder of .inf file.

You can check https://edk2-docs.gitbooks.io/edk-ii-inf-specification/content/v/release/1.27/ for more CUSTOM_MAKEFILE details.

Thanks,
Bob
From: Pankaj Bansal [mailto:pankaj.bansal@...]
Sent: Friday, October 11, 2019 11:26 AM
To: discuss@edk2.groups.io; Feng, Bob C <bob.c.feng@...>; Gao, Liming <liming.gao@...>
Cc: Varun Sethi <V.Sethi@...>
Subject: Print git tag or commit info

Hello Edk2 members,

I want to print the git tag info (if not available then top commit id) when booting UEFI image.
Can you please tell us how to do it?
In build environment that uses make files it's easy to do, but I don't know how to do it in edk2 build environment that uses inf files?

Regards,
Pankaj Bansal