From patchwork Mon May 7 14:44:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 909791 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.138; helo=whitealder.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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40fllB61FHz9ryk for ; Tue, 8 May 2018 00:44:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A82A281E9F; Mon, 7 May 2018 14:44:49 +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 5pJjyHkMuQQN; Mon, 7 May 2018 14:44:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 7D99E814F3; Mon, 7 May 2018 14:44:47 +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 EAD551CF020 for ; Mon, 7 May 2018 14:44:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E6C1885EDA for ; Mon, 7 May 2018 14:44:43 +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 a8TycvjJ9uKn 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 3674385DFA 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 257F51BA1E2A; 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 E85DB1BA1E1E; 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 sHjKdC877Yge; 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 ABC461BA1E2F; Mon, 7 May 2018 11:44:40 -0300 (-03) From: Carlos Santos To: buildroot@buildroot.org Date: Mon, 7 May 2018 11:44:30 -0300 Message-Id: <20180507144431.14488-5-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 4/5] Makefile: allow rootfs overlays to override symbolic links 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" Since commit 0db34529f48 we use rsync with the --keep-dirlinks option to prevent overlays from accidentally overwriding /{usr,bin,sbin,lib} links when BR2_ROOTFS_MERGED_USR option is enabled. Unfortunately this also prevents replacing a symlink by a directory on purpose (e.g. /var/log, to persist system logs). Steps to reproduce: - enable BR2_ROOTFS_MERGED_USR and BR2_PACKAGE_SKELETON_INIT_SYSV - mkdir some_path/rootfs-overlay/var/log - enable BR2_ROOTFS_OVERLAY="some_path/rootfs-overlay" - run 'make' - 'target/var/log' is still a symlink to '../tmp', not a directory The --keep-dirlinks option can be dropped, since we run sanity checks on overlays. Now the rsync invocation is identical to the SYSTEM_RSYNC logic we have in system/system.mk, so use that variable. 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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 64c97ce6e2..dc51269143 100644 --- a/Makefile +++ b/Makefile @@ -764,9 +764,7 @@ endif # merged /usr @$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \ $(call MESSAGE,"Copying overlay $(d)"); \ - rsync -a --ignore-times --keep-dirlinks $(RSYNC_VCS_EXCLUSIONS) \ - --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \ - $(d)/ $(TARGET_DIR)$(sep)) + $(call SYSTEM_RSYNC,$(d),$(TARGET_DIR))$(sep)) @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \ $(call MESSAGE,"Executing post-build script $(s)"); \