From: Roland Hieber <rhi@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Maik Otto <m.otto@phytec.de>, barebox@lists.infradead.org
Subject: Re: [PATCH v3 4/4] Makefile: add creation of signed/encrypted images for imx6, imx7, imx8
Date: Mon, 5 Aug 2019 14:35:40 +0200 [thread overview]
Message-ID: <20190805123540.44he42heamdwr7en@pengutronix.de> (raw)
In-Reply-To: <20190805110213.pfqdnyeecyc3rhmq@pengutronix.de>
On Mon, Aug 05, 2019 at 01:02:13PM +0200, Sascha Hauer wrote:
> Hi Maik,
>
> On Thu, Jul 18, 2019 at 10:02:01AM +0200, Maik Otto wrote:
> > add in the images/Makefile.imx the support of building for signed, usb
> > signed and encrypted/signed images for NXP i.MX HABV4
> > support for NXP i.mx6, i.mx7 and i.mx8
> >
> > Signed-off-by: Maik Otto <m.otto@phytec.de>
> > ---
> > Changes in v3:
> > - nothing
> > Changes in v2:
> > - was Patch 2/4 in v1
> > - no dynamic variable, parallel building of different image types now
> > ---
> > images/Makefile.imx | 322 +++++++++++++++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 321 insertions(+), 1 deletion(-)
> >
> > diff --git a/images/Makefile.imx b/images/Makefile.imx
> > index 9a7187a..9c70703 100644
> > --- a/images/Makefile.imx
> > +++ b/images/Makefile.imx
> > @@ -147,216 +147,388 @@ pblb-$(CONFIG_MACH_REALQ7) += start_imx6_realq7
> > CFG_start_imx6_realq7.pblb.imximg = $(board)/datamodul-edm-qmx6/flash-header.imxcfg
> > FILE_barebox-datamodul-edm-qmx6.img = start_imx6_realq7.pblb.imximg
> > image-$(CONFIG_MACH_REALQ7) += barebox-datamodul-edm-qmx6.img
> > +FILE_barebox-datamodul-edm-qmx6-s.img = start_imx6_realq7.pblb.simximg
> > +FILE_barebox-datamodul-edm-qmx6-us.img = start_imx6_realq7.pblb.usimximg
> > +FILE_barebox-datamodul-edm-qmx6-es.img = start_imx6_realq7.pblb.esimximg
> > +habv4image-$(CONFIG_MACH_REALQ7) += barebox-datamodul-edm-qmx6
>
> This file contains way to much boilerplate already for my taste. Adding four
> more lines for every board is not something I like to do.
>
> Can we add even more magic to get rid of these additional lines?
You mean like... (untested)
----------------- 8< -----------------
# params: CONFIG symbol, entry point, board identifier string
define build_imx_img =
pblb-$($(1)) += $(2)
CFG_$(2).pblb.imximg = $(board)/$(3)/flash-header.imxcfg
FILE_barebox-$(3).img = $(2).pblb.imximg
FILE_barebox-$(3)-s.img = $(2).pblb.simximg
FILE_barebox-$(3)-us.img = $(2).pblb.usimximg
FILE_barebox-$(3)-es.img = $(2).pblb.esimximg
image-$($(1)) += barebox-$(3).img
habv4image-$($(1)) += barebox-$(3)
endef
# [...]
$(call build_imx_img, CONFIG_MACH_REALQ7, start_imx6_realq, datamodul-edm-qmx6)
$(call build_imx_img, CONFIG_MACH_GUF_SANTARO, start_imx6q_guf_santaro, guf-santaro)
$(call build_imx_img, CONFIG_MACH_GK802, start_imx6_gk802, gk802)
$(call build_imx_img, CONFIG_MACH_TQMA6X, start_imx6dl_mba6x, tqma6x)
# [...]
----------------- >8 -----------------
We could also go further and only use the "board identifier" to
determine the CONFIG_MACH_* symbol and the name of the entry point, but
this would probably mean refactoring a lot of board code to conform to
the new scheme. Also I'm not sure whether we can just build *-us.img and
habv4image-$(CONFIG_*) unconditionally for every board. This looks like
another documentation patch opportunity... :-)
But the result seems much more readable to me.
- Roland
--
Roland Hieber | r.hieber@pengutronix.de |
Pengutronix e.K. | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-08-05 12:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-18 8:01 [PATCH v3 1/4] i.mx6: signed boot: add habv4-imx6-gencsf.h to the flash header of the PHYTEC boards Maik Otto
2019-07-18 8:01 ` [PATCH v3 2/4] imx6: added fit image signature to the devicetree for " Maik Otto
2019-07-18 8:02 ` [PATCH v3 3/4] Kconfig: add selection for creation of signed/encrypted HABV4 images Maik Otto
2019-07-18 8:02 ` [PATCH v3 4/4] Makefile: add creation of signed/encrypted images for imx6, imx7, imx8 Maik Otto
2019-08-05 11:02 ` Sascha Hauer
2019-08-05 12:35 ` Roland Hieber [this message]
2019-08-05 15:07 ` Roland Hieber
2019-08-15 14:14 ` Maik Otto
2019-08-19 8:28 ` Roland Hieber
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=20190805123540.44he42heamdwr7en@pengutronix.de \
--to=rhi@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=m.otto@phytec.de \
--cc=s.hauer@pengutronix.de \
/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