From cd0d378142ce7980c3a6d27943ebd9629d977331 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Tue, 18 Mar 2014 16:23:52 +0100 Subject: [PATCH] Provide Genode version information in log Fixes #551 --- VERSION | 1 + base-codezero/src/core/target.inc | 2 ++ base-fiasco/src/core/target.inc | 2 ++ base-foc/src/core/target.inc | 2 ++ base-hw/src/core/target.inc | 3 +++ base-linux/src/core/target.mk | 2 ++ base-nova/src/core/target.inc | 2 ++ base-okl4/src/core/target.inc | 2 ++ base-pistachio/src/core/target.inc | 2 ++ base/src/core/main.cc | 2 ++ base/src/core/version.inc | 16 ++++++++++++++++ 11 files changed, 36 insertions(+) create mode 100644 VERSION create mode 100644 base/src/core/version.inc diff --git a/VERSION b/VERSION new file mode 100644 index 0000000000..4cb74af1ba --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +14.02 diff --git a/base-codezero/src/core/target.inc b/base-codezero/src/core/target.inc index efcdc655f9..bc74b52d1e 100644 --- a/base-codezero/src/core/target.inc +++ b/base-codezero/src/core/target.inc @@ -36,6 +36,8 @@ INC_DIR += $(REP_DIR)/src/core/include \ $(REP_DIR)/include/codezero/dummies \ $(BASE_DIR)/src/base/thread +include $(GEN_CORE_DIR)/version.inc + vpath main.cc $(GEN_CORE_DIR) vpath ram_session_component.cc $(GEN_CORE_DIR) vpath rom_session_component.cc $(GEN_CORE_DIR) diff --git a/base-fiasco/src/core/target.inc b/base-fiasco/src/core/target.inc index 5c52fe575d..e3b4441483 100644 --- a/base-fiasco/src/core/target.inc +++ b/base-fiasco/src/core/target.inc @@ -36,6 +36,8 @@ INC_DIR += $(REP_DIR)/src/core/include \ LIBS += base-common +include $(GEN_CORE_DIR)/version.inc + vpath main.cc $(GEN_CORE_DIR) vpath multiboot_info.cc $(GEN_CORE_DIR) vpath ram_session_component.cc $(GEN_CORE_DIR) diff --git a/base-foc/src/core/target.inc b/base-foc/src/core/target.inc index 3c6e3078dd..ba2114ec4d 100644 --- a/base-foc/src/core/target.inc +++ b/base-foc/src/core/target.inc @@ -42,6 +42,8 @@ INC_DIR += $(REP_DIR)/src/core/include \ $(BASE_DIR)/src/base/thread \ $(REP_DIR)/src/base/console +include $(GEN_CORE_DIR)/version.inc + vpath context_area.cc $(GEN_CORE_DIR) vpath cpu_session_component.cc $(GEN_CORE_DIR) vpath dataspace_component.cc $(GEN_CORE_DIR) diff --git a/base-hw/src/core/target.inc b/base-hw/src/core/target.inc index 366be47f4d..546b1c232c 100644 --- a/base-hw/src/core/target.inc +++ b/base-hw/src/core/target.inc @@ -60,6 +60,9 @@ SRC_CC += console.cc \ pager.cc \ _main.cc +# provide Genode version information +include $(BASE_DIR)/src/core/version.inc + # declare file locations vpath _main.cc $(BASE_DIR)/src/platform vpath cpu_session_component.cc $(BASE_DIR)/src/core diff --git a/base-linux/src/core/target.mk b/base-linux/src/core/target.mk index 2c32c381fd..c1ff268943 100644 --- a/base-linux/src/core/target.mk +++ b/base-linux/src/core/target.mk @@ -45,6 +45,8 @@ LD_SCRIPT_STATIC = $(LD_SCRIPT_DEFAULT) \ $(call select_from_repositories,src/platform/context_area.stdlib.ld) endif +include $(GEN_CORE_DIR)/version.inc + vpath main.cc $(GEN_CORE_DIR) vpath ram_session_component.cc $(GEN_CORE_DIR) vpath cpu_session_component.cc $(GEN_CORE_DIR) diff --git a/base-nova/src/core/target.inc b/base-nova/src/core/target.inc index 9d0a1ceced..dbab69a0a7 100644 --- a/base-nova/src/core/target.inc +++ b/base-nova/src/core/target.inc @@ -40,6 +40,8 @@ INC_DIR = $(REP_DIR)/src/core/include \ $(BASE_DIR)/src/base/thread \ $(GEN_CORE_DIR)/include +include $(GEN_CORE_DIR)/version.inc + vpath main.cc $(GEN_CORE_DIR) vpath ram_session_component.cc $(GEN_CORE_DIR) vpath rom_session_component.cc $(GEN_CORE_DIR) diff --git a/base-okl4/src/core/target.inc b/base-okl4/src/core/target.inc index 1a79e751db..d7fbcf5ed5 100644 --- a/base-okl4/src/core/target.inc +++ b/base-okl4/src/core/target.inc @@ -39,6 +39,8 @@ INC_DIR += $(REP_DIR)/src/core/include \ $(BASE_DIR)/src/platform \ $(REP_DIR)/src/platform +include $(GEN_CORE_DIR)/version.inc + vpath main.cc $(GEN_CORE_DIR) vpath ram_session_component.cc $(GEN_CORE_DIR) vpath rom_session_component.cc $(GEN_CORE_DIR) diff --git a/base-pistachio/src/core/target.inc b/base-pistachio/src/core/target.inc index 5505bcfe3f..e5fa0abd2d 100644 --- a/base-pistachio/src/core/target.inc +++ b/base-pistachio/src/core/target.inc @@ -36,6 +36,8 @@ INC_DIR += $(REP_DIR)/src/core/include \ $(BASE_DIR)/src/base/thread \ $(GEN_CORE_DIR)/include +include $(GEN_CORE_DIR)/version.inc + vpath main.cc $(GEN_CORE_DIR) vpath ram_session_component.cc $(GEN_CORE_DIR) vpath rom_session_component.cc $(GEN_CORE_DIR) diff --git a/base/src/core/main.cc b/base/src/core/main.cc index d2f6fe9c09..f032ec4043 100644 --- a/base/src/core/main.cc +++ b/base/src/core/main.cc @@ -181,6 +181,8 @@ int main() */ inhibit_tracing = true; + PINF("Genode " GENODE_VERSION); + PDBG("--- create local services ---"); static Trace::Source_registry trace_sources; diff --git a/base/src/core/version.inc b/base/src/core/version.inc new file mode 100644 index 0000000000..e75f693325 --- /dev/null +++ b/base/src/core/version.inc @@ -0,0 +1,16 @@ +# +# Provide version information to main.cc +# +GENODE_ROOT_DIR = $(BASE_DIR)/.. +GENODE_VERSION := $(shell \ + which git > /dev/null \ + && git -C $(GENODE_ROOT_DIR) describe --dirty=" " 2> /dev/null \ + && exit 0 \ + || \ + test -r $(GENODE_ROOT_DIR)/VERSION \ + && cat $(GENODE_ROOT_DIR)/VERSION \ + && exit 0 \ + || \ + echo "") + +CC_OPT_main += -DGENODE_VERSION="\"$(GENODE_VERSION)\""