1
0

image-legacy.mk 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),)
  2. define Image/mkfs/ubifs/generate
  3. $(CP) ./ubinize$(1).cfg $(KDIR)
  4. ( cd $(KDIR); \
  5. $(STAGING_DIR_HOST)/bin/ubinize \
  6. $(if $($(PROFILE)_UBI_OPTS),$($(PROFILE)_UBI_OPTS),$(shell echo $(UBI_OPTS))) \
  7. -o $(KDIR)/root$(1).ubi \
  8. ubinize$(1).cfg \
  9. )
  10. endef
  11. define Image/mkfs/ubifs/legacy
  12. $(if $($(PROFILE)_UBIFS_OPTS)$(UBIFS_OPTS),
  13. $(STAGING_DIR_HOST)/bin/mkfs.ubifs \
  14. $(if $($(PROFILE)_UBIFS_OPTS),$($(PROFILE)_UBIFS_OPTS),$(UBIFS_OPTS)) \
  15. $(if $(CONFIG_TARGET_UBIFS_FREE_SPACE_FIXUP),--space-fixup) \
  16. $(if $(CONFIG_TARGET_UBIFS_COMPRESSION_NONE),--compr=none) \
  17. $(if $(CONFIG_TARGET_UBIFS_COMPRESSION_LZO),--compr=lzo) \
  18. $(if $(CONFIG_TARGET_UBIFS_COMPRESSION_ZLIB),--compr=zlib) \
  19. $(if $(shell echo $(CONFIG_TARGET_UBIFS_JOURNAL_SIZE)),--jrn-size=$(CONFIG_TARGET_UBIFS_JOURNAL_SIZE)) \
  20. --squash-uids \
  21. -o $(KDIR)/root.ubifs \
  22. -d $(TARGET_DIR)
  23. )
  24. $(call Image/Build,ubifs)
  25. $(if $($(PROFILE)_UBI_OPTS)$(UBI_OPTS),
  26. $(if $(wildcard ./ubinize.cfg),$(call Image/mkfs/ubifs/generate,))
  27. $(if $(wildcard ./ubinize-overlay.cfg),$(call Image/mkfs/ubifs/generate,-overlay))
  28. )
  29. $(if $(wildcard ./ubinize.cfg),$(call Image/Build,ubi))
  30. endef
  31. endif
  32. LegacyDevice/Dump = $(Device/Dump)
  33. define LegacyDevice/Check
  34. $(Device/Check/Common)
  35. _TARGET_PREPARE := $$(if $$(_PROFILE_SET),legacy-images-prepare,prepare-disabled)
  36. _TARGET := $$(if $$(_PROFILE_SET),legacy-images,install-disabled)
  37. $$(if $$(_PROFILE_SET),install: legacy-images-make)
  38. ifndef IB
  39. $$(if $$(_PROFILE_SET),kernel_prepare: legacy-images-prepare-make)
  40. endif
  41. endef
  42. ifdef TARGET_PER_DEVICE_ROOTFS
  43. define Image/Build/Profile/Filesystem
  44. cp $(KDIR)/root.$(2)+pkg=$(3) $(KDIR)/root.$(2)
  45. $(call Image/Build/$(2),$(2))
  46. $(call Image/Build/Profile,$(1),$(2))
  47. endef
  48. else
  49. Image/Build/Profile/Filesystem = $(Image/Build/Profile)
  50. endif
  51. define LegacyDevice/Build
  52. $$(_TARGET): legacy-image-$(1)
  53. $$(_TARGET_PREPARE): legacy-image-prepare-$(1)
  54. .PHONY: legacy-image-prepare-$(1) legacy-image-$(1)
  55. legacy-image-prepare-$(1):
  56. $$(call Image/Prepare/Profile,$(1))
  57. ifndef IB
  58. ifdef CONFIG_TARGET_PER_DEVICE_ROOTFS
  59. ROOTFS/$(1) := $(foreach fs,$(TARGET_FILESYSTEMS), \
  60. $(KDIR)/root.$(fs)$$(strip $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),+pkg=$$(ROOTFS_ID/$(1)))) \
  61. )
  62. $$(ROOTFS/$(1)): target-dir-$$(ROOTFS_ID/$(1))
  63. legacy-images-make: $$(if $$(_PROFILE_SET),$$(ROOTFS/$(1)))
  64. endif
  65. endif
  66. legacy-image-$(1):
  67. $$(call Image/BuildKernel/Profile,$(1))
  68. $(foreach fs,$(TARGET_FILESYSTEMS),
  69. $$(call Image/Build/Profile/Filesystem,$(1),$(fs),$$(ROOTFS_ID/$(1)))
  70. )
  71. endef
  72. define LegacyDevice
  73. $(call Device/InitProfile,$(1))
  74. $(call Device/Default,$(1))
  75. $(call LegacyDevice/Default,$(1))
  76. $(call LegacyDevice/$(1),$(1))
  77. $(call LegacyDevice/Check,$(1))
  78. $(call LegacyDevice/$(if $(DUMP),Dump,Build),$(1))
  79. endef