br2684ctl: resolve a boot time race condition with nas0 bringup by using explicit...
authorFelix Fietkau <nbd@openwrt.org>
Mon, 18 Jan 2016 15:35:30 +0000 (15:35 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 18 Jan 2016 15:35:30 +0000 (15:35 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 48321

package/network/utils/linux-atm/Makefile
package/network/utils/linux-atm/files/br2684-up [new file with mode: 0644]
package/network/utils/linux-atm/files/br2684ctl

index 9c6cfec95cf5c14d92c912a92652763ba8785f82..e081428eb03a8092552ceba56fd4552312242aa1 100644 (file)
@@ -178,10 +178,10 @@ define Package/atm-diagnostics/install
 endef
 
 define Package/br2684ctl/install
-       $(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/hotplug.d/atm
+       $(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/hotplug.d/atm $(1)/usr/sbin $(1)/lib/netifd
+       $(INSTALL_BIN) ./files/br2684-up $(1)/lib/netifd/br2684-up
        $(INSTALL_BIN) ./files/br2684ctl $(1)/etc/init.d/
        $(INSTALL_DATA) ./files/atm.hotplug $(1)/etc/hotplug.d/atm/00-trigger
-       $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) \
                ./files/br2684ctl_wrap \
                $(PKG_INSTALL_DIR)/usr/sbin/br2684ctl \
diff --git a/package/network/utils/linux-atm/files/br2684-up b/package/network/utils/linux-atm/files/br2684-up
new file mode 100644 (file)
index 0000000..ba1d670
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+. /lib/functions/network.sh
+network_ready_device "$1"
index 1cac4df04d3713665f31063740e7cf4a987dff26..0fa86bdefde9471a0505a11470b15944567bd628 100755 (executable)
@@ -60,20 +60,11 @@ start_daemon() {
        procd_set_param command \
                /usr/sbin/br2684ctl_wrap "nas$unit" \
                -c "$unit" -e "$encaps" -p "$payload" \
-               -a "$circuit" ${qos:+-q "$qos"} ${sendsize:+-s "$sendsize"}
+               -a "$circuit" ${qos:+-q "$qos"} ${sendsize:+-s "$sendsize"} \
+               -S /lib/netifd/br2684-up
        procd_close_instance
 }
 
-service_running() {
-       . /lib/functions/network.sh
-
-       sleep 1
-       for path in /sys/class/net/nas*; do
-               dev="${path##*/}"
-               network_ready_device "$dev"
-       done
-}
-
 service_triggers() {
        local script=$(readlink "$initscript")
        local name=$(basename ${script:-$initscript})