From patchwork Thu Jun 15 08:36:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 9788375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F1599602CB for ; Thu, 15 Jun 2017 08:36:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFC27284B0 for ; Thu, 15 Jun 2017 08:36:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D446A2853A; Thu, 15 Jun 2017 08:36:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A774284B0 for ; Thu, 15 Jun 2017 08:36:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750784AbdFOIgc (ORCPT ); Thu, 15 Jun 2017 04:36:32 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35333 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbdFOIgb (ORCPT ); Thu, 15 Jun 2017 04:36:31 -0400 Received: by mail-wr0-f193.google.com with SMTP id z45so1939571wrb.2; Thu, 15 Jun 2017 01:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=cwg/6OEsvCs8+DSjvRSWRnabTQDTjl2MnI/6WX0piuE=; b=rwwVDwdDk++YeCrR8FwtPt3i2PHieACZJvmcO3cycbzJ6E/83Gk9R0++MMDkOGIo/K Gjb05V8gl+BdhaUmsqn9mkTS5Ikt3WtLm4SQ5wiU1uK4+D3peCVT6sj79+0rR/CTX/sx ovLNmCLictz1ineTrEIkZYflzJ+lqUs2ahUt91J4cdy4I1R2OANoe1Oe7/exMu7bBOG3 HdlyuUafw/Gx5nZfhDaRMeOsgGUlryxiGb4zJzpDNCAC37JpnudGZDhSgyu4ABRENDyB H5gNpzBBjf/GJ/mdY+wFErGRO471twq8IfbO4diS98U3/OBtfxt8puJ3hRLSfU+6f+8O xtFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cwg/6OEsvCs8+DSjvRSWRnabTQDTjl2MnI/6WX0piuE=; b=hcKx60MBiHHu6/R1yTbGi6qYF99ghoJMpOIq18fRW6yqmDDrQpBHDZE19+ZEf9owmL k4EWpoiirtGdkF+tt444uH50mu+//TFlO1EGkauWrhvtwrw5/B4k9gruUbiOuFxMDimZ MlzMlEjQYpEothUnxeTz1w9jC2iVNUdaMMeB2wa9tlG6w1ENBwavNA6wj2jMqsjoh5bY BPsIZ2H6HBc4k5Xq60TB8x9r7D8iJYVFg7jyWpk87WO/Zaz9uvpE1tnXLLbu8s9UhzVL 012JPViQq5r67TDp+rh4C3fnEVxKvH/AE24kwwMkfKQI+YFBIco77fnuw8f9ny9TqmJ6 bFKQ== X-Gm-Message-State: AKS2vOwbKizZoWII76B7ViWUCb3NXmoLPdT6p1CvTGFMiJwUT0fn1Z5P vE7Q1Ye+r62wEw== X-Received: by 10.28.229.80 with SMTP id c77mr2735459wmh.31.1497515789672; Thu, 15 Jun 2017 01:36:29 -0700 (PDT) Received: from localhost ([46.227.18.67]) by smtp.gmail.com with ESMTPSA id s95sm2342542wrc.13.2017.06.15.01.36.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 01:36:29 -0700 (PDT) From: Richard Genoud To: Masahiro Yamada , Nicolas Dichtel Cc: Daniel Vetter , Russell King , Mark Salter , Michael Ellerman , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Genoud Subject: [PATCH] kbuild: fix header installation under fakechroot environment Date: Thu, 15 Jun 2017 10:36:22 +0200 Message-Id: <20170615083622.16618-1-richard.genoud@gmail.com> X-Mailer: git-send-email 2.13.1 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit fcc8487d477a ("uapi: export all headers under uapi directories") fakechroot make bindeb-pkg fails, mismatching files for directories: touch: cannot touch 'usr/include/video/uvesafb.h/.install': Not a directory This due to a bug in fakechroot: when using the function $(wildcard $(srcdir)/*/.) in a makefile, under a fakechroot environment, not only directories but also files are returned. To circumvent that, we are using the functions: $(sort $(dir $(wildcard $(srcdir)/*/)))) And thanks to Yamada Masahiro who figured out the right filter-out/patsubst order ! Fixes: fcc8487d477a ("uapi: export all headers under uapi directories") Signed-off-by: Richard Genoud --- scripts/Makefile.headersinst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index ce753a408c56..c583a1e1bd3c 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst @@ -14,7 +14,15 @@ __headers: include scripts/Kbuild.include srcdir := $(srctree)/$(obj) -subdirs := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/*/.)) + +# When make is run under a fakechroot environment, the function +# $(wildcard $(srcdir)/*/.) doesn't only return directories, but also regular +# files. So, we are using a combination of sort/dir/wildcard which works +# with fakechroot. +subdirs := $(patsubst $(srcdir)/%/,%,\ + $(filter-out $(srcdir)/,\ + $(sort $(dir $(wildcard $(srcdir)/*/))))) + # caller may set destination dir (when installing to asm/) _dst := $(if $(dst),$(dst),$(obj))