package/wireless_tools: add option to build ifrename
PATCH 1/1 package/wireless_tools: add option to build ifrename
From: "Neal J. Buchmeyer" <[email protected]>
Add option to select ifrename tool which is part of the wireless_tools suite. Also add an option to disable iwconfig for targets that only want the library or ifrename.
--- package/wireless_tools/Config.in | 12 ++++++++++++ package/wireless_tools/wireless_tools.mk | 22 ++++++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-)
package/wireless_tools/Config.in +12 -0
@@ -7,6 +7,18 @@ config BR2_PACKAGE_WIRELESS_TOOLS if BR2_PACKAGE_WIRELESS_TOOLS +config BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME + bool "Add ifrename" + help + Build and install the ifrename tool + +config BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG + bool "Add iwconfig" + default y + help + Build and install the iwconfig, iwlist, iwspy, iwpriv, and + iwgetid tools. + config BR2_PACKAGE_WIRELESS_TOOLS_LIB bool "Install shared library" depends on !BR2_STATIC_LIBS
package/wireless_tools/wireless_tools.mk +16 -6
@@ -14,8 +14,14 @@ WIRELESS_TOOLS_CPE_ID_VERSION = $(WIRELESS_TOOLS_VERSION_MAJOR) WIRELESS_TOOLS_CPE_ID_UPDATE = pre9 WIRELESS_TOOLS_INSTALL_STAGING = YES -WIRELESS_TOOLS_BUILD_TARGETS = iwmulticall -WIRELESS_TOOLS_INSTALL_TARGETS = install-iwmulticall +ifeq ($(BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME),y) +WIRELESS_TOOLS_BUILD_TARGETS += ifrename +endif + +ifeq ($(BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG),y) +WIRELESS_TOOLS_BUILD_TARGETS += iwmulticall +WIRELESS_TOOLS_INSTALL_TARGETS += install-iwmulticall +endif ifeq ($(BR2_PACKAGE_WIRELESS_TOOLS_LIB),y) WIRELESS_TOOLS_BUILD_TARGETS += libiw.so.$(WIRELESS_TOOLS_VERSION_MAJOR)
@@ -30,13 +36,17 @@ endef endif define WIRELESS_TOOLS_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \ - $(WIRELESS_TOOLS_BUILD_TARGETS) + $(if $(WIRELESS_TOOLS_BUILD_TARGETS), + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" $(WIRELESS_TOOLS_BUILD_TARGETS)) endef define WIRELESS_TOOLS_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)" LDCONFIG=/bin/true \ - $(WIRELESS_TOOLS_INSTALL_TARGETS) + $(if $(WIRELESS_TOOLS_INSTALL_TARGETS), + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)" \ + LDCONFIG=/bin/true $(WIRELESS_TOOLS_INSTALL_TARGETS)) + $(if $(BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME), + $(INSTALL) -D -m 755 $(@D)/ifrename $(TARGET_DIR)/sbin/ifrename) endef $(eval $(generic-package))
Signature · 6 lines
2.41.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Brandon, Neal, All,
On 2023-10-19 20:33 +0000, Brandon Maier via buildroot spake thusly:
Quoted 5 lines
From: "Neal J. Buchmeyer" <[email protected]>
Add option to select ifrename tool which is part of the
wireless_toolssuite. Also add an option to disable iwconfig for targets that only want the library or ifrename.
Those are two semantically disjoint changes, so they should be two patches, preferably in this order:
1. one to allow only building the library (and make iwconfig optional)
2. one to add ifrename
Plus, see below...
Quoted 52 lines
Signed-off-by Neal J. Buchmeyer <[email protected]>Signed-off-by Brandon Maier <[email protected]>--- package/wireless_tools/Config.in | 12 ++++++++++++ package/wireless_tools/wireless_tools.mk | 22 ++++++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-)package/wireless_tools/Config.in +12
-0@@ -7,6 +7,18 @@ config BR2_PACKAGE_WIRELESS_TOOLS if BR2_PACKAGE_WIRELESS_TOOLS +config BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME + bool "Add ifrename" + help + Build and install the ifrename tool + +config BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG + bool "Add iwconfig" + default y + help + Build and install the iwconfig, iwlist, iwspy, iwpriv, and + iwgetid tools. + config BR2_PACKAGE_WIRELESS_TOOLS_LIB bool "Install shared library" depends on !BR2_STATIC_LIBSpackage/wireless_tools/wireless_tools.mk +8
-2@@ -14,8 +14,14 @@ WIRELESS_TOOLS_CPE_ID_VERSION = $(WIRELESS_TOOLS_VERSION_MAJOR) WIRELESS_TOOLS_CPE_ID_UPDATE = pre9 WIRELESS_TOOLS_INSTALL_STAGING = YES -WIRELESS_TOOLS_BUILD_TARGETS = iwmulticall -WIRELESS_TOOLS_INSTALL_TARGETS = install-iwmulticall +ifeq ($(BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME),y) +WIRELESS_TOOLS_BUILD_TARGETS += ifrename +endif + +ifeq ($(BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG),y) +WIRELESS_TOOLS_BUILD_TARGETS += iwmulticall +WIRELESS_TOOLS_INSTALL_TARGETS += install-iwmulticall +endif ifeq ($(BR2_PACKAGE_WIRELESS_TOOLS_LIB),y) WIRELESS_TOOLS_BUILD_TARGETS += libiw.so.$(WIRELESS_TOOLS_VERSION_MAJOR)
package/wireless_tools/wireless_tools.mk endef · line 42
Quoted 9 lines
package/wireless_tools/wireless_tools.mk +3
-2@@ -30,13 +36,17 @@ endef endif define WIRELESS_TOOLS_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \ - $(WIRELESS_TOOLS_BUILD_TARGETS) + $(if $(WIRELESS_TOOLS_BUILD_TARGETS), + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" $(WIRELESS_TOOLS_BUILD_TARGETS)) endef
So, if none of ifrename, iwconfig, or the library is enabled, then there is nothjing to build (or to install, below). In this case, it does not make sense to enable the package altogether.
I think we must ensure that at least one of those are enabled, and iwconfig looks like the obvious candidate. So (elided for the sake of example):
config BR2_PACKAGE_WIRELESS_TOOLS
bool "wireless tools"
select BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG if \
!BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME && \
!BR2_PACKAGE_WIRELESS_TOOLS_LIBOf course, in the first patch, only BR2_PACKAGE_WIRELESS_TOOLS_LIB would be needed in the condition, with BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME added in patch 2.
Regards,
Yann E. MORIN.
Quoted 18 lines
package/wireless_tools/wireless_tools.mk +5
-2define WIRELESS_TOOLS_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)" LDCONFIG=/bin/true \ - $(WIRELESS_TOOLS_INSTALL_TARGETS) + $(if $(WIRELESS_TOOLS_INSTALL_TARGETS), + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)" \ + LDCONFIG=/bin/true $(WIRELESS_TOOLS_INSTALL_TARGETS)) + $(if $(BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME), + $(INSTALL) -D -m 755 $(@D)/ifrename $(TARGET_DIR)/sbin/ifrename) endef $(eval $(generic-package))Signature · 6 lines
2.41.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
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] https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Yann,
Quoted 8 lines
-----Original Message-----
From: Yann E. MORIN <[email protected]>
Sent: Sunday, October 22, 2023 1:48 PMThose are two semantically disjoint changes, so they should be two patches, preferably in this order:
1. one to allow only building the library (and make iwconfig optional)
2. one to add ifrename
Agreed, sent a v2 series with the changes split apart
Quoted 14 lines
So, if none of ifrename, iwconfig, or the library is enabled, then there is nothjing to build (or to install, below). In this case, it does not make sense to enable the package altogether.
I think we must ensure that at least one of those are enabled, and iwconfig looks like the obvious candidate. So (elided for the sake of example):
config BR2_PACKAGE_WIRELESS_TOOLS bool "wireless tools" select BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG if \ !BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME && \ !BR2_PACKAGE_WIRELESS_TOOLS_LIB
Quoted 3 lines
Of course, in the first patch, only
BR2_PACKAGE_WIRELESS_TOOLS_LIBwould be needed in the condition, withBR2_PACKAGE_WIRELESS_TOOLS_IFRENAMEadded in patch 2.
Agreed, it makes sense to require one of the tools to be built. Didn't know about this KConfig trick. Fixed as suggested in v2.
Thanks,
Brandon Maier
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 1/2 package/wireless_tools: make 'iwconfig' tool optional
In reply to Brandon Maier via buildrootFrom: "Neal J. Buchmeyer" <[email protected]>
Allow disabling iwconfig for targets that only want the library.
--- package/wireless_tools/Config.in | 8 ++++++++ package/wireless_tools/wireless_tools.mk | 2 ++ 2 files changed, 10 insertions(+)
package/wireless_tools/Config.in +8 -0
@@ -1,5 +1,7 @@ config BR2_PACKAGE_WIRELESS_TOOLS bool "wireless tools" + select BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG if \ + !BR2_PACKAGE_WIRELESS_TOOLS_LIB help A collection of tools to configure wireless lan cards.
@@ -7,6 +9,12 @@ config BR2_PACKAGE_WIRELESS_TOOLS if BR2_PACKAGE_WIRELESS_TOOLS +config BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG + bool "Add iwconfig" + help + Build and install the iwconfig, iwlist, iwspy, iwpriv, and + iwgetid tools. + config BR2_PACKAGE_WIRELESS_TOOLS_LIB bool "Install shared library" depends on !BR2_STATIC_LIBS
package/wireless_tools/wireless_tools.mk +2 -0
@@ -14,8 +14,10 @@ WIRELESS_TOOLS_CPE_ID_VERSION = $(WIRELESS_TOOLS_VERSION_MAJOR) WIRELESS_TOOLS_CPE_ID_UPDATE = pre9 WIRELESS_TOOLS_INSTALL_STAGING = YES +ifeq ($(BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG),y) WIRELESS_TOOLS_BUILD_TARGETS = iwmulticall WIRELESS_TOOLS_INSTALL_TARGETS = install-iwmulticall +endif ifeq ($(BR2_PACKAGE_WIRELESS_TOOLS_LIB),y) WIRELESS_TOOLS_BUILD_TARGETS += libiw.so.$(WIRELESS_TOOLS_VERSION_MAJOR)
Signature · 6 lines
2.41.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 2/2 package/wireless_tools: add option to build ifrename
From: "Neal J. Buchmeyer" <[email protected]>
The ifrename tool is separate from iwconfig and is not being built. The upstream does not have an install target for ifrename either, so we must manually install it.
--- package/wireless_tools/Config.in | 6 ++++++ package/wireless_tools/wireless_tools.mk | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-)
package/wireless_tools/Config.in +6 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_WIRELESS_TOOLS bool "wireless tools" select BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG if \ + !BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME && \ !BR2_PACKAGE_WIRELESS_TOOLS_LIB help A collection of tools to configure wireless lan cards.
@@ -15,6 +16,11 @@ config BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG Build and install the iwconfig, iwlist, iwspy, iwpriv, and iwgetid tools. +config BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME + bool "Add ifrename" + help + Build and install the ifrename tool + config BR2_PACKAGE_WIRELESS_TOOLS_LIB bool "Install shared library" depends on !BR2_STATIC_LIBS
package/wireless_tools/wireless_tools.mk +9 -2
@@ -19,6 +19,10 @@ WIRELESS_TOOLS_BUILD_TARGETS = iwmulticall WIRELESS_TOOLS_INSTALL_TARGETS = install-iwmulticall endif +ifeq ($(BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME),y) +WIRELESS_TOOLS_BUILD_TARGETS += ifrename +endif + ifeq ($(BR2_PACKAGE_WIRELESS_TOOLS_LIB),y) WIRELESS_TOOLS_BUILD_TARGETS += libiw.so.$(WIRELESS_TOOLS_VERSION_MAJOR) WIRELESS_TOOLS_INSTALL_TARGETS += install-dynamic
@@ -37,8 +41,11 @@ define WIRELESS_TOOLS_BUILD_CMDS endef define WIRELESS_TOOLS_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)" LDCONFIG=/bin/true \ - $(WIRELESS_TOOLS_INSTALL_TARGETS) + $(if $(WIRELESS_TOOLS_INSTALL_TARGETS), + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)" \ + LDCONFIG=/bin/true $(WIRELESS_TOOLS_INSTALL_TARGETS)) + $(if $(BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME), + $(INSTALL) -D -m 755 $(@D)/ifrename $(TARGET_DIR)/sbin/ifrename) endef $(eval $(generic-package))
Signature · 6 lines
2.41.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 13 lines · On Tue, 24 Oct 2023 18:48:35 +0000 Brandon Maier via buildroot…
package/wireless_tools/Config.in +1
-0@@ -1,6 +1,7 @@ config BR2_PACKAGE_WIRELESS_TOOLS bool "wireless tools" select BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG if \ + !BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME && \ !BR2_PACKAGE_WIRELESS_TOOLS_LIB help A collection of tools to configure wireless lan cards.
package/wireless_tools/Config.in config BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG · line 20
Quoted 5 lines
package/wireless_tools/Config.in +2
-0@@ -15,6 +16,11 @@ config BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG Build and install the iwconfig, iwlist, iwspy, iwpriv, and iwgetid tools. +config BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME + bool "Add ifrename"
Changed to:
bool "Install ifrename"
package/wireless_tools/Config.in config BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG · line 24
Quoted 6 lines
package/wireless_tools/Config.in +3
-2define WIRELESS_TOOLS_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)" LDCONFIG=/bin/true \ - $(WIRELESS_TOOLS_INSTALL_TARGETS) + $(if $(WIRELESS_TOOLS_INSTALL_TARGETS), + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)" \ + LDCONFIG=/bin/true $(WIRELESS_TOOLS_INSTALL_TARGETS))
Indented this last line with one more tab.
And applied. Thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v2 1/2] package/wireless_tools: make 'iwconfig' tool optional
In reply to Brandon Maier via buildrootpackage/wireless_tools/Config.in config BR2_PACKAGE_WIRELESS_TOOLS · line 13
Quoted 6 lines · On Tue, 24 Oct 2023 18:48:34 +0000 Brandon Maier via buildroot…
package/wireless_tools/Config.in +2
-0@@ -7,6 +9,12 @@ config BR2_PACKAGE_WIRELESS_TOOLS if BR2_PACKAGE_WIRELESS_TOOLS +config BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG + bool "Add iwconfig"
Change to:
bool "Install tools"
because it's really about "installing", and it is more consistent with the option for the shared library, which is "Install shared library".
I've also added:
default y
to preserve the existing behavior.
Applied with those changes. Thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot