boot/, linux/, package/: improve help text of kconfig packages
Subsystems (2)
PATCH 1/2 boot/, linux/, package/: improve help text of kconfig packages
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.
--- 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(-)
boot/at91bootstrap3/at91bootstrap3.mk +9 -0
@@ -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)
boot/barebox/barebox/barebox.mk +6 -2
@@ -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
boot/uboot/uboot.mk +3 -1
@@ -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
linux/linux.mk +3 -1
@@ -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
package/busybox/busybox.mk +2 -0
@@ -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 = \
package/linux-backports/linux-backports.mk +9 -0
@@ -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
package/swupdate/swupdate.mk +9 -0
@@ -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)
package/uclibc/uclibc.mk +6 -1
@@ -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
package/xvisor/xvisor.mk +9 -0
@@ -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)
Signature · 1 line
2.31.1
PATCH 2/2 Makefile: document the <pkg>-reinstall target
--- Makefile | 1 + 1 file changed, 1 insertion(+)
Makefile +1 -0
@@ -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) \
Signature · 1 line
2.31.1
Yann E. MORIN
AppliedPATCH 2/2 Makefile: document the <pkg>-reinstall target
Thomas, All,
On 2021-07-03 21:40 +0200, Thomas Petazzoni spake thusly:
Quoted 1 line
Signed-off-by Thomas Petazzoni <[email protected]>
Applied to master, thanks.
Regards,
Yann E. MORIN.
Quoted 19 lines
--- Makefile | 1 + 1 file changed, 1 insertion(+)Makefile +1
-0@@ -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) \Signature · 1 line
2.31.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH 1/2 boot/, linux/, package/: improve help text of kconfig packages
In reply to Thomas PetazzoniThomas, All,
On 2021-07-03 21:39 +0200, Thomas Petazzoni spake thusly:
Quoted 10 lines
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 <[email protected]>
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 aNote: 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.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
Thomas, All,
On 2021-07-04 10:05 +0200, Yann E. MORIN spake thusly:
Quoted 10 lines
On 2021-07-03 21:39 +0200, Thomas Petazzoni spake thusly:
Quoted 9 lines
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.
Quoted 4 lines
Quoted 1 line
Signed-off-by Thomas Petazzoni <[email protected]>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.
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | 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 [email protected] http://lists.busybox.net/mailman/listinfo/buildroot