From: Richard Genoud <richard.genoud@gmail.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Russell King <rmk+kernel@armlinux.org.uk>,
Mark Salter <msalter@redhat.com>,
Michael Ellerman <mpe@ellerman.id.au>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Richard Genoud <richard.genoud@gmail.com>
Subject: [PATCH] kbuild: fix header installation under fakechroot environment
Date: Thu, 15 Jun 2017 10:36:22 +0200 [thread overview]
Message-ID: <20170615083622.16618-1-richard.genoud@gmail.com> (raw)
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 <richard.genoud@gmail.com>
---
| 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--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))
next reply other threads:[~2017-06-15 8:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-15 8:36 Richard Genoud [this message]
2017-06-16 2:20 ` Masahiro Yamada
2017-06-22 1:17 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170615083622.16618-1-richard.genoud@gmail.com \
--to=richard.genoud@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpe@ellerman.id.au \
--cc=msalter@redhat.com \
--cc=nicolas.dichtel@6wind.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®