Skip to content

Commit

Permalink
ethtool: introduce ethtool-full build variant
Browse files Browse the repository at this point in the history
Netlink support is required for using the virtual cable tester
functionality.

Remove the pretty print build option and instead create a second package
variant ethtool-full. This allows users to install the full ethtool
featureset using opkg.

Signed-off-by: David Bauer <mail@david-bauer.net>
  • Loading branch information
blocktrron committed Aug 4, 2021
1 parent 91a52f2 commit d858366
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions package/network/utils/ethtool/Makefile
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=ethtool
PKG_VERSION:=5.12
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
Expand All @@ -23,39 +23,44 @@ PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

PKG_CONFIG_DEPENDS:=CONFIG_ETHTOOL_PRETTY_DUMP

include $(INCLUDE_DIR)/package.mk

define Package/ethtool
SECTION:=net
CATEGORY:=Network
TITLE:=Display or change ethernet card settings
URL:=http://www.kernel.org/pub/software/network/ethtool/
VARIANT:=tiny
endef

define Package/ethtool-full
$(Package/ethtool)
TITLE += (full)
VARIANT:=full
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

define Package/ethtool/config
config ETHTOOL_PRETTY_DUMP
depends on PACKAGE_ethtool
bool "Enable pretty printing"
endef

CONFIGURE_ARGS += --disable-netlink
Package/ethtool-full/description:=$(Package/ethtool/description)

ifeq ($(CONFIG_ETHTOOL_PRETTY_DUMP),y)
CONFIGURE_ARGS += --enable-pretty-dump
ifeq ($(BUILD_VARIANT),full)
CONFIGURE_ARGS += --enable-netlink --enable-pretty-dump
else
CONFIGURE_ARGS += --disable-pretty-dump
CONFIGURE_ARGS += --disable-netlink --disable-pretty-dump
endif

define Package/ethtool/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethtool $(1)/usr/sbin
endef

Package/ethtool-full/install=$(Package/ethtool/install)

$(eval $(call BuildPackage,ethtool))
$(eval $(call BuildPackage,ethtool-full))

0 comments on commit d858366

Please sign in to comment.