summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2016-12-09 10:40:32 +0100
committerNicolas Dechesne <nicolas.dechesne@linaro.org>2016-12-09 11:18:57 +0100
commitcf08a6caccdc8c232745882a4b88b090fff428e7 (patch)
tree117fb2da5c8f286b408d41d94506da7fdcfb9ab8
parent8e96a55f1fe9735dcf780e5c3da1917f2dd02d57 (diff)
lk: add build info in traces
* create BUILD_VERSION using git describe * add DATE and TIME Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> (cherry picked from commit 86d35f50902134e53da520ed6e982556d32619a8)
-rw-r--r--kernel/main.c2
-rw-r--r--makefile2
2 files changed, 4 insertions, 0 deletions
diff --git a/kernel/main.c b/kernel/main.c
index 95a43395..77a23331 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -77,6 +77,8 @@ void kmain(void)
// do any super early target initialization
target_early_init();
+ dprintf(INFO, "BUILD_VERSION=%s\n", BUILD_VERSION);
+ dprintf(INFO, "BUILD_DATE=%s - %s\n", __TIME__, __DATE__);
dprintf(INFO, "welcome to lk\n\n");
bs_set_timestamp(BS_BL_START);
diff --git a/makefile b/makefile
index 1e818a87..531aa127 100644
--- a/makefile
+++ b/makefile
@@ -64,6 +64,8 @@ ifeq ($(TARGET_BUILD_VARIANT),user)
CFLAGS += -DDISABLE_FASTBOOT_CMDS=1
endif
+CFLAGS += -DBUILD_VERSION='"$(shell if git rev-parse --git-dir > /dev/null 2>&1; then git describe --dirty | sed 's/\./_/g'; else echo 'unknown'; fi )"'
+
# setup toolchain prefix
TOOLCHAIN_PREFIX ?= arm-eabi-
CFLAGS += -fstack-protector-all