mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] rootfs: update /etc/issue when its content changes
@ 2019-08-26 12:22 Roland Hieber
  0 siblings, 0 replies; only message in thread
From: Roland Hieber @ 2019-08-26 12:22 UTC (permalink / raw)
  To: ptxdist; +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 <rhi@pengutronix.de>
---
 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-26 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26 12:22 [ptxdist] [PATCH] rootfs: update /etc/issue when its content changes Roland Hieber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox