aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2011-11-24 17:24:23 +0100
committerThomas Huth <thuth@linux.vnet.ibm.com>2011-11-24 17:28:28 +0100
commit54539073a963971b9e98dc64299a97b7e98cfd19 (patch)
treef7ecb940bd5e51ee4ed32d3ebbb6adac9aa2777b
parentc20f4bc8aca38a7aa9d7691a7c97bea8921627c7 (diff)
downloadSLOF-54539073a963971b9e98dc64299a97b7e98cfd19.zip
SLOF-54539073a963971b9e98dc64299a97b7e98cfd19.tar.gz
SLOF-54539073a963971b9e98dc64299a97b7e98cfd19.tar.bz2
Improved version printing
When building SLOF from a git repository, use the SHA-id as version information instead of the less useful "private build" string. Also make sure that version information is updated during each build, so that we also print more accurate "build date" information now. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
-rw-r--r--Makefile.gen4
-rw-r--r--board-qemu/llfw/Makefile4
-rw-r--r--board-qemu/llfw/startup.S23
-rw-r--r--board-qemu/llfw/version.S42
4 files changed, 53 insertions, 20 deletions
diff --git a/Makefile.gen b/Makefile.gen
index 00cac13..b223643 100644
--- a/Makefile.gen
+++ b/Makefile.gen
@@ -21,9 +21,13 @@ ifdef DRIVER
RELEASE=$(shell cat ../VERSION)
export DRIVER_NAME=$(shell cat ../VERSION | sed -e "s/-/./g" | awk -F . '{ printf("%s%02d%02d%1s%02s",$$1,$$2,$$3,$$4,$$5); }')
else
+ifneq (,$(wildcard ../.git))
+RELEASE=git-$(shell git rev-parse --short=16 HEAD)
+else
RELEASE="$(USER)@$(HOSTNAME)(private build)"
export DRIVER_NAME=HEAD
endif
+endif
DRVDATE=$(shell date +%Y-%h%d)
diff --git a/board-qemu/llfw/Makefile b/board-qemu/llfw/Makefile
index f124a3b..e40472c 100644
--- a/board-qemu/llfw/Makefile
+++ b/board-qemu/llfw/Makefile
@@ -20,9 +20,11 @@ ASFLAGS = $(BOOT) $(IOCONF) $(RELEASE)$(CPUARCHDEF) -Wa,-mregnames
LDFLAGS1 = -nostdlib -e__start -Tstage2.lds -N -Ttext=0x100
-STG1OBJ = startup.o boot_abort.o romfs.o io_generic.o board_io.o
+STG1OBJ = startup.o version.o boot_abort.o romfs.o io_generic.o board_io.o
STG1OBJ += stage2_head.o stage2.o comlib.o romfs_wrap.o nvramlog.o
+.PHONY: version.S
+
all: stage1.bin Cboot.o
stage1.bin: $(STG1OBJ) $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libc.a
diff --git a/board-qemu/llfw/startup.S b/board-qemu/llfw/startup.S
index 5882164..ae97f98 100644
--- a/board-qemu/llfw/startup.S
+++ b/board-qemu/llfw/startup.S
@@ -14,12 +14,12 @@
* Initial entry point
*/
-#include "termctrl.h"
-#include <product.h>
#include <xvect.h>
#include <cpu.h>
#include <macros.h>
+.global print_version_done
+
/* qemu entry:
*
* __start loaded at 0x100
@@ -113,23 +113,8 @@ _start:
li r3,'F'
bl putc
- /* give live sign *****************************/
- bl 0f
- .ascii TERM_CTRL_RESET
- .ascii TERM_CTRL_CRSOFF
- .ascii " **********************************************************************"
- .ascii "\r\n"
- .ascii TERM_CTRL_BRIGHT
- .ascii PRODUCT_NAME
- .ascii " Starting\r\n"
- .ascii TERM_CTRL_RESET
- .ascii " Build Date = ", __DATE__, " ", __TIME__
- .ascii "\r\n"
- .ascii " FW Version = " , RELEASE
- .ascii "\r\n\0"
- .align 2
-0: mflr r3
- bl io_print
+ bl print_version
+print_version_done:
/* go! */
li r3,__startC@l
diff --git a/board-qemu/llfw/version.S b/board-qemu/llfw/version.S
new file mode 100644
index 0000000..5fd0dac
--- /dev/null
+++ b/board-qemu/llfw/version.S
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * Copyright (c) 2010, 2011 IBM Corporation
+ * All rights reserved.
+ * This program and the accompanying materials
+ * are made available under the terms of the BSD License
+ * which accompanies this distribution, and is available at
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * Contributors:
+ * IBM Corporation - initial implementation
+ *****************************************************************************/
+
+/*
+ * Print version information
+ * This code is in a separate file so that it can be easily compiled during
+ * each new build (for refreshing the build date).
+ */
+
+#include "termctrl.h"
+#include <product.h>
+
+.global print_version
+print_version:
+ bl 0f
+ .ascii TERM_CTRL_RESET
+ .ascii TERM_CTRL_CRSOFF
+ .ascii " **********************************************************************"
+ .ascii "\r\n"
+ .ascii TERM_CTRL_BRIGHT
+ .ascii PRODUCT_NAME
+ .ascii " Starting\r\n"
+ .ascii TERM_CTRL_RESET
+ .ascii " Build Date = ", __DATE__, " ", __TIME__
+ .ascii "\r\n"
+ .ascii " FW Version = " , RELEASE
+ .ascii "\r\n\0"
+ .align 2
+0:
+ mflr r3
+ bl io_print
+
+ b print_version_done