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

Yegor Yefremov yegorslists at googlemail.com
Fri Sep 19 11:02:05 UTC 2014


On Fri, Sep 19, 2014 at 12:00 PM, Thomas Petazzoni
<thomas.petazzoni at free-electrons.com> wrote:
> Dear Thomas De Schampheleire,
>
> On Fri, 19 Sep 2014 11:19:28 +0200, Thomas De Schampheleire wrote:
>
>> 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.
>
> I think that's exactly what I did in the prototype code I sent to
> Yegor, but apparently, he didn't use it...

I think I drunk not enough coffee today :-) I've added foreach, but
haven't tested it with multiple source files. Will integrate your
example too. I must deal with some real life stuff today, so I'll
answer all questions next week. Thanks for helping.

################################################################################
#
# Build the FIT image
#
################################################################################

ROOTFS_FIT_DEPENDENCIES = host-uboot-tools

FIT_SRCS = $(BINARIES_DIR)/$(notdir $(call qstrip,$(BR2_FIT_PATH)))
FIT_BLOBS = $(BINARIES_DIR)/$(basename $(notdir $(call
qstrip,$(BR2_FIT_PATH)))).itb

ifeq ($(BR2_FIT_INSTALL_TARGET),y)
define FIT_INSTALL_ITB_TARGET
        mkdir -p $(TARGET_DIR)/boot/ && \
        cp $(FIT_BLOBS) $(TARGET_DIR)/boot/
endef
else
define FIT_INSTALL_ITB_TARGET
        true
endef
endif

define ROOTFS_FIT_CMD
        cp $(BR2_FIT_PATH) $(BINARIES_DIR) && \
        $(foreach its,$(FIT_SRCS),$(HOST_DIR)/usr/bin/mkimage -f
$(its) $(basename $(its)).itb) && \
        $(FIT_INSTALL_ITB_TARGET)
endef

$(eval $(call ROOTFS_TARGET,fit))

Yegor


More information about the buildroot mailing list