[coreboot] [patch]show the version of code we are running

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Apr 23 02:24:03 CEST 2009

On 22.04.2009 23:38, Myles Watson wrote:
> On Wed, Apr 8, 2009 at 9:18 AM, Carl-Daniel Hailfinger
> <c-d.hailfinger.devel.2006 at gmx.net> wrote:
>> On 08.04.2009 17:16, Myles Watson wrote:
>>> On Tue, Apr 7, 2009 at 10:12 PM, Bao, Zheng <Zheng.Bao at amd.com> wrote:
>>>> OK. It is moved to version string.
>>>> Zheng
>>>> Signed-off-by: Zheng Bao <zheng.bao at amd.com>
>>> Jumping to coreboot.
>>> coreboot-2.0.0-r4085M-GRUB2 Wed Apr  8 09:10:50 MDT 2009 booting...
>>> Acked-by: Myles Watson <mylesgw at gmail.com>

Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Committed in revision 4191.

>> Can we please extend this to work for those using git mirroring as well
>> (not me)?
>> I have a matching command line somewhere. Let me dig it up.
> I'm trying to find which revision broke my cold boot and this would
> have been nice to have.  I think it should go in.  You can update it
> for git later.

True. The following line is not as precise as svnversion, but at least
it will give you the last svn revision in the git history.
git log|grep git-svn-id|cut -f 2 -d@|cut -f 1 -d" "|sort -g|tail -1

The following patch hooks up git mirrored svn revisions and adds some
error checking to the svnrevision call.

If a .svn directory exists in the top level directory and the svnversion
utility is available, we use svnversion.
Otherwise, if a .git directory exists in the top level directory and the
git utility is available, we use git log.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Index: LinuxBIOSv2-svngitrevision/src/config/Options.lb
--- LinuxBIOSv2-svngitrevision/src/config/Options.lb	(Revision 4192)
+++ LinuxBIOSv2-svngitrevision/src/config/Options.lb	(Arbeitskopie)
@@ -96,8 +96,11 @@
 	export always
 	comment "Objcopy command"
+# Try to determine svn revision first.
+# If that fails, try last svn revision in git log.
-	default "2.0.0-r$(shell if [ -f `which svnversion` ]; then svnversion $(TOP); fi)"
+	default "2.0.0-r$(shell if [ -d $(TOP)/.svn -a -f `which svnversion` ]; then svnversion $(TOP); else if [ -d $(TOP)/.git -a -f `which git` ]; then git --git-dir=/$(TOP)/.git log|grep git-svn-id|cut -f 2 -d@|cut -f 1 -d' '|sort -g|tail -1; fi; fi)"
 	export always
 	format "\"%s\""
 	comment "coreboot version"


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: linuxbios_svngitrevision.diff
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090423/186b05fc/attachment.ksh>

More information about the coreboot mailing list