From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Roland Hieber Date: Mon, 26 Aug 2019 14:22:05 +0200 Message-Id: <20190826122205.29400-1-rhi@pengutronix.de> MIME-Version: 1.0 Subject: [ptxdist] [PATCH] rootfs: update /etc/issue when its content changes List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Roland Hieber /etc/issue contains multiple variables that are not part of the rootfs package's config hash, therefore the rootfs package is not being rebuilt when those variables change. This applies most importantly to the project version, which usually contains an SCM commit ID (e.g. by using ${PTXDIST_BSP_AUTOVERSION}). Make sure that /etc/issue always shows the correct information at build time, even after checking out a different SCM revision, by using the same mechanism as in os-release.make. Signed-off-by: Roland Hieber --- rules/rootfs.make | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rules/rootfs.make b/rules/rootfs.make index 0a08348e1e83..2cba01a9b5ef 100644 --- a/rules/rootfs.make +++ b/rules/rootfs.make @@ -21,6 +21,23 @@ ROOTFS_LICENSE := ignore # Target-Install # ---------------------------------------------------------------------------- +ROOTFS_STAMP := $(call remove_quotes, \ + $(PTXCONF_PROJECT) \ + $(PTXCONF_PROJECT_VERSION) \ + $(PTXCONF_PLATFORM) \ + $(PTXCONF_PLATFORM_VERSION) \ + $(PTXDIST_VERSION_YEAR) \ + $(PTXDIST_VERSION_MONTH) \ + $(PTXDIST_VERSION_BUGFIX) \ + $(PTXDIST_VERSION_SCM) \ + $(PTXCONF_PROJECT_VENDOR) \ + ) + +# install new /etc/issue if versions change +ifneq ($(strip $(ROOTFS_STAMP)),$(strip $(call ptx/force-sh, cat $(STATEDIR)/rootfs.stamp 2>/dev/null))) +PHONY += $(STATEDIR)/rootfs.targetinstall +endif + $(STATEDIR)/rootfs.targetinstall: @$(call targetinfo) @@ -263,6 +280,7 @@ endif @$(call install_finish, rootfs) + @echo "$(ROOTFS_STAMP)" > $(STATEDIR)/rootfs.stamp @$(call touch) # vim: syntax=make -- 2.20.1 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de