[PATCH 1/2] ethtool: add netlink build variant

David Bauer mail at david-bauer.net
Thu Mar 4 22:58:19 GMT 2021


Netlink support is required for using the virtual cable tester
functionality. Thus, add a build variant with enabled netlink
support.

Signed-off-by: David Bauer <mail at david-bauer.net>
---
 package/network/utils/ethtool/Makefile | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile
index 3efc90490b..ab068b9c20 100644
--- a/package/network/utils/ethtool/Makefile
+++ b/package/network/utils/ethtool/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ethtool
 PKG_VERSION:=5.10
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@@ -34,28 +34,46 @@ define Package/ethtool
   URL:=http://www.kernel.org/pub/software/network/ethtool/
 endef
 
+define Package/ethtool-netlink
+  $(Package/ethtool)
+  TITLE += (netlink support)
+  VARIANT:=netlink
+  PROVIDES:=ethtool
+  CONFLICTS:=ethtool
+  DEPENDS:=+libmnl
+endef
+
 define Package/ethtool/description
  ethtool is a small utility for examining and tuning your ethernet-based
  network interface
 endef
 
+Package/ethtool-netlink/description:=$(Package/ethtool/description)
+
 define Package/ethtool/config
 	config ETHTOOL_PRETTY_DUMP
-		depends on PACKAGE_ethtool
+		depends on PACKAGE_ethtool || PACKAGE_ethtool-netlink
 		bool "Enable pretty printing"
 endef
 
-CONFIGURE_ARGS += --disable-netlink
-
 ifeq ($(CONFIG_ETHTOOL_PRETTY_DUMP),y)
 CONFIGURE_ARGS += --enable-pretty-dump
 else
 CONFIGURE_ARGS += --disable-pretty-dump
 endif
 
+ifeq ($(BUILD_VARIANT),netlink)
+CONFIGURE_ARGS += --enable-netlink
+else
+CONFIGURE_ARGS += --disable-netlink
+endif
+
 define Package/ethtool/install
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethtool $(1)/usr/sbin
 endef
 
+Package/ethtool-netlink/install=$(Package/ethtool/install)
+
 $(eval $(call BuildPackage,ethtool))
+$(eval $(call BuildPackage,ethtool-netlink))
-- 
2.30.1




More information about the openwrt-devel mailing list