ethtool: Add option to enable/disable pretty-printing 1292/head
authorFlorian Fainelli <florian@openwrt.org>
Sat, 23 May 2015 17:44:12 +0000 (10:44 -0700)
committerFlorian Fainelli <florian@openwrt.org>
Thu, 28 May 2015 03:00:55 +0000 (20:00 -0700)
With upstream commit
https://git.kernel.org/cgit/network/ethtool/ethtool.git/commit/?id=875616dfcbe57ea0f639a20d85fcbad2172ad744

there is now an option to produce a smaller ethtool build which will
disable pretty printing (Ethernet drivers, SFP diagnostics...) for
platforms that do not need it.

Hook a menu configuration option to control that option. Build size
differences on ar71xx:

With:
-rw-r--r-- 1 florian florian 79K mai   23 10:43
bin/ar71xx/packages/packages/ethtool_3.18-1_ar71xx.ipk

Without:
-rw-r--r-- 1 florian florian 23K mai   23 10:43
bin/ar71xx/packages/packages/ethtool_3.18-1_ar71xx.ipk

Signed-off-by: Florian Fainelli <florian@openwrt.org>
net/ethtool/Config.in [new file with mode: 0644]
net/ethtool/Makefile

diff --git a/net/ethtool/Config.in b/net/ethtool/Config.in
new file mode 100644 (file)
index 0000000..7ec5553
--- /dev/null
@@ -0,0 +1,7 @@
+menu "Configuration"
+       depends on PACKAGE_ethtool
+
+       config ETHTOOL_PRETTY_DUMP
+               bool "Enable pretty printing"
+
+endmenu
index 5ffb8253c3167a3474bfb8961d33f38bc442abf5..818a011ffa99f51c4c8c304caca952d5f1331d32 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ethtool
 PKG_VERSION:=3.18
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@@ -23,6 +23,8 @@ PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
+PKG_CONFIG_DEPENDS:=ETHTOOL_PRETTY_DUMP
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/ethtool
@@ -37,6 +39,16 @@ define Package/ethtool/description
  network interface
 endef
 
+define Package/ethtool/config
+       source "$(SOURCE)/Config.in
+endef
+
+ifeq ($(CONFIG_ETHTOOL_PRETTY_DUMP),y)
+CONFIGURE_ARGS += --enable-pretty-dump
+else
+CONFIGURE_ARGS += --disable-pretty-dump
+endif
+
 define Package/ethtool/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ethtool $(1)/usr/sbin