Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3] Add support for Flattened Image Trees
Date: Thu, 18 Sep 2014 22:44:43 +0200	[thread overview]
Message-ID: <20140918224443.63a559eb@free-electrons.com> (raw)
In-Reply-To: <1411071224-5386-1-git-send-email-yegorslists@googlemail.com>

Dear Yegor Yefremov,

On Thu, 18 Sep 2014 22:13:44 +0200, Yegor Yefremov wrote:

> +config BR2_FIT_PATH
> +	string "Flattened Image Tree source file path"
> +	help
> +	  Path to the image tree source files.

Which files will typically be listed here? Apparently your code assumes
those files must all be located in $(BINARIES_DIR), right? If that's
the case, it should be mentioned here.

Also, I'm worried about ordering: there is no ordering guarantee
between filesystem image types. So if your FIT filesystem image logic
depends on another filesystem image to be generated, this might be an
issue.

Also you say "files" in the description, but your code doesn't seem to
handle multiple "files". Can you explain?

> +ifeq ($(BR2_FIT_INSTALL_TARGET),y)
> +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 && \
> +	mkdir -p $(TARGET_DIR)/boot/ && \
> +	cp $(BINARIES_DIR)/$(basename $(notdir $(call qstrip,$(BR2_FIT_PATH)))).itb $(TARGET_DIR)/boot/
> +endef
> +else
> +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
> +endef
> +endif

Avoid duplication:

ROOTFS_FIT_FILE = $(BINARIES_DIR)/$(notdir $(call qstrip,$(BR2_FIT_PATH)))
ROOTFS_FIT_ITB_PATH = $(ROOTFS_FIT_FILE).itb

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

define ROOTFS_FIT_CMD
	cp $(BR2_FIT_PATH) $(BINARIES_DIR) && \
	$(HOST_DIR)/usr/bin/mkimage -f $(ROOTFS_FILE_FILE) $(ROOTFS_FIT_ITB_PATH) && \
	$(ROOTFS_FIT_INSTALL_TARGET)
endef

But maybe we should change the ROOTFS_TARGET infrastructure to support
multiple commands. There's also maybe the ROOTFS_xyz_POST_TARGETS
mechanism that could be used (I haven't looked whether it applies
properly here).

Can you give an example for the various Config.in options, so that
others could test this and understand better how it's typically used?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-09-18 20:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 20:13 [Buildroot] [PATCH v3] Add support for Flattened Image Trees Yegor Yefremov
2014-09-18 20:44 ` Thomas Petazzoni [this message]
2014-09-22 12:56   ` Yegor Yefremov
2014-09-21  6:46 ` Baruch Siach
2014-09-22 12:34   ` Yegor Yefremov
2014-09-22 12:45     ` [Buildroot] [PATCH v4] " Yegor Yefremov
2014-09-22 13:00       ` Yegor Yefremov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140918224443.63a559eb@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox