240-remove-unsane-filenames-from-deps_initramfs-list.patch 1.5 KB

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