All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 4/8] boot/arm-trusted-firmware: support alternate image files
Date: Wed, 20 Mar 2019 23:03:24 +0100	[thread overview]
Message-ID: <20190320230324.23023b9b@windsurf> (raw)
In-Reply-To: <1552951269-16967-4-git-send-email-etienne.carriere@linaro.org>

Hello Etienne,

On Tue, 19 Mar 2019 00:21:05 +0100
Etienne Carriere <etienne.carriere@linaro.org> wrote:

> Some platform may generate specific boot image files instead of
> the generic files *.bin  when building TF-A package. This change
> introduces new configuration directive for the arm-trusted-firmware
> boot package.
> 
> BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_IMAGE_NAMES is boolean.
> When disabled, install boot image files are .../*.bin.
> When enabled, BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL_IMAGE_NAMES shall
> lists the names of the generated boot image files.
> 
> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

I think this is more complicated than it needs to be. See an alternate
proposal below.

> +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_IMAGE_NAMES
> +	bool "Use custom binary boot image filenames"
> +	help
> +	  If not set, build generates the boot image files with the
> +	  generic filename that is images with .bin extension. These
> +	  are copied to the output images/ directory.
> +
> +	  If enabled, use BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL_IMAGES
> +	  to list the generated file names.
> +
> +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL_IMAGE_NAMES
> +	string "Binary boot image filenames"
> +	depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_IMAGE_NAMES
> +	help
> +	  This is used when TF-A platform generates boot image files
> +	  with custom file names. When so, this should list the path
> +	  of the generated files location relatively to the package
> +	  build root directory. These files are copied to the output
> +	  images/ directory.

Just one new option:

config BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGE_NAMES
	string "Image names"
	default "*.bin"
	help
	  ...
> +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_IMAGE_NAMES),y)
> +define ARM_TRUSTED_FIRMWARE_BL_IMAGES_INSTALL
> +	$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL_IMAGE_NAMES)), \
> +		cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/ \
> +	)
> +endef
> +else
> +define ARM_TRUSTED_FIRMWARE_BL_IMAGES_INSTALL
> +	cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/
> +endef
> +endif

And then just:

ARM_TRUSTED_FIRMWARE_IMAGE_NAMES = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGE_NAMES))

define ARM_TRUSTED_FIRMWARE_BL_IMAGES_INSTALL
	$(foreach f,$(wildcard $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(ARM_TRUSTED_FIRMWARE_IMAGE_NAMES)), \
		$(INSTALL) -D -m 0644 $(f) $(BINARIES_DIR)/$(notdir $(f))
	)
endef

(totally untested of course)

Could you try something like this ?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-03-20 22:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 23:21 [Buildroot] [PATCH v2 1/8] boot/arm-trusted-firmware: support 32bit Arm targets Etienne Carriere
2019-03-18 23:21 ` [Buildroot] [PATCH v2 2/8] boot/arm-trusted-firmware: in-tree and OP-TEE BL32 Etienne Carriere
2019-03-20 21:54   ` Thomas Petazzoni
2019-03-18 23:21 ` [Buildroot] [PATCH v2 3/8] boot/arm-trusted-firmware: support debug mode Etienne Carriere
2019-03-20 21:59   ` Thomas Petazzoni
2019-03-18 23:21 ` [Buildroot] [PATCH v2 4/8] boot/arm-trusted-firmware: support alternate image files Etienne Carriere
2019-03-20 22:03   ` Thomas Petazzoni [this message]
2019-03-21  8:06     ` Etienne Carriere
2019-03-18 23:21 ` [Buildroot] [PATCH v2 5/8] package/optee-test: fix dependency in TAs build Etienne Carriere
2019-03-20 22:03   ` Thomas Petazzoni
2019-03-18 23:21 ` [Buildroot] [PATCH v2 6/8] configs/qemu_armv7a_tz_virt: Armv7-A emulation with TrustZone services Etienne Carriere
2019-03-19 22:00   ` Arnout Vandecappelle
2019-03-20  8:49     ` Etienne Carriere
2019-03-20  9:20       ` Arnout Vandecappelle
2019-03-20 12:06         ` Etienne Carriere
2019-03-18 23:21 ` [Buildroot] [PATCH v2 7/8] testing: test can use the locally generated qemu host tool Etienne Carriere
2019-03-19  7:05   ` Etienne Carriere
2019-03-19 22:03     ` Arnout Vandecappelle
2019-03-22 10:06       ` Etienne Carriere
2019-03-18 23:21 ` [Buildroot] [PATCH v2 8/8] support/testing: test_optee.py: test optee boot and testsuite Etienne Carriere
2019-03-20 21:34 ` [Buildroot] [PATCH v2 1/8] boot/arm-trusted-firmware: support 32bit Arm targets Thomas Petazzoni

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=20190320230324.23023b9b@windsurf \
    --to=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.