Skip to content

Commit

Permalink
kbuild: fix header installation under fakechroot environment
Browse files Browse the repository at this point in the history
Since commit fcc8487 ("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)/*/))))

Fixes: fcc8487 ("uapi: export all headers under uapi directories")
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
  • Loading branch information
Richard Genoud authored and Masahiro Yamada committed Jun 21, 2017
1 parent ff85a1a commit 2f263d1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/Makefile.headersinst
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 2f263d1

Please sign in to comment.