image-legacy.mk 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/Profile,$(1),$(2))
  46. endef
  47. else
  48. Image/Build/Profile/Filesystem = $(Image/Build/Profile)
  49. endif
  50. define LegacyDevice/Build
  51. $$(_TARGET): legacy-image-$(1)
  52. $$(_TARGET_PREPARE): legacy-image-prepare-$(1)
  53. .PHONY: legacy-image-prepare-$(1) legacy-image-$(1)
  54. legacy-image-prepare-$(1):
  55. $$(call Image/Prepare/Profile,$(1))
  56. ifndef IB
  57. ifdef CONFIG_TARGET_PER_DEVICE_ROOTFS
  58. ROOTFS/$(1) := $(foreach fs,$(TARGET_FILESYSTEMS), \
  59. $(KDIR)/root.$(fs)$$(strip $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),+pkg=$$(ROOTFS_ID/$(1)))) \
  60. )
  61. $$(ROOTFS/$(1)): target-dir-$$(ROOTFS_ID/$(1))
  62. legacy-images-make: $$(if $$(_PROFILE_SET),$$(ROOTFS/$(1)))
  63. endif
  64. endif
  65. legacy-image-$(1):
  66. $$(call Image/BuildKernel/Profile,$(1))
  67. $(foreach fs,$(TARGET_FILESYSTEMS),
  68. $$(call Image/Build/Profile/Filesystem,$(1),$(fs),$$(ROOTFS_ID/$(1)))
  69. )
  70. endef
  71. define LegacyDevice
  72. $(call Device/InitProfile,$(1))
  73. $(call Device/Default,$(1))
  74. $(call LegacyDevice/Default,$(1))
  75. $(call LegacyDevice/$(1),$(1))
  76. $(call LegacyDevice/Check,$(1))
  77. $(call LegacyDevice/$(if $(DUMP),Dump,Build),$(1))
  78. endef