From patchwork Mon May 7 14:44:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 909789 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.137; helo=fraxinus.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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40fll818Csz9s3q for ; Tue, 8 May 2018 00:44:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D081685F2F; Mon, 7 May 2018 14:44:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KaimDN6UF1ZW; Mon, 7 May 2018 14:44:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 34DAD85ED8; Mon, 7 May 2018 14:44:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 917911C2AB3 for ; Mon, 7 May 2018 14:44:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8D94085DFA for ; Mon, 7 May 2018 14:44:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mz_2uMUUpKl1 for ; Mon, 7 May 2018 14:44:42 +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 fraxinus.osuosl.org (Postfix) with ESMTPS id 3EE6885ED8 for ; Mon, 7 May 2018 14:44:42 +0000 (UTC) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id E93B21BA1E39; Mon, 7 May 2018 11:44:40 -0300 (-03) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id A24621BA1DEF; 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 DNRRdMdusWr3; 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 691BA1BA1E1C; Mon, 7 May 2018 11:44:40 -0300 (-03) From: Carlos Santos To: buildroot@buildroot.org Date: Mon, 7 May 2018 11:44:28 -0300 Message-Id: <20180507144431.14488-3-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 2/5] skeleton-custom: install /bin, /lib, and /sbin 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" skeleton-custom does not install the required /bin, /lib and /sbin directories (or symlinks), which may result in an imcomplete tree, The user could add the required directories/symlinks to the skeleton but they may be invalid, depending on the state of BR2_ROOTFS_MERGED_USR. Steps to reproduce: - Enable BR2_ROOTFS_MERGED_USR and BR2_INIT_SYSTEMD - Set BR2_ROOTFS_SKELETON_CUSTOM_PATH to "system/skeleton" - Run "make skeleton" - target/{bin.lib,sbin} will not exist Add calls to SYSTEM_USR_SYMLINKS_OR_DIRS to INSTALL_TARGET_CMDS and INSTALL_STAGING_CMDS, so the required directories or symlinks are created. Add a paragraph to the documentation clarifying that custom skeletons 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 --- docs/manual/customize-rootfs.txt | 9 +++++++++ package/skeleton-custom/skeleton-custom.mk | 2 ++ 2 files changed, 11 insertions(+) diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt index 44fc460670..9d3a62ddaf 100644 --- a/docs/manual/customize-rootfs.txt +++ b/docs/manual/customize-rootfs.txt @@ -100,6 +100,15 @@ To enable this feature, enable config option +System configuration+ menu. If you specify a relative path, it will be relative to the root of the Buildroot tree. + +Custom skeletons 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 custom skeleton 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 skeleton have any programs or + libraries, they should be placed in '/usr/bin', '/usr/sbin' and + '/usr/lib'. ++ This method is not recommended because it duplicates the entire skeleton, which prevents taking advantage of the fixes or improvements brought to the default skeleton in later Buildroot releases. diff --git a/package/skeleton-custom/skeleton-custom.mk b/package/skeleton-custom/skeleton-custom.mk index b1cddd9146..01cd62794d 100644 --- a/package/skeleton-custom/skeleton-custom.mk +++ b/package/skeleton-custom/skeleton-custom.mk @@ -43,6 +43,7 @@ endif # things we customise in the custom skeleton. define SKELETON_CUSTOM_INSTALL_TARGET_CMDS $(call SYSTEM_RSYNC,$(SKELETON_CUSTOM_PATH),$(TARGET_DIR)) + $(call SYSTEM_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR)) $(call SYSTEM_LIB_SYMLINK,$(TARGET_DIR)) $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \ $(TARGET_DIR_WARNING_FILE) @@ -54,6 +55,7 @@ endef # skeleton to staging. define SKELETON_CUSTOM_INSTALL_STAGING_CMDS $(call SYSTEM_RSYNC,$(SKELETON_CUSTOM_PATH),$(STAGING_DIR)) + $(call SYSTEM_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR)) $(call SYSTEM_LIB_SYMLINK,$(STAGING_DIR)) endef