Jan Kundrát | 7a9d8b0 | 2020-02-05 23:03:00 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | function czechlight_describe_git { |
| 4 | echo $(git --git-dir=${1}/.git --work-tree=${1} describe --dirty 2>/dev/null || git --git-dir=${1}/.git rev-parse --short HEAD) |
| 5 | } |
| 6 | |
| 7 | function czechlight_query_local_make_var { |
| 8 | echo $(sed -n -e "s/\\s*$1\\s*=\\s*\\(.*\\)/\\1/p" ${BASE_DIR}/local.mk) |
| 9 | } |
| 10 | |
| 11 | CLA_BR2_EXTERNAL_REV=$(czechlight_describe_git ${BR2_EXTERNAL_CZECHLIGHT_PATH}) |
| 12 | CLA_SYSREPO_REV=$(czechlight_describe_git $(czechlight_query_local_make_var CLA_SYSREPO_OVERRIDE_SRCDIR)) |
| 13 | NETCONF_CLI_REV=$(czechlight_describe_git $(czechlight_query_local_make_var NETCONF_CLI_OVERRIDE_SRCDIR)) |
Jan Kundrát | 18fb83e | 2021-03-01 22:35:50 +0100 | [diff] [blame] | 14 | GAMMARUS_REV=$(czechlight_describe_git $(czechlight_query_local_make_var GAMMARUS_OVERRIDE_SRCDIR)) |
| 15 | VELIA_REV=$(czechlight_describe_git $(czechlight_query_local_make_var VELIA_OVERRIDE_SRCDIR)) |
Jan Kundrát | eaa9599 | 2021-11-23 23:04:14 +0100 | [diff] [blame] | 16 | ROUSETTE_REV=$(czechlight_describe_git $(czechlight_query_local_make_var ROUSETTE_OVERRIDE_SRCDIR)) |
Jan Kundrát | 7a9d8b0 | 2020-02-05 23:03:00 +0100 | [diff] [blame] | 17 | |
Jan Kundrát | c4e5ee4 | 2022-03-25 00:42:15 +0100 | [diff] [blame] | 18 | # CzechLight/dependencies might come either from a git submodule, or from a Zuul change enqueued before this one |
| 19 | CLA_CPP_DEPENDENCIES_REV=$(czechlight_describe_git $(czechlight_query_local_make_var LIBYANG_OVERRIDE_SRCDIR)/..) |
| 20 | |
Jan Kundrát | 7a9d8b0 | 2020-02-05 23:03:00 +0100 | [diff] [blame] | 21 | sed -i \ |
| 22 | -e 's/^VERSION_ID=/BUILDROOT_VERSION_ID=/' \ |
| 23 | -e 's/^VERSION=/BUILDROOT_VERSION=/' \ |
| 24 | -e '/^NAME=/d' -e '/^PRETTY_NAME=/d' \ |
| 25 | $TARGET_DIR/etc/os-release |
| 26 | |
| 27 | cat >> ${TARGET_DIR}/etc/os-release <<EOF |
| 28 | NAME=CzechLight |
| 29 | # When building under CI, these git revisions might not necessarily refer to |
| 30 | # something that is available from Gerrit's git repositories. If the job which |
| 31 | # produced this image is a result of a Zuul job tree with speculatively merged |
| 32 | # changes, then these refs are private to Zuul mergers. |
| 33 | PRETTY_NAME="Czech Light ${CLA_BR2_EXTERNAL_REV}" |
| 34 | VERSION=${CLA_BR2_EXTERNAL_REV} |
| 35 | CLA_SYSREPO_VERSION=${CLA_SYSREPO_REV} |
| 36 | NETCONF_CLI_VERSION=${NETCONF_CLI_REV} |
| 37 | CPP_DEPENDENCIES_VERSION=${CLA_CPP_DEPENDENCIES_REV} |
Jan Kundrát | 0c418dc | 2020-03-09 19:41:29 -0700 | [diff] [blame] | 38 | GAMMARUS_VERSION=${GAMMARUS_REV} |
Jan Kundrát | 0ef968e | 2021-11-23 22:11:23 +0100 | [diff] [blame] | 39 | VELIA_VERSION=${VELIA_REV} |
Jan Kundrát | 02cbb81 | 2021-03-02 10:13:35 +0100 | [diff] [blame] | 40 | ROUSETTE_VERSION=${ROUSETTE_REV} |
Jan Kundrát | 7a9d8b0 | 2020-02-05 23:03:00 +0100 | [diff] [blame] | 41 | EOF |