From patchwork Mon May 7 14:44:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 909794 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=datacom.ind.br Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40fllG21d7z9s34 for ; Tue, 8 May 2018 00:44:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D5E9026423; Mon, 7 May 2018 14:44:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dQUTi78L4Z1K; Mon, 7 May 2018 14:44:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id ADF5326362; Mon, 7 May 2018 14:44:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 380191CF09A for ; Mon, 7 May 2018 14:44:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 334C2814F3 for ; Mon, 7 May 2018 14:44:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KEOY3z6ZIeTB for ; Mon, 7 May 2018 14:44:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.ind.br (mx.datacom.ind.br [177.66.5.10]) by whitealder.osuosl.org (Postfix) with ESMTPS id 507D5813F2 for ; Mon, 7 May 2018 14:44:43 +0000 (UTC) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id 2B9721BA1E2F; Mon, 7 May 2018 11:44:41 -0300 (-03) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id F14481BA1E40; Mon, 7 May 2018 11:44:40 -0300 (-03) Received: from mail.datacom.ind.br ([127.0.0.1]) by localhost (mail.datacom.ind.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id S446_rSJjKdx; Mon, 7 May 2018 11:44:40 -0300 (-03) Received: from pedeld202344.datacom.net (pedeld202344.datacom.net [10.0.120.87]) by mail.datacom.ind.br (Postfix) with ESMTPSA id 8C4F91BA1E18; Mon, 7 May 2018 11:44:40 -0300 (-03) From: Carlos Santos To: buildroot@buildroot.org Date: Mon, 7 May 2018 11:44:29 -0300 Message-Id: <20180507144431.14488-4-casantos@datacom.ind.br> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180507144431.14488-1-casantos@datacom.ind.br> References: <20180507144431.14488-1-casantos@datacom.ind.br> Subject: [Buildroot] [PATCH v3 3/5] Makefile: check rootfs overlays with BR2_ROOTFS_MERGED_USR enabled X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yann Morin , Thomas De Schampheleire MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 --- 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///rootfs-overlay+.