kernel: split patches folder up into backport, pending and hack folders
[oweals/openwrt.git] / target / linux / generic / pending-4.9 / 240-remove-unsane-filenames-from-deps_initramfs-list.patch
1 From: Gabor Juhos <juhosg@openwrt.org>
2 Subject: usr: sanitize deps_initramfs list
3
4 If any filename in the intramfs dependency
5 list contains a colon, that causes a kernel
6 build error like this:
7
8 /devel/openwrt/build_dir/linux-ar71xx_generic/linux-3.6.6/usr/Makefile:58: *** multiple target patterns.  Stop.
9 make[5]: *** [usr] Error 2
10
11 Fix it by removing such filenames from the
12 deps_initramfs list.
13
14 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
15 ---
16  usr/Makefile | 8 +++++---
17  1 file changed, 5 insertions(+), 3 deletions(-)
18
19 diff --git a/usr/Makefile b/usr/Makefile
20 index e767f019accf..17328d3c11cc 100644
21 --- a/usr/Makefile
22 +++ b/usr/Makefile
23 @@ -53,6 +53,8 @@ ifneq ($(wildcard $(obj)/.initramfs_data.cpio.d),)
24         include $(obj)/.initramfs_data.cpio.d
25  endif
26  
27 +deps_initramfs_sane := $(foreach v,$(deps_initramfs),$(if $(findstring :,$(v)),,$(v)))
28 +
29  quiet_cmd_initfs = GEN     $@
30        cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
31  
32 @@ -61,14 +63,14 @@ targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 \
33         initramfs_data.cpio.lzo initramfs_data.cpio.lz4 \
34         initramfs_data.cpio
35  # do not try to update files included in initramfs
36 -$(deps_initramfs): ;
37 +$(deps_initramfs_sane): ;
38  
39 -$(deps_initramfs): klibcdirs
40 +$(deps_initramfs_sane): klibcdirs
41  # We rebuild initramfs_data.cpio if:
42  # 1) Any included file is newer then initramfs_data.cpio
43  # 2) There are changes in which files are included (added or deleted)
44  # 3) If gen_init_cpio are newer than initramfs_data.cpio
45  # 4) arguments to gen_initramfs.sh changes
46 -$(obj)/initramfs_data.cpio$(suffix_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
47 +$(obj)/initramfs_data.cpio$(suffix_y): $(obj)/gen_init_cpio $(deps_initramfs_sane) klibcdirs
48         $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.d
49         $(call if_changed,initfs)
50 -- 
51 2.11.0
52