提交 2f263d14 编写于 作者: R Richard Genoud 提交者: Masahiro Yamada

kbuild: fix header installation under fakechroot environment

Since commit fcc8487d ("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: fcc8487d ("uapi: export all headers under uapi directories")
Signed-off-by: NRichard Genoud <richard.genoud@gmail.com>
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
上级 ff85a1a8
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册