All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/mbedtls: custom configuration file
Date: Sun, 4 Oct 2020 21:43:21 +0200	[thread overview]
Message-ID: <20201004194321.GL11621@scaer> (raw)
In-Reply-To: <CAFfn7UnFz=5Da91iWqwyE9m6VWpiOUsstGWe4mp3FpgE==UQ7w@mail.gmail.com>

Pieter, All,

On 2020-10-02 09:16 +0200, Pieter De Gendt spake thusly:
> On Thu, Oct 1, 2020 at 9:31 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > On 2020-10-01 09:29 +0200, Pieter De Gendt spake thusly:
> > > Applying tweaks on the custom config also feels a bit awkward, since
> > > you already
> > > took the effort of creating the custom config and the "sed" commands might not
> > > even apply.
> > But that is what we are doing with the user-provided configuration files
> > for:
> >   - uClibc-ng
> >   - the linux kernel
> >   - busybox
> >   - uboot
> >   - and probably a few others as well...
[--SNIP--]
> The packages you list have a kconfig provided by the package itself,
> for mbedtls it's
> simply a header file. Do you suggest adding this, and maintaining it
> within buildroot?

What I suggest, and what I think Thomas would also suggest, is that the
user-supplied configuration file is copied over the one bundled in the
mbedtls source tree, then our tweaks are applied.

If the user does not supply any configuration file, we do as we do
today.

Basically, tht would be that patch (mbedtls.mk only):

    diff --git a/package/mbedtls/mbedtls.mk b/package/mbedtls/mbedtls.mk
    index 5094434e6c..487fe9a310 100644
    --- a/package/mbedtls/mbedtls.mk
    +++ b/package/mbedtls/mbedtls.mk
    @@ -13,6 +13,14 @@ MBEDTLS_INSTALL_STAGING = YES
     MBEDTLS_LICENSE = Apache-2.0
     MBEDTLS_LICENSE_FILES = apache-2.0.txt
     
    +MBEDTLS_CONFIG_H = $(call qstrip,$(BR2_PACKAGE_MBEDTLS_CONFIG_H))
    +ifneq ($(MBEDTLS_CONFIG_H),)
    +define MBEDTLS_INSTALL_CONFIG_H
    +	cp $(MBEDTLS_INSTALL_CONFIG_H) $(@D)/include/mbedtls/config.h
    +endef
    +MBEDTLS_POST_PATCH_HOOKS += MBEDTLS_INSTALL_CONFIG_H
    +endif
    +
     # This is mandatory for hiawatha
     ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
     define MBEDTLS_ENABLE_THREADING

Note however, that mbedtls uses a mix of _POST_PATCH and _POST_CONFIGURE
hooks to tweak config.h; this is not very sound. Instead, they should all
be switched over to using _POST_CONFIGURE hooks, except for hte copy of
the user supplied file, which should stay a post-patch hook.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

      reply	other threads:[~2020-10-04 19:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28  9:29 [Buildroot] [PATCH 1/1] package/mbedtls: custom configuration file Pieter De Gendt
2020-09-30 19:57 ` Thomas Petazzoni
2020-10-01  7:29   ` Pieter De Gendt
2020-10-01 19:31     ` Yann E. MORIN
2020-10-02  7:16       ` Pieter De Gendt
2020-10-04 19:43         ` Yann E. MORIN [this message]

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=20201004194321.GL11621@scaer \
    --to=yann.morin.1998@free.fr \
    --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.