[Buildroot] [PATCH v2] Add support for Flattened Image Trees

Thomas De Schampheleire patrickdepinguin at gmail.com
Fri Sep 19 09:19:28 UTC 2014


On Fri, Sep 19, 2014 at 10:37 AM, Yegor Yefremov
<yegorslists at googlemail.com> wrote:

>
> Something like this?
>
> ################################################################################
> #
> # Build the FIT image
> #
> ################################################################################
>
> ROOTFS_FIT_DEPENDENCIES = host-uboot-tools
>
> ifeq ($(BR2_FIT_INSTALL_TARGET),y)
> define FIT_INSTALL_ITB_TARGET
>         mkdir -p $(TARGET_DIR)/boot/ && \
>         cp $(BINARIES_DIR)/$(basename $(notdir $(call
> qstrip,$(BR2_FIT_PATH)))).itb $(TARGET_DIR)/boot/
> endef
> else
> define FIT_INSTALL_ITB_TARGET
>         true
> endef
> endif
>
> define ROOTFS_FIT_CMD
>         cp $(BR2_FIT_PATH) $(BINARIES_DIR) && \
>         $(HOST_DIR)/usr/bin/mkimage -f $(BINARIES_DIR)/$(notdir $(call
> qstrip,$(BR2_FIT_PATH))) $(BINARIES_DIR)/$(basename $(notdir $(call
> qstrip,$(BR2_FIT_PATH)))).itb && \
>         $(FIT_INSTALL_ITB_TARGET)
> endef
>
> $(eval $(call ROOTFS_TARGET,fit))

Yes, exactly.

I don't yet see, as ThomasP also noticed, how this would work for
multiple files. I think you will need a foreach statement here and
there.

Regarding the automatic calculation of the .itb file, if multiple its
files are supported, one possible problem is where a user specifies
two .its files with the same name but in a separate directory. For
example

BR2_FIT_PATH="/tmp/foo/project.its /tmp/bar/project.its"

In this case, the .itb name will be calculated as
$(BINARIES_DIR)/project.itb for both source files.
Since handling this is not trivial in a common way, I would propose to
not handle it and document it in the help text as a limitation.

Regarding the implementation: I think it'd be more clear to calculate
the final ITS and ITB values (so after qstrip, basename,  etc.) in a
separate variable, so that the commands are easy to read and there is
less duplication.

Best regards,
Thomas


More information about the buildroot mailing list