All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 05/15 v4] fs: set per-rootfs variable name
Date: Sat, 31 Mar 2018 11:05:51 +0200	[thread overview]
Message-ID: <2c9871505f740e5fec41247211aa86aa47feef6b.1522487149.git.yann.morin.1998@free.fr> (raw)
In-Reply-To: <cover.1522487149.git.yann.morin.1998@free.fr>

Like we do for packages with the PKG variable, set ROOTFS to contain the
upper-case name of the rootfs currently being generated.

This will be usefull in later patches, when we need more per-rootfs
variables, like a per-rootfs TARGET_DIR for example.

In Makefiles, per-rule variables trickle down the dependency chain, to
all dependencies of that rule, so we have to stop ROOTFS as soone as
we're not in a rootfs. This means we have to stop it at target-finalize
(which is a dependency of all filesystems), and for each package
individually, since some packages (host or target) can be direct
dependencies of filesystems as well.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
 Makefile               | 3 +++
 fs/common.mk           | 3 +++
 package/pkg-generic.mk | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/Makefile b/Makefile
index 41624b859e..e17675be9b 100644
--- a/Makefile
+++ b/Makefile
@@ -680,6 +680,9 @@ endif
 
 $(TARGETS_ROOTFS): target-finalize
 
+# Avoid the rootfs name leaking down the dependency chain
+target-finalize: ROOTFS=
+
 .PHONY: target-finalize
 target-finalize: $(PACKAGES)
 	@$(call MESSAGE,"Finalizing target directory")
diff --git a/fs/common.mk b/fs/common.mk
index 274a3e9c7b..af6799bb83 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -39,6 +39,8 @@ ROOTFS_USERS_TABLES = $(call qstrip,$(BR2_ROOTFS_USERS_TABLES))
 # all variable references except the arguments must be $$-quoted.
 define inner-rootfs
 
+ROOTFS_$(2)_NAME = $(1)
+
 # extra deps
 ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \
 	$$(if $$(PACKAGES_USERS)$$(ROOTFS_USERS_TABLES),host-mkpasswd)
@@ -72,6 +74,7 @@ ROOTFS_$(2)_COMPRESS_EXT = .xz
 ROOTFS_$(2)_COMPRESS_CMD = xz -9 -C crc32 -c
 endif
 
+$$(BINARIES_DIR)/rootfs.$(1): ROOTFS=$(2)
 $$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES)
 	@$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)")
 	rm -rf $(FS_DIR)
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 6d82f7027e..152e1d0c67 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -384,6 +384,10 @@ endef
 
 define inner-generic-package
 
+# When doing a package, we're definitely not doing a rootfs, but we
+# may inherit it via the dependency chain, so we reset it.
+$(1): ROOTFS=
+
 # Ensure the package is only declared once, i.e. do not accept that a
 # package be re-defined by a br2-external tree
 ifneq ($(call strip,$(filter $(1),$(PACKAGES_ALL))),)
-- 
2.14.1

  parent reply	other threads:[~2018-03-31  9:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31  9:05 [Buildroot] [PATCH 00/15 v4] fs: support parallel filesystems build Yann E. MORIN
2018-03-31  9:05 ` [Buildroot] [PATCH 01/15 v4] fs: run filesystem hooks under fakeroot Yann E. MORIN
2018-03-31  9:05 ` [Buildroot] [PATCH 02/15 v4] fs/cpio: don't extend packages' permissions table Yann E. MORIN
2018-03-31 17:43   ` Peter Korsgaard
2018-03-31  9:05 ` [Buildroot] [PATCH 03/15 v4] fs/iso9660: rename internal variable Yann E. MORIN
2018-03-31  9:05 ` [Buildroot] [PATCH 04/15 v4] core: introduce intermediate BASE_TARGET_DIR variable Yann E. MORIN
2018-03-31  9:05 ` Yann E. MORIN [this message]
2018-03-31 18:28   ` [Buildroot] [PATCH 05/15 v4] fs: set per-rootfs variable name Arnout Vandecappelle
2018-03-31  9:05 ` [Buildroot] [PATCH 06/15 v4] fs: define per-rootfs directory Yann E. MORIN
2018-03-31  9:05 ` [Buildroot] [PATCH 07/15 v4] fs: use a per-rootfs fakeroot script Yann E. MORIN
2018-03-31 17:50   ` Peter Korsgaard
2018-03-31 18:26   ` Arnout Vandecappelle
2018-03-31 18:43     ` Arnout Vandecappelle
2018-03-31  9:05 ` [Buildroot] [PATCH 08/15 v4] fs: split per-rootfs dependency line Yann E. MORIN
2018-03-31  9:05 ` [Buildroot] [PATCH 09/15 v4] fs: introduce per-rootfs TARGET_DIR variable Yann E. MORIN
2018-03-31 18:30   ` Arnout Vandecappelle
2018-03-31 18:51     ` Yann E. MORIN
2018-03-31 18:57       ` Arnout Vandecappelle
2018-03-31 19:11         ` Yann E. MORIN
2018-03-31  9:05 ` [Buildroot] [PATCH 10/15 v4] fs: new intermediate rootfs-common to gather common dependencies Yann E. MORIN
2018-03-31  9:05 ` [Buildroot] [PATCH 11/15 v4] fs: introduce a macro for reproducible command Yann E. MORIN
2018-03-31  9:05 ` [Buildroot] [PATCH 12/15 v4] fs: use a common tarball as base for the other filesystems Yann E. MORIN
2018-03-31 18:53   ` Arnout Vandecappelle
2018-03-31  9:05 ` [Buildroot] [PATCH 13/15 v4] fs: run packages' filesystem hooks in a copy of target/ Yann E. MORIN
2018-03-31 19:04   ` Arnout Vandecappelle
2018-03-31 20:27     ` Peter Korsgaard
2018-03-31 21:09       ` Arnout Vandecappelle
2018-04-01  9:54         ` Peter Korsgaard
2018-03-31  9:06 ` [Buildroot] [PATCH 14/15 v4] fs: get rid of package-provided post-fs hooks Yann E. MORIN
2018-03-31  9:06 ` [Buildroot] [PATCH 15/15 v4] fs: remove intermediate artefacts Yann E. MORIN
2018-03-31 17:53   ` Peter Korsgaard
2018-03-31 18:53 ` [Buildroot] [PATCH 00/15 v4] fs: support parallel filesystems build Peter Korsgaard

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=2c9871505f740e5fec41247211aa86aa47feef6b.1522487149.git.yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.