Put version info into /etc/os-release
We will use these data for showing meaningful and (mostly) accurate
version information via NETCONF, eventually.
I a;sp want the version info to be visible in actual binaries as well,
so let's instruct Buildroot to keep .git around. That is not as simple
as, e.g.:
CLA_SYSREPO_OVERRIDE_SRCDIR_RSYNC_EXCLUSIONS = --include .git
...because in the CI setup, these directories are already git submodules
of something, and therefore their .git uses a relative path, and one
cannot easily copy it around. Instead, query the actual original path
and put the result into a new .gitdir file. That should work on both the
CI system and a random developer's setup which might not be using
submodules for projects they are working on.
Change-Id: I4760d0ecaa23a1ea5cf591a6cf76bc76d5139b9b
diff --git a/dev-setup-git.sh b/dev-setup-git.sh
index 9cfb294..9f44a09 100755
--- a/dev-setup-git.sh
+++ b/dev-setup-git.sh
@@ -22,6 +22,14 @@
NETCONF_CLI_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/netconf-cli
GAMMARUS_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/gammarus
PYBIND11_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/pybind11
+
+define CZECHLIGHT_GIT_FIX_GITDIR
+ echo "gitdir: \$\$(git rev-parse --resolve-git-dir \$(SRCDIR)/.git)" > \$(@D)/.git
+endef
+CLA_SYSREPO_POST_RSYNC_HOOKS += CZECHLIGHT_GIT_FIX_GITDIR
+NETCONF_CLI_POST_RSYNC_HOOKS += CZECHLIGHT_GIT_FIX_GITDIR
+GAMMARUS_POST_RSYNC_HOOKS += CZECHLIGHT_GIT_FIX_GITDIR
+
EOF
# We have to run make first so that the proxy Makefile is created and the BR2_EXTERNAL is remembered