From patchwork Wed Jan 20 19:11:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 570876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id BD3F41402ED for ; Thu, 21 Jan 2016 06:12:58 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=jn6PF6XE; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 18C7593618; Wed, 20 Jan 2016 19:12:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g-ZUMvVtSsoX; Wed, 20 Jan 2016 19:12:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 75A0B9367F; Wed, 20 Jan 2016 19:12:57 +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 6FE4A1C1F31 for ; Wed, 20 Jan 2016 19:12:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6A8DE86B60 for ; Wed, 20 Jan 2016 19:12:54 +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 QkeETXOPcXc1 for ; Wed, 20 Jan 2016 19:12:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 1C75286B28 for ; Wed, 20 Jan 2016 19:12:53 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id u188so6104972wmu.0 for ; Wed, 20 Jan 2016 11:12:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cJzxWY+GTbfVFHO2cu45vHUqqcn06R7E15x3sp7MfgA=; b=jn6PF6XEoyTpwYxuvqiw5eSl5LkGeZLdmURYrgO307N/0rW4+e6uw8rVUI3oks70ja 1OTcWJsx2Xo+rXHPuvXpeHpe7lHKmF2BisY5JnMn24ji3YpdTgezg5DupqytZYSuf/Su xktct7w8VNj3iD3L0UKZWlVItP4jIl7GJN/0SfAKoDGWB/dzRTGaMy2SZrEFjfiR0T3n /O+Hke1Mmm/TK7F40iIdSvMEM78exmaDepb3bb96pukZWse5VWv7lJXyUZzlWiK1FkaX oni60coiDyr7WdLx1FM4t53fdVkWT+hIhItswxs21hJVlvd9b7qCw5mEmiXiI4W/9H3U DJ2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cJzxWY+GTbfVFHO2cu45vHUqqcn06R7E15x3sp7MfgA=; b=gJ5lcm2vV8+JIrdY51TfYrbvmaQuOficH3BtwOm5yLH9bjqftqUcyfiIW0kqf0VbMy bhIGcmI2+7e2VpcI1Ua6srf/Ed2VNBmucwLy7YGWRGggnJnUCcnJsFu/xnVB0HuFdzUP ZVch4RJ1N+6CaMjL11Ba5DPkkc/VV0x5Q8xBqiVww4U5AASDU27vVwt9BGytmBbBTPAq IOXuxhLyR4CDvd7X0b15pxd4eOF8lBvjS8NCHX0gr6/2tIvkKOvf31JEqMiZxVfEcrJL c0fzbp7ckw8D+fsrOJg2EPR2Zg2wuCc05SmeY/uY18YeH7PwyPApMCbhvmkb5ex6217z iv9g== X-Gm-Message-State: AG10YOTByg8fZpCTv2MFV8BLLpVfxUSomedspAmiL86CPXS7btXk04VsnNUyyYP16SzJGQ== X-Received: by 10.28.158.74 with SMTP id h71mr5771565wme.74.1453317171585; Wed, 20 Jan 2016 11:12:51 -0800 (PST) Received: from localhost.localdomain (alc112.alcatel.be. [195.207.101.112]) by smtp.gmail.com with ESMTPSA id w8sm34492961wjx.21.2016.01.20.11.12.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jan 2016 11:12:50 -0800 (PST) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Wed, 20 Jan 2016 20:11:29 +0100 Message-Id: <1453317091-17676-2-git-send-email-patrickdepinguin@gmail.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1453317091-17676-1-git-send-email-patrickdepinguin@gmail.com> References: <1453317091-17676-1-git-send-email-patrickdepinguin@gmail.com> Cc: Thomas Petazzoni , Thomas De Schampheleire Subject: [Buildroot] [PATCH v11 2/4] toolchain-external: don't exclude too much lib in sysroot rsync X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Thomas De Schampheleire The copy_toolchain_sysroot helper in toolchain/helpers.mk performs an rsync of various directories from the extracted external toolchain to the corresponding directory in staging. The relevant (simplified) snippet is: for i in etc $${ARCH_LIB_DIR} sbin usr usr/$${ARCH_LIB_DIR}; do \ rsync -au --chmod=u=rwX,go=rX --exclude 'usr/lib/locale' \ --exclude lib --exclude lib32 --exclude lib64 \ $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \ done ; \ The exclusion logic of lib/lib32/lib64 has been added by commit 5628776c4a4d29d0715633ea463b64cc19e19c5a with the purpose of only copying the relevant usr/lib* directory from the toolchain to staging, instead of all. For example, if ARCH_LIB_DIR is 'lib64', then only usr/lib64 would be copied and usr/lib and usr/lib32 are ignored. It works by ignoring any lib/lib32/lib64 subdirectory on the rsync of 'usr' and then separately copying usr/{lib,lib32,lib64} as appropriate. (The exclusion rules only have impact on the files beneath the main source directory.) However, on the rsync of 'usr', ANY of the following directories AND files would be excluded: lib/ lib lib32/ foobar/something/lib/ something-else/lib64/ while it is only the intention to skip directories directly under usr. Therefore, add a leading (to restrict the scope to first-level) and trailing (to restrict to directories) slash to the exclude pattern. From 'man rsync': - if the pattern starts with a / then it is anchored to [..] the root of the transfer. - if the pattern ends with a / then it will only match a directory, not a regular file, symlink, or device. Signed-off-by: Thomas De Schampheleire Cc: Samuel Martin Cc: Thomas Petazzoni Cc: Arnout Vandecappelle Reviewed-by: Romain Naour --- v11: unchanged v10: new patch toolchain/helpers.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 70695ee..906993d 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -154,7 +154,8 @@ copy_toolchain_sysroot = \ for i in etc $${ARCH_LIB_DIR} sbin usr usr/$${ARCH_LIB_DIR}; do \ if [ -d $${ARCH_SYSROOT_DIR}/$$i ] ; then \ rsync -au --chmod=u=rwX,go=rX --exclude 'usr/lib/locale' \ - --exclude lib --exclude lib32 --exclude lib64 \ + --exclude '/lib/' --exclude '/lib32/' \ + --exclude '/lib64/' \ $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \ fi ; \ done ; \