kernel/modules: relocate teql hotplug from iproute2 to kmod-sched
authorTony Ambardar <itugrok@yahoo.com>
Tue, 2 Mar 2021 04:59:04 +0000 (20:59 -0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 19 Mar 2021 14:30:01 +0000 (15:30 +0100)
The link equalizer sch_teql.ko of package kmod-sched relies on a hotplug
script historically included in iproute2's tc package. In previous
discussion [1], consensus was the hotplug script is best located together
with the module in kmod-sched, but this change was deferred at the time.

Relocate the hotplug script now. This change also simplifies adding a tc
variant for minimal size with reduced functionality.

[1] https://github.com/openwrt/openwrt/pull/1627#issuecomment-447923636

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
package/kernel/linux/files/hotplug-sched-teql.sh [new file with mode: 0644]
package/kernel/linux/modules/netsupport.mk
package/network/utils/iproute2/Makefile
package/network/utils/iproute2/files/15-teql [deleted file]

diff --git a/package/kernel/linux/files/hotplug-sched-teql.sh b/package/kernel/linux/files/hotplug-sched-teql.sh
new file mode 100644 (file)
index 0000000..a0c0e50
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+if [ "$ACTION" != "ifup" ]; then
+       exit
+fi
+
+config_load network
+
+config_get teql $INTERFACE teql
+
+if [ "$teql" != "" ]; then
+    logger Adding device $DEVICE to TEQL master $teql
+    insmod sch_teql
+    tc qdisc add dev $DEVICE root $teql
+
+    # The kernel doesn't let us bring it up until it has at least one
+    # slave. So bring it up now, if it isn't already.
+    if ! cat /sys/class/net/$teql/carrier &>/dev/null; then
+        ifup $teql &
+    fi
+fi
index 6bc8ba664a526109d7bf01163734169ab2fdefeb..f14928e18e65930c03dcf71d94fee72d7980fb9e 100644 (file)
@@ -916,6 +916,13 @@ define KernelPackage/sched/description
  Extra kernel schedulers modules for IP traffic
 endef
 
+SCHED_TEQL_HOTPLUG:=hotplug-sched-teql.sh
+
+define KernelPackage/sched/install
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+       $(INSTALL_DATA) ./files/$(SCHED_TEQL_HOTPLUG) $(1)/etc/hotplug.d/iface/15-teql
+endef
+
 $(eval $(call KernelPackage,sched))
 
 
index 440e33069bccd1ea1bc613b7b8e02caa61e61907..a20e81c75adba96503c6ac05b94d43ec588a5467 100644 (file)
@@ -166,8 +166,6 @@ endef
 define Package/tc/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
-       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
-       $(INSTALL_BIN) ./files/15-teql $(1)/etc/hotplug.d/iface/
 ifeq ($(SHARED_LIBS),y)
        $(INSTALL_DIR) $(1)/usr/lib/tc
        $(CP) $(PKG_BUILD_DIR)/tc/*.so $(1)/usr/lib/tc
diff --git a/package/network/utils/iproute2/files/15-teql b/package/network/utils/iproute2/files/15-teql
deleted file mode 100644 (file)
index a0c0e50..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-. /lib/functions.sh
-
-if [ "$ACTION" != "ifup" ]; then
-       exit
-fi
-
-config_load network
-
-config_get teql $INTERFACE teql
-
-if [ "$teql" != "" ]; then
-    logger Adding device $DEVICE to TEQL master $teql
-    insmod sch_teql
-    tc qdisc add dev $DEVICE root $teql
-
-    # The kernel doesn't let us bring it up until it has at least one
-    # slave. So bring it up now, if it isn't already.
-    if ! cat /sys/class/net/$teql/carrier &>/dev/null; then
-        ifup $teql &
-    fi
-fi