/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 <[email protected]>
---
 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
[email protected]

Reply via email to