blob: 7d890d3e8bb1063d50cb298b252bb91c2ed8c723 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From: Gabor Juhos <juhosg@openwrt.org>
2Subject: usr: sanitize deps_initramfs list
3
4If any filename in the intramfs dependency
5list contains a colon, that causes a kernel
6build error like this:
7
8/devel/openwrt/build_dir/linux-ar71xx_generic/linux-3.6.6/usr/Makefile:58: *** multiple target patterns. Stop.
9make[5]: *** [usr] Error 2
10
11Fix it by removing such filenames from the
12deps_initramfs list.
13
14Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
15---
16 usr/Makefile | 8 +++++---
17 1 file changed, 5 insertions(+), 3 deletions(-)
18
19--- a/usr/Makefile
20+++ b/usr/Makefile
21@@ -42,21 +42,23 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y)
22 include $(obj)/$(datafile_d_y)
23 endif
24
25+deps_initramfs_sane := $(foreach v,$(deps_initramfs),$(if $(findstring :,$(v)),,$(v)))
26+
27 quiet_cmd_initfs = GEN $@
28 cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
29
30 targets := $(datafile_y)
31
32 # do not try to update files included in initramfs
33-$(deps_initramfs): ;
34+$(deps_initramfs_sane): ;
35
36-$(deps_initramfs): klibcdirs
37+$(deps_initramfs_sane): klibcdirs
38 # We rebuild initramfs_data.cpio if:
39 # 1) Any included file is newer than initramfs_data.cpio
40 # 2) There are changes in which files are included (added or deleted)
41 # 3) If gen_init_cpio are newer than initramfs_data.cpio
42 # 4) Arguments to gen_initramfs.sh changes
43-$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
44+$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs_sane) klibcdirs
45 $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/$(datafile_d_y)
46 $(call if_changed,initfs)
47