image: add support for building FIT image with filesystem
[openwrt/openwrt.git] / include / image-commands.mk
index 51e745958e627a739fdb809ffbdee9216157527f..3377680a0715f4301d47599b366d49285c243e22 100644 (file)
@@ -200,11 +200,13 @@ define Build/fit
        $(TOPDIR)/scripts/mkits.sh \
                -D $(DEVICE_NAME) -o $@.its -k $@ \
                $(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
+               $(if $(findstring with-rootfs,$(word 3,$(1))),-r $(IMAGE_ROOTFS)) \
                -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
                $(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
                -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
                -A $(LINUX_KARCH) -v $(LINUX_VERSION)
-       PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+       PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
+               -E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new
        @mv $@.new $@
 endef