All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>, buildroot@buildroot.org
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] [PATCH 2/4] package/pkg-kconfig: generate generic help
Date: Sun, 25 Jul 2021 15:19:52 +0200	[thread overview]
Message-ID: <b9986991-db3a-1292-ee1a-073bdb3d04bc@mind.be> (raw)
In-Reply-To: <44391e27e560d7d2de2a444577d867920d4c35a5.1627161553.git.yann.morin.1998@free.fr>



On 24/07/2021 23:19, Yann E. MORIN wrote:
> Currently, as Thomas pointed out [0], the help for kconfig packages is
> not consistently used and handled by the different packages.
> 
> This commit introduces a generic help text for kconfig packages, that is
> based on what the package declares:
> 
>   - the list of kconfig editors it supports;
> 
>   - whether it is possible to save back the configuration (impossible if
>     the package uses an in-tree defconfig file);
> 
>   - whether the package actually supports (loading and saving) defconfig
>     files, by introducing a new variable a package can set if it does
>     not (only busybox is known to be in that case).
> 
> That new help helper is only used if the package does not already define
> its own help, to be consistent with what we do for other _CMDS.
> 
> [0] http://lists.busybox.net/pipermail/buildroot/2021-July/313570.html
> 
> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
> ---
>  docs/manual/adding-packages-kconfig.txt |  3 +++
>  package/pkg-kconfig.mk                  | 24 ++++++++++++++++++++++++
>  2 files changed, 27 insertions(+)
> 
> diff --git a/docs/manual/adding-packages-kconfig.txt b/docs/manual/adding-packages-kconfig.txt
> index 8f40ea6099..a35681775f 100644
> --- a/docs/manual/adding-packages-kconfig.txt
> +++ b/docs/manual/adding-packages-kconfig.txt
> @@ -91,3 +91,6 @@ be set to suit the needs of the package under consideration:
>  * +FOO_KCONFIG_DEPENDENCIES+: the list of packages (most probably, host
>    packages) that need to be built before this package's kconfig is
>    interpreted. Seldom used. By default, empty.
> +
> +* +FOO_KCONFIG_SUPPORTS_DEFCONFIG+: whether the package's kconfig system
> +  supports using defconfig files; few packages do not. By default, 'YES'.
> diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
> index 49074f9220..715c3e04ec 100644
> --- a/package/pkg-kconfig.mk
> +++ b/package/pkg-kconfig.mk
> @@ -85,11 +85,35 @@ $(2)_KCONFIG_OPTS ?=
>  $(2)_KCONFIG_FIXUP_CMDS ?=
>  $(2)_KCONFIG_FRAGMENT_FILES ?=
>  $(2)_KCONFIG_DOTCONFIG ?= .config
> +$(2)_KCONFIG_SUPPORTS_DEFCONFIG ?= YES
>  
>  # Register the kconfig dependencies as regular dependencies, so that
>  # they are also accounted for in the generated graphs.
>  $(2)_DEPENDENCIES += $$($(2)_KCONFIG_DEPENDENCIES)
>  
> +# Generate the kconfig-related help: one entry for each editor.
> +# Additionally, if the package is *not* using an in-tree defconfig
> +# name, an entry for updating the package configuration file.
> +ifndef $(2)_HELP_CMDS
> +define $(2)_HELP_CMDS
> +	$$(foreach editor, $$($(2)_KCONFIG_EDITORS), \
> +		@printf '  %-22s - Run %s %s\n' $(1)-$$(editor) $(1) $$(editor)
> +	)
> +	$$(if $$($(2)_KCONFIG_DEFCONFIG),,\

 We should probably also simply remove the -update-config and -update-defconfig
rules when _KCONFIG_DEFCONFIG is set. There's currently a condition for that in
kconfig-package-update-config, but it's better to just not have the option at
all. I may cook a patch for that.

> +		$$(if $$(filter YES,$$($(2)_KCONFIG_SUPPORTS_DEFCONFIG)),\


 Now we have this variable, it would make sense to also make $(1)-savedefconfig
and $(1)-update-defconfig depend on it. I may cook a patch to do exactly that.



 Regards,
 Arnout


> +			@printf '  %-22s - Save the %s configuration as a defconfig file\n' \
> +				$(1)-update-defconfig $(1)
> +			@printf '  %-22s     to %s\n' '' $$($(2)_KCONFIG_FILE)
> +			@printf '  %-22s     (or override with %s_KCONFIG_FILE)\n' '' $(2)
> +		)
> +		@printf '  %-22s - Save the %s configuration as a full .config file\n' \
> +			$(1)-update-config $(1)
> +		@printf '  %-22s     to %s\n' '' $$($(2)_KCONFIG_FILE)
> +		@printf '  %-22s     (or override with %s_KCONFIG_FILE)\n' '' $(2)
> +	)
> +endef
> +endif
> +
>  # Call the generic package infrastructure to generate the necessary
>  # make targets.
>  # Note: this must be done _before_ attempting to use $$($(2)_DIR) in a
> 
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

  reply	other threads:[~2021-07-25 13:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-24 21:19 [Buildroot] [PATCH 0/4] package/pkg-kconfig: introduce generic help (branch yem/kconfig-help) Yann E. MORIN
2021-07-24 21:19 ` [Buildroot] [PATCH 1/4] package/pkg-kconfig: move defaults before calling pkg-generic Yann E. MORIN
2021-07-24 21:19 ` [Buildroot] [PATCH 2/4] package/pkg-kconfig: generate generic help Yann E. MORIN
2021-07-25 13:19   ` Arnout Vandecappelle [this message]
2021-07-24 21:19 ` [Buildroot] [PATCH 3/4] package: use the generic _HELP_CMDS for kconfig-based packages Yann E. MORIN
2021-07-24 21:19 ` [Buildroot] [PATCH 4/4] package/uclibc: add nconfig as a kconfig editor Yann E. MORIN
2021-08-05 10:03   ` Peter Korsgaard
2021-07-25 13:21 ` [Buildroot] [PATCH 0/4] package/pkg-kconfig: introduce generic help (branch yem/kconfig-help) Arnout Vandecappelle

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=b9986991-db3a-1292-ee1a-073bdb3d04bc@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@buildroot.org \
    --cc=patrickdepinguin@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /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.