From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Thu, 06 Jun 2019 01:25:33 -0700 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8563F6147C; Thu, 6 Jun 2019 08:25:24 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-196.ams2.redhat.com [10.36.116.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACBB367E63; Thu, 6 Jun 2019 08:25:21 +0000 (UTC) Subject: Re: [edk2-devel] Printing git commit in build To: devel@edk2.groups.io, udit.kumar@nxp.com References: From: "Laszlo Ersek" Message-ID: <1cb32f45-fedb-cec2-2d6a-8d5f90efc475@redhat.com> Date: Thu, 6 Jun 2019 10:25:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 06 Jun 2019 08:25:29 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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*| and when you build your platform DSC, you could pass the following option to the "build" utility: --pcd=gMyPlatformPkgTokenSpaceGuid.PcdBuildIdentifier="$(git describe)" Thanks Laszlo