diff --git a/board/common/mkrauc.sh b/board/common/mkrauc.sh index a528c7fa..6cb30c28 100755 --- a/board/common/mkrauc.sh +++ b/board/common/mkrauc.sh @@ -2,8 +2,6 @@ set -e -GIT_VERSION=$(git -C "$BR2_EXTERNAL_INFIX_PATH" describe --always --dirty --tags) - name=$1 compat=$2 sign=$3 @@ -26,7 +24,7 @@ cp -f "$BINARIES_DIR/rootfs.itbh" "$work/rootfs.itbh" cat >"$work/manifest.raucm" < "$TARGET_DIR/etc/os-release" -echo "$INFIX_TAGLINE $VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version" +echo "$INFIX_TAGLINE $INFIX_VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version" # In case of ambguities, this is what the image was built from cp "$BR2_CONFIG" "$TARGET_DIR/usr/share/infix/config" diff --git a/external.mk b/external.mk index 18c3c019..773e586f 100644 --- a/external.mk +++ b/external.mk @@ -1,9 +1,7 @@ -IXMSG = printf "\e[37;44m>>> $(call qstrip,$(1))\e[0m\n" - +include $(BR2_EXTERNAL_INFIX_PATH)/infix.mk include $(sort $(wildcard $(BR2_EXTERNAL_INFIX_PATH)/package/*/*.mk)) include $(BR2_EXTERNAL_INFIX_PATH)/board/common/common.mk -include $(BR2_EXTERNAL_INFIX_PATH)/board/$(patsubst "%",%,$(BR2_ARCH))/board.mk -include $(BR2_EXTERNAL_INFIX_PATH)/infix.mk include $(BR2_EXTERNAL_INFIX_PATH)/test/test.mk .PHONY: local.mk diff --git a/infix.mk b/infix.mk index d710f494..1a91fb28 100644 --- a/infix.mk +++ b/infix.mk @@ -1 +1,11 @@ +IXMSG = printf "\e[37;44m>>> $(call qstrip,$(1))\e[0m\n" + +INFIX_TOPDIR = $(if $(INFIX_OEM_PATH),$(INFIX_OEM_PATH),$(BR2_EXTERNAL_INFIX_PATH)) + +# Unless the user specifies an explicit build id, source it from git. +# The build id also becomes the image version, unless an official +# release is being built. +export INFIX_BUILD_ID ?= $(shell git -C $(INFIX_TOPDIR) describe --dirty --always --tags) +export INFIX_VERSION = $(if $(INFIX_RELEASE),$(INFIX_RELEASE),$(INFIX_BUILD_ID)) + INFIX_CFLAGS:=-Wall -Werror -Wextra -Wno-unused-parameter -Wformat=2 -Wformat-overflow=2 -Winit-self -Wstrict-overflow=4 -Wno-format-truncation -Wno-format-nonliteral diff --git a/test/test.mk b/test/test.mk index e5a43bdd..34901600 100644 --- a/test/test.mk +++ b/test/test.mk @@ -6,7 +6,6 @@ test-specification := $(O)/images/test-specification.pdf UNIT_TESTS ?= $(test-dir)/case/all-repo.yaml $(test-dir)/case/all-unit.yaml TESTS ?= $(test-dir)/case/all.yaml -GIT_VERSION = $(shell git -C $(GIT_PATH) describe --dirty --always --tags) base := -b $(base-dir) @@ -34,7 +33,7 @@ test-sh: test-spec: @esc_infix_name="$(echo $(INFIX_NAME) | sed 's/\//\\\//g')"; \ - sed 's/{REPLACE}/$(subst ",,$(esc_infix_name)) $(GIT_VERSION)/' $(spec-dir)/Readme.adoc.in > $(spec-dir)/Readme.adoc + sed 's/{REPLACE}/$(subst ",,$(esc_infix_name)) $(INFIX_VERSION)/' $(spec-dir)/Readme.adoc.in > $(spec-dir)/Readme.adoc @$(spec-dir)/generate_spec.py -d $(test-dir)/case -r $(BR2_EXTERNAL_INFIX_PATH) @asciidoctor-pdf --failure-level INFO --theme $(spec-dir)/theme.yml -a pdf-fontsdir=$(spec-dir)/fonts -o $(test-specification) $(spec-dir)/Readme.adoc