All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos Santos <casantos@datacom.ind.br>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 3/5] Makefile: check rootfs overlays with BR2_ROOTFS_MERGED_USR enabled
Date: Mon,  7 May 2018 11:44:29 -0300	[thread overview]
Message-ID: <20180507144431.14488-4-casantos@datacom.ind.br> (raw)
In-Reply-To: <20180507144431.14488-1-casantos@datacom.ind.br>

Add a step to target-finalize that checks each rootfs overlay, following
the criteria established for custom skeletons and using the same script
uesd by skeleton-custom.mk.

Add a paragraph to the documentation clarifying that rootfs overlays
don't need to contain /bin, /lib or /sbin and must not contain them when
BR2_ROOTFS_MERGED_USR is enabled.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
Changes v1->v2:

- Rebase series to HEAD of master branch
- Rework commit message and documentation, as suggested by Thomas
  Petazzoni

Changes v2-v3:

- Move the removal of --keep-dirlinks in the call to rsync to a separate
  patch.
---
 Makefile                         | 16 ++++++++++++++++
 docs/manual/customize-rootfs.txt |  8 ++++++++
 2 files changed, 24 insertions(+)

diff --git a/Makefile b/Makefile
index c024c65f78..64c97ce6e2 100644
--- a/Makefile
+++ b/Makefile
@@ -746,6 +746,22 @@ endif
 	@$(call MESSAGE,"Sanitizing RPATH in target tree")
 	$(TOPDIR)/support/scripts/fix-rpath target
 
+# For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
+# counterparts are appropriately setup as symlinks ones to the others.
+ifeq ($(BR2_ROOTFS_MERGED_USR),y)
+
+	@$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
+		$(call MESSAGE,"Sanity check in overlay $(d)"); \
+		not_merged_dirs="$$(support/scripts/check-merged-usr.sh $(d))"; \
+		test -n "$$not_merged_dirs" && { \
+			echo "ERROR: The overlay in $(d) is not" \
+				"using a merged /usr for the following directories:" \
+				$$not_merged_dirs; \
+			exit 1; \
+		} || true$(sep))
+
+endif # merged /usr
+
 	@$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
 		$(call MESSAGE,"Copying overlay $(d)"); \
 		rsync -a --ignore-times --keep-dirlinks $(RSYNC_VCS_EXCLUSIONS) \
diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt
index 9d3a62ddaf..bb6d8da6bf 100644
--- a/docs/manual/customize-rootfs.txt
+++ b/docs/manual/customize-rootfs.txt
@@ -22,6 +22,14 @@ A filesystem overlay is a tree of files that is copied directly
   etc., files called +.empty+ and files ending in +~+ are excluded from
   the copy.
 +
+Filesystem overlays don't need to contain the '/bin', '/lib' or '/sbin'
+  directories, since they are created automatically during the build.
+  When +BR2_ROOTFS_MERGED_USR+ is enabled, then the overlay must not
+  contain the '/bin', '/lib' or '/sbin' directories, as Buildroot will
+  create them as symbolic links to the relevant folders in '/usr'.  In
+  such a situation, should the overlay have any programs or libraries,
+  they should be placed in '/usr/bin', '/usr/sbin' and '/usr/lib'.
++
 As shown in xref:customize-dir-structure[], the recommended path for
   this overlay is +board/<company>/<boardname>/rootfs-overlay+.
 
-- 
2.14.3

  parent reply	other threads:[~2018-05-07 14:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07 14:44 [Buildroot] [PATCH v3 0/5] Improve verification of custom rootfs skeletons and overlays Carlos Santos
2018-05-07 14:44 ` [Buildroot] [PATCH v3 1/5] skeleton-custom: use a script to check merged usr structure Carlos Santos
2019-02-06 16:16   ` Arnout Vandecappelle
2018-05-07 14:44 ` [Buildroot] [PATCH v3 2/5] skeleton-custom: install /bin, /lib, and /sbin Carlos Santos
2018-05-07 14:44 ` Carlos Santos [this message]
2019-02-06 16:20   ` [Buildroot] [PATCH v3 3/5] Makefile: check rootfs overlays with BR2_ROOTFS_MERGED_USR enabled Arnout Vandecappelle
2018-05-07 14:44 ` [Buildroot] [PATCH v3 4/5] Makefile: allow rootfs overlays to override symbolic links Carlos Santos
2018-05-07 14:44 ` [Buildroot] [PATCH v3 5/5] system: allow selecting merged /usr along with custom rootfs skeleton Carlos Santos
2019-02-06 16:15 ` [Buildroot] [PATCH v3 0/5] Improve verification of custom rootfs skeletons and overlays Arnout Vandecappelle

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=20180507144431.14488-4-casantos@datacom.ind.br \
    --to=casantos@datacom.ind.br \
    --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.