mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Roland Hieber <rhi@pengutronix.de>
Subject: [ptxdist] [PATCH] rootfs: update /etc/issue when its content changes
Date: Mon, 26 Aug 2019 14:22:05 +0200	[thread overview]
Message-ID: <20190826122205.29400-1-rhi@pengutronix.de> (raw)

/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

                 reply	other threads:[~2019-08-26 12:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190826122205.29400-1-rhi@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox