All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages
@ 2021-07-03 19:39 Thomas Petazzoni
  2021-07-03 19:40 ` [Buildroot] [PATCH 2/2] Makefile: document the <pkg>-reinstall target Thomas Petazzoni
  2021-07-04  8:05 ` [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages Yann E. MORIN
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2021-07-03 19:39 UTC (permalink / raw)
  To: buildroot

The <pkg>_HELP_CMDS variable allows packages using the kconfig-package
infrastructure to display their specific targets related to the
handling of their configuration.

However, it was not consistently used and handled by the different
packages. This commit makes sure all packages using kconfig-package
have that help text, and that is does reflect which targets are
available/usable.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 boot/at91bootstrap3/at91bootstrap3.mk      | 9 +++++++++
 boot/barebox/barebox/barebox.mk            | 8 ++++++--
 boot/uboot/uboot.mk                        | 4 +++-
 linux/linux.mk                             | 4 +++-
 package/busybox/busybox.mk                 | 2 ++
 package/linux-backports/linux-backports.mk | 9 +++++++++
 package/swupdate/swupdate.mk               | 9 +++++++++
 package/uclibc/uclibc.mk                   | 7 ++++++-
 package/xvisor/xvisor.mk                   | 9 +++++++++
 9 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/boot/at91bootstrap3/at91bootstrap3.mk b/boot/at91bootstrap3/at91bootstrap3.mk
index b253129dfb..0bf401953f 100644
--- a/boot/at91bootstrap3/at91bootstrap3.mk
+++ b/boot/at91bootstrap3/at91bootstrap3.mk
@@ -61,6 +61,15 @@ endif
 AT91BOOTSTRAP3_KCONFIG_EDITORS = menuconfig xconfig gconfig
 AT91BOOTSTRAP3_KCONFIG_OPTS = $(AT91BOOTSTRAP3_MAKE_OPTS)
 
+define AT91BOOTSTRAP3_HELP_CMDS
+	@echo '  at91bootstrap3-menuconfig       - Run At91bootstrap3 kernel menuconfig'
+	@echo '  at91bootstrap3-savedefconfig    - Run At91bootstrap3 kernel savedefconfig'
+	@echo '  at91bootstrap3-update-defconfig - Save the At91bootstrap3 configuration to the path specified'
+	@echo '                                      by BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE, as a defconfig'
+	@echo '  at91bootstrap3-update-config    - Save the At91bootstrap3 configuration to the path specified'
+	@echo '                                      by BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE, as a full .config'
+endef
+
 # Checks to give errors that the user can understand
 # Must be before we call to kconfig-package
 ifeq ($(BR_BUILDING),y)
diff --git a/boot/barebox/barebox/barebox.mk b/boot/barebox/barebox/barebox.mk
index 39afb0fccb..c9905b3335 100644
--- a/boot/barebox/barebox/barebox.mk
+++ b/boot/barebox/barebox/barebox.mk
@@ -5,8 +5,12 @@
 ################################################################################
 
 define BAREBOX_HELP_CMDS
-	@echo '  barebox-menuconfig     - Run barebox menuconfig'
-	@echo '  barebox-savedefconfig  - Run barebox savedefconfig'
+	@echo '  barebox-menuconfig       - Run barebox menuconfig'
+	@echo '  barebox-savedefconfig    - Run barebox savedefconfig'
+	@echo '  barebox-update-defconfig - Save the Barebox configuration to the path specified'
+	@echo '                             by BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE, as a defconfig'
+	@echo '  barebox-update-config    - Save the Barebox configuration to the path specified'
+	@echo '                             by BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE, as a full .config'
 endef
 
 # Instantiate the barebox package
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index a7eaedb06f..cb31223746 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -296,7 +296,9 @@ define UBOOT_HELP_CMDS
 	@echo '  uboot-menuconfig       - Run U-Boot menuconfig'
 	@echo '  uboot-savedefconfig    - Run U-Boot savedefconfig'
 	@echo '  uboot-update-defconfig - Save the U-Boot configuration to the path specified'
-	@echo '                             by BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE'
+	@echo '                             by BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE, as a defconfig'
+	@echo '  uboot-update-config    - Save the U-Boot configuration to the path specified'
+	@echo '                             by BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE, as a full .config'
 endef
 endif # BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY
 
diff --git a/linux/linux.mk b/linux/linux.mk
index 1457228eb9..1852fa34ef 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -20,7 +20,9 @@ define LINUX_HELP_CMDS
 	@echo '  linux-menuconfig       - Run Linux kernel menuconfig'
 	@echo '  linux-savedefconfig    - Run Linux kernel savedefconfig'
 	@echo '  linux-update-defconfig - Save the Linux configuration to the path specified'
-	@echo '                             by BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE'
+	@echo '                             by BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE, as a defconfig'
+	@echo '  linux-update-config    - Save the Linux configuration to the path specified'
+	@echo '                             by BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE, as a full .config'
 endef
 
 # Compute LINUX_SOURCE and LINUX_SITE from the configuration
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 413939e28d..6504ec4f9a 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -13,6 +13,8 @@ BUSYBOX_CPE_ID_VENDOR = busybox
 
 define BUSYBOX_HELP_CMDS
 	@echo '  busybox-menuconfig     - Run BusyBox menuconfig'
+	@echo '  busybox-update-config    - Save the Busybox configuration to the path specified'
+	@echo '                             by BR2_PACKAGE_BUSYBOX_CONFIG, as a full .config'
 endef
 
 BUSYBOX_CFLAGS = \
diff --git a/package/linux-backports/linux-backports.mk b/package/linux-backports/linux-backports.mk
index 068dcffcc8..f4a6583090 100644
--- a/package/linux-backports/linux-backports.mk
+++ b/package/linux-backports/linux-backports.mk
@@ -14,6 +14,15 @@ LINUX_BACKPORTS_LICENSE_FILES = \
 	LICENSES/exceptions/Linux-syscall-note \
 	LICENSES/preferred/GPL-2.0
 
+define LINUX_BACKPORTS_HELP_CMDS
+	@echo '  linux-backports-menuconfig       - Run linux-backports menuconfig'
+	@echo '  linux-backports-savedefconfig    - Run linux-backports savedefconfig'
+	@echo '  linux-backports-update-defconfig - Save the linux-backports configuration to the path specified'
+	@echo '                                       by BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE, as a defconfig'
+	@echo '  linux-backports-update-config    - Save the linux-backports configuration to the path specified'
+	@echo '                                       by BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE, as a full .config'
+endef
+
 # flex and bison are needed to generate kconfig parser. We use the
 # same logic as the linux kernel (we add host dependencies only if
 # host does not have them). See linux/linux.mk and
diff --git a/package/swupdate/swupdate.mk b/package/swupdate/swupdate.mk
index d96a0c2e07..689ef6b6e8 100644
--- a/package/swupdate/swupdate.mk
+++ b/package/swupdate/swupdate.mk
@@ -151,6 +151,15 @@ SWUPDATE_BUILD_CONFIG = $(@D)/.config
 SWUPDATE_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_SWUPDATE_CONFIG))
 SWUPDATE_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
 
+define SWUPDATE_HELP_CMDS
+	@echo '  swupdate-menuconfig       - Run swupdate menuconfig'
+	@echo '  swupdate-savedefconfig    - Run swupdate savedefconfig'
+	@echo '  swupdate-update-defconfig - Save the swupdate configuration to the path specified'
+	@echo '                                by BR2_PACKAGE_SWUPDATE_CONFIG, as a defconfig'
+	@echo '  swupdate-update-config    - Save the swupdate configuration to the path specified'
+	@echo '                                by BR2_PACKAGE_SWUPDATE_CONFIG, as a full .config'
+endef
+
 ifeq ($(BR2_STATIC_LIBS),y)
 define SWUPDATE_PREFER_STATIC
 	$(call KCONFIG_ENABLE_OPT,CONFIG_STATIC)
diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index a7c96684d0..910d479cfd 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -14,7 +14,12 @@ UCLIBC_CPE_ID_VENDOR = uclibc-ng_project
 UCLIBC_CPE_ID_PRODUCT = uclibc-ng
 
 define UCLIBC_HELP_CMDS
-	@echo '  uclibc-menuconfig      - Run uClibc menuconfig'
+	@echo '  uclibc-menuconfig       - Run uClibc menuconfig'
+	@echo '  uclibc-savedefconfig    - Run uClibc savedefconfig'
+	@echo '  uclibc-update-defconfig - Save the uClibc configuration to the path specified'
+	@echo '                              by BR2_UCLIBC_CONFIG, as a defconfig'
+	@echo '  uclibc-update-config    - Save the uClibc configuration to the path specified'
+	@echo '                              by BR2_UCLIBC_CONFIG, as a full .config'
 endef
 
 # uclibc is part of the toolchain so disable the toolchain dependency
diff --git a/package/xvisor/xvisor.mk b/package/xvisor/xvisor.mk
index 394ff7c80b..aa5831e10c 100644
--- a/package/xvisor/xvisor.mk
+++ b/package/xvisor/xvisor.mk
@@ -19,6 +19,15 @@ ifeq ($(BR2_PACKAGE_XVISOR_BUILD_TEST_DTB),y)
 XVISOR_MAKE_TARGETS += dtbs
 endif
 
+define XVISOR_HELP_CMDS
+	@echo '  xvisor-menuconfig       - Run xvisor menuconfig'
+	@echo '  xvisor-savedefconfig    - Run xvisor savedefconfig'
+	@echo '  xvisor-update-defconfig - Save the xvisor configuration to the path specified'
+	@echo '                              by BR2_PACKAGE_XVISOR_CUSTOM_CONFIG_FILE, as a defconfig'
+	@echo '  xvisor-update-config    - Save the xvisor configuration to the path specified'
+	@echo '                              by BR2_PACKAGE_XVISOR_CUSTOM_CONFIG_FILE, as a full .config'
+endef
+
 XVISOR_KCONFIG_DOTCONFIG = build/openconf/.config
 
 ifeq ($(BR2_PACKAGE_XVISOR_USE_DEFCONFIG),y)
-- 
2.31.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] Makefile: document the <pkg>-reinstall target
  2021-07-03 19:39 [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages Thomas Petazzoni
@ 2021-07-03 19:40 ` Thomas Petazzoni
  2021-07-04  8:08   ` Yann E. MORIN
  2021-07-04  8:05 ` [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages Yann E. MORIN
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2021-07-03 19:40 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 472af5a318..74c238cb20 100644
--- a/Makefile
+++ b/Makefile
@@ -1151,6 +1151,7 @@ help:
 	@echo '  <pkg>-dirclean         - Remove <pkg> build directory'
 	@echo '  <pkg>-reconfigure      - Restart the build from the configure step'
 	@echo '  <pkg>-rebuild          - Restart the build from the build step'
+	@echo '  <pkg>-reinstall        - Restart the build from the install step'
 	$(foreach p,$(HELP_PACKAGES), \
 		@echo $(sep) \
 		@echo '$($(p)_NAME):' $(sep) \
-- 
2.31.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages
  2021-07-03 19:39 [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages Thomas Petazzoni
  2021-07-03 19:40 ` [Buildroot] [PATCH 2/2] Makefile: document the <pkg>-reinstall target Thomas Petazzoni
@ 2021-07-04  8:05 ` Yann E. MORIN
  2021-07-24 21:21   ` Yann E. MORIN
  1 sibling, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2021-07-04  8:05 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2021-07-03 21:39 +0200, Thomas Petazzoni spake thusly:
> The <pkg>_HELP_CMDS variable allows packages using the kconfig-package
> infrastructure to display their specific targets related to the
> handling of their configuration.
> 
> However, it was not consistently used and handled by the different
> packages. This commit makes sure all packages using kconfig-package
> have that help text, and that is does reflect which targets are
> available/usable.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

I wonder wy we can't have that generated automatically by the
kconfig-package infra, rather than repeast it in all packages.

The only exception is busybox, which does not have support for defconfig
files, otherwise all packages behave similarly.

What about the following patch (lightly tested):

    diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
    index dd727b7200..18d11e845a 100644
    --- a/package/pkg-kconfig.mk
    +++ b/package/pkg-kconfig.mk
    @@ -82,6 +82,31 @@ define inner-kconfig-package
     # they are also accounted for in the generated graphs.
     $(2)_DEPENDENCIES += $$($(2)_KCONFIG_DEPENDENCIES)
     
    +$(2)_KCONFIG_SUPPORTS_DEFCONFIG ?= YES
    +
    +# 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),,\
    +		$$(if $$(filter YES,$$($(2)_KCONFIG_SUPPORTS_DEFCONFIG)),\
    +			@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

Note: I am not 100% sure we want the coditional definition, but it is
more in-line with the other _CMDS that packages can define.

Then we can simply drop all the per-package _HELP_CMDS.

$(2)_KCONFIG_SUPPORTS_DEFCONFIG is there just for busybox, which AFAICS
is the only package without support for defconfig files. We could
alternatively drop this new variable and let busybox define its own
_HELP_CMDS; that would slightly simplify the code above.

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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] Makefile: document the <pkg>-reinstall target
  2021-07-03 19:40 ` [Buildroot] [PATCH 2/2] Makefile: document the <pkg>-reinstall target Thomas Petazzoni
@ 2021-07-04  8:08   ` Yann E. MORIN
  0 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2021-07-04  8:08 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2021-07-03 21:40 +0200, Thomas Petazzoni spake thusly:
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Makefile b/Makefile
> index 472af5a318..74c238cb20 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1151,6 +1151,7 @@ help:
>  	@echo '  <pkg>-dirclean         - Remove <pkg> build directory'
>  	@echo '  <pkg>-reconfigure      - Restart the build from the configure step'
>  	@echo '  <pkg>-rebuild          - Restart the build from the build step'
> +	@echo '  <pkg>-reinstall        - Restart the build from the install step'
>  	$(foreach p,$(HELP_PACKAGES), \
>  		@echo $(sep) \
>  		@echo '$($(p)_NAME):' $(sep) \
> -- 
> 2.31.1
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages
  2021-07-04  8:05 ` [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages Yann E. MORIN
@ 2021-07-24 21:21   ` Yann E. MORIN
  0 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2021-07-24 21:21 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Eric Le Bihan, Simon Dawson, Buildroot List

Thomas, All,

On 2021-07-04 10:05 +0200, Yann E. MORIN spake thusly:
> On 2021-07-03 21:39 +0200, Thomas Petazzoni spake thusly:
> > The <pkg>_HELP_CMDS variable allows packages using the kconfig-package
> > infrastructure to display their specific targets related to the
> > handling of their configuration.
> > 
> > However, it was not consistently used and handled by the different
> > packages. This commit makes sure all packages using kconfig-package
> > have that help text, and that is does reflect which targets are
> > available/usable.
> > 
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> 
> I wonder wy we can't have that generated automatically by the
> kconfig-package infra, rather than repeast it in all packages.

I've now sent a proposal for review:

    https://patchwork.ozlabs.org/project/buildroot/list/?series=255056

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.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-24 21:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-03 19:39 [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages Thomas Petazzoni
2021-07-03 19:40 ` [Buildroot] [PATCH 2/2] Makefile: document the <pkg>-reinstall target Thomas Petazzoni
2021-07-04  8:08   ` Yann E. MORIN
2021-07-04  8:05 ` [Buildroot] [PATCH 1/2] boot/, linux/, package/: improve help text of kconfig packages Yann E. MORIN
2021-07-24 21:21   ` Yann E. MORIN

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.