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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. @@ -53,6 +53,8 @@ ifneq ($(wildcard $(obj)/.initramfs_data
  17. include $(obj)/.initramfs_data.cpio.d
  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. @@ -61,14 +63,14 @@ targets := initramfs_data.cpio.gz initra
  24. initramfs_data.cpio.lzo initramfs_data.cpio.lz4 \
  25. initramfs_data.cpio
  26. # do not try to update files included in initramfs
  27. -$(deps_initramfs): ;
  28. +$(deps_initramfs_sane): ;
  29. -$(deps_initramfs): klibcdirs
  30. +$(deps_initramfs_sane): klibcdirs
  31. # We rebuild initramfs_data.cpio if:
  32. # 1) Any included file is newer then initramfs_data.cpio
  33. # 2) There are changes in which files are included (added or deleted)
  34. # 3) If gen_init_cpio are newer than initramfs_data.cpio
  35. # 4) arguments to gen_initramfs.sh changes
  36. -$(obj)/initramfs_data.cpio$(suffix_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
  37. +$(obj)/initramfs_data.cpio$(suffix_y): $(obj)/gen_init_cpio $(deps_initramfs_sane) klibcdirs
  38. $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.d
  39. $(call if_changed,initfs)