u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Samuel Holland <samuel@sholland.org>
Cc: Andre Przywara <andre.przywara@arm.com>,
	Alexandru Gagniuc <mr.nuke.me@gmail.com>,
	Stefan Roese <sr@denx.de>,
	u-boot@lists.denx.de
Subject: Re: [RFC PATCH] tools: kwbimage: Allow to disable compilation of kwbimage on non-mvebu platforms
Date: Fri, 22 Oct 2021 10:11:00 +0200	[thread overview]
Message-ID: <20211022081100.y2kokxttdhllw4sz@pali> (raw)
In-Reply-To: <f4660467-9d25-dc46-9e60-b2f7f09236c2@sholland.org>

Hello!

On Thursday 21 October 2021 20:48:22 Samuel Holland wrote:
> Hi,
> 
> Thanks for sending this patch!
> 
> On 10/21/21 4:33 AM, Pali Rohár wrote:
> > kwbimage depends on libcrypto. 32-bit mvebu platforms (except Orion and
> > Discovery, which are not in mach-mvebu) require kwimage for building SPL.
> > 
> > Some users want to compile u-boot tools without libcrypto.
> > 
> > Therefore add a new symbol CONFIG_TOOLS_KWBIMAGE which controls compilation
> > of kwbimage and define correct dependences between mvebu, kwbimage and
> > libcrypto targets.
> > 
> > This allows disabling of kwbimage compilation on non-mvebu platforms.
> > 
> > Signed-off-by: Pali Rohár <pali@kernel.org>
> > ---
> >  arch/arm/mach-mvebu/Kconfig | 1 +
> >  tools/Kconfig               | 5 +++++
> >  tools/Makefile              | 5 ++++-
> >  3 files changed, 10 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
> > index 54dff9986b41..1ccbccea1dda 100644
> > --- a/arch/arm/mach-mvebu/Kconfig
> > +++ b/arch/arm/mach-mvebu/Kconfig
> > @@ -15,6 +15,7 @@ config ARMADA_32BIT
> >  	select SPL_SIMPLE_BUS if SPL
> >  	select SUPPORT_SPL
> >  	select TRANSLATION_OFFSET
> > +	select TOOLS_KWBIMAGE if SPL
> >  
> >  config ARMADA_64BIT
> >  	bool
> > diff --git a/tools/Kconfig b/tools/Kconfig
> > index 91ce8ae3e516..40866c5713d9 100644
> > --- a/tools/Kconfig
> > +++ b/tools/Kconfig
> > @@ -25,6 +25,11 @@ config TOOLS_LIBCRYPTO
> >  	  This selection does not affect target features, such as runtime FIT
> >  	  signature verification.
> >  
> > +config TOOLS_KWBIMAGE
> > +	bool "Enable kwbimage support in host tools"
> > +	default y
> > +	depends on TOOLS_LIBCRYPTO
> 
> This symbol needs to select TOOLS_LIBCRYPTO. Otherwise that option can
> still be deselected by the user, and the build fails when doing so:

Yes, that it truth. But in case user does not have openssl installed
then it show another compile / link error.

And I do not know what is the better "user experience". If build system
should throw warnings (like below) about unmet dependences (user chose
something which cannot be satisfied by build system) with link errors.
Or if build system should silently enable openssl symbols, even when
they were explicitly disabled by user (via config file) and then throw
compile error about missing header files.

I do not have opinion which of these two option is better.

Of course changing "depends on" to "select" is not a problem.

> $ make CROSS_COMPILE=arm-linux-musleabi- db-mv784mp-gp_defconfig
> #
> # configuration written to .config
> #
> $ make CROSS_COMPILE=arm-linux-musleabi- nconfig
> scripts/kconfig/nconf  Kconfig
> $ make CROSS_COMPILE=arm-linux-musleabi-
> scripts/kconfig/conf  --syncconfig Kconfig
> 
> WARNING: unmet direct dependencies detected for TOOLS_KWBIMAGE
>   Depends on [n]: TOOLS_LIBCRYPTO [=n]
>   Selected by [y]:
>   - ARMADA_32BIT [=y] && ARM [=y] && ARCH_MVEBU [=y] && SPL [=y]
> 
> WARNING: unmet direct dependencies detected for TOOLS_KWBIMAGE
>   Depends on [n]: TOOLS_LIBCRYPTO [=n]
>   Selected by [y]:
>   - ARMADA_32BIT [=y] && ARM [=y] && ARCH_MVEBU [=y] && SPL [=y]
> 
> WARNING: unmet direct dependencies detected for TOOLS_KWBIMAGE
>   Depends on [n]: TOOLS_LIBCRYPTO [=n]
>   Selected by [y]:
>   - ARMADA_32BIT [=y] && ARM [=y] && ARCH_MVEBU [=y] && SPL [=y]

I known that these warning lines come from kconfig tools... But should
not they be rather fatal errors? As it indicates issues with
configuration.

>   CFG     u-boot.cfg
>   GEN     include/autoconf.mk.dep
>   CFG     spl/u-boot.cfg
>   GEN     include/autoconf.mk
>   GEN     spl/include/autoconf.mk
> ===================== WARNING ======================
> This board does not use CONFIG_DM_I2C (Driver Model
> for I2C drivers). Please update the board to use
> CONFIG_DM_I2C before the v2022.04 release. Failure to
> update by the deadline may result in board removal.
> See doc/driver-model/migration.rst for more info.
> ====================================================
>   CFGCHK  u-boot.cfg
>   HOSTLD  tools/dumpimage
>   HOSTLD  tools/mkimage
> ld: tools/kwbimage.o: in function `kwb_compute_pubkey_hash':
> kwbimage.c:(.text+0x1a00): undefined reference to `EVP_MD_CTX_new'
> ld: kwbimage.c:(.text+0x1a10): undefined reference to `EVP_MD_CTX_reset'
> ld: kwbimage.c:(.text+0x1a18): undefined reference to `EVP_sha256'
> [and more linker errors]
> 
> Regards,
> Samuel
> 
> > +
> >  config TOOLS_FIT
> >  	def_bool y
> >  	help
> > diff --git a/tools/Makefile b/tools/Makefile
> > index 75d8fe71d668..08f1f5a51fb3 100644
> > --- a/tools/Makefile
> > +++ b/tools/Makefile
> > @@ -118,7 +118,6 @@ dumpimage-mkimage-objs := aisimage.o \
> >  			imximage.o \
> >  			imx8image.o \
> >  			imx8mimage.o \
> > -			kwbimage.o \
> >  			lib/md5.o \
> >  			lpc32xximage.o \
> >  			mxsimage.o \
> > @@ -150,6 +149,10 @@ dumpimage-mkimage-objs := aisimage.o \
> >  			$(RSA_OBJS-y) \
> >  			$(AES_OBJS-y)
> >  
> > +ifdef CONFIG_TOOLS_KWBIMAGE
> > +dumpimage-mkimage-objs += kwbimage.o
> > +endif
> > +
> >  dumpimage-objs := $(dumpimage-mkimage-objs) dumpimage.o
> >  mkimage-objs   := $(dumpimage-mkimage-objs) mkimage.o
> >  fit_info-objs   := $(dumpimage-mkimage-objs) fit_info.o
> > 
> 

  reply	other threads:[~2021-10-22  8:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21  9:33 [RFC PATCH] tools: kwbimage: Allow to disable compilation of kwbimage on non-mvebu platforms Pali Rohár
2021-10-22  1:48 ` Samuel Holland
2021-10-22  8:11   ` Pali Rohár [this message]
2021-11-30 15:50 ` Alexander Dahl
2021-12-07 20:48   ` Pali Rohár
2021-11-30 16:06 ` Alexander Dahl
2022-06-27  7:53   ` Alexander Dahl
2022-06-27  8:00     ` Pali Rohár

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=20211022081100.y2kokxttdhllw4sz@pali \
    --to=pali@kernel.org \
    --cc=andre.przywara@arm.com \
    --cc=mr.nuke.me@gmail.com \
    --cc=samuel@sholland.org \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.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;
as well as URLs for NNTP newsgroup(s).