[OpenBIOS] [PATCH] Add revision number to banner

Programmingkid programmingkidx at gmail.com
Sat Nov 28 21:26:14 CET 2015


The banner is displayed at the start of openbios with the version and build time. This patch adds the revision number for easier identification of binary version. It would look like this: 

Welcome to OpenBIOS v1.1 (Revision 1358) built on Nov 28 2015 18:22

If the user doesn't have the svn command or an svn repo, the word "unknown" is used instead of the number.

signed-off-by: John Arbuckle <programmingkidx at gmail.com>

Index: Makefile.target
===================================================================
--- Makefile.target	(revision 1358)
+++ Makefile.target	(working copy)
@@ -52,11 +52,18 @@
 
 versions: $(ODIR)/target/include/openbios-version.h $(ODIR)/forth/version.fs
 
+# Set the REVISION variable to the current svn revision or to "unknown"
+REVISION := $(shell svn info .. | grep "Revision: " | cut -c11-16)
+ifeq ($(REVISION),)
+REVISION = "unknown"
+endif
+
 $(ODIR)/forth/version.fs:
 	$(call quiet-command,true, "  GEN   $(TARGET_DIR)$@")
 	@DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ;  \
 		( echo ": builddate \" $$DATE\" ; " ;     \
-		  echo ": version \" $(VERSION)\" ; " ; ) \
+		  echo ": version \" $(VERSION)\" ; " ; \
+		  echo ": revision \" $(REVISION)\" ; " ; ) \
 		  > $(dir $@)/version.fs
 
 $(ODIR)/target/include/openbios-version.h:
@@ -63,7 +70,8 @@
 	$(call quiet-command,true, "  GEN   $(TARGET_DIR)$@")
 	@DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \
           ( echo "#define OPENBIOS_BUILD_DATE \"$$DATE\"" ; \
-           echo "#define OPENBIOS_VERSION_STR \"$(VERSION)\"" ; ) \
+           echo "#define OPENBIOS_VERSION_STR \"$(VERSION)\"" ; \
+           echo "#define OPENBIOS_REVISION \"$(REVISION)\"" ; ) \
          > $(dir $@)/openbios-version.h
 
 info:
Index: forth/admin/banner.fs
===================================================================
--- forth/admin/banner.fs	(revision 1358)
+++ forth/admin/banner.fs	(working copy)
@@ -9,8 +9,8 @@
 ; to builtin-logo
 
 :noname
-	builddate s"  built on " version s" Welcome to OpenBIOS v" pocket
-	tmpstrcat tmpstrcat tmpstrcat drop
+	builddate s" ) built on " revision s"  (Revision " version s" Welcome to OpenBIOS v" pocket
+	tmpstrcat tmpstrcat tmpstrcat tmpstrcat tmpstrcat drop
 ; to builtin-banner
 
 : suppress-banner ( -- )




More information about the OpenBIOS mailing list