From: Travis Kemen Date: Sun, 6 Sep 2009 17:02:14 +0000 (+0000) Subject: fix nonhotpluggable networks not being brought up. Closes #2781 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=27915ac778c7b142a5fe9a8db977e2d89706d3f2;p=openwrt%2Fstaging%2Fwigyori.git fix nonhotpluggable networks not being brought up. Closes #2781 SVN-Revision: 17527 --- diff --git a/package/base-files/files/etc/init.d/network b/package/base-files/files/etc/init.d/network index e77db02517..75103ec073 100755 --- a/package/base-files/files/etc/init.d/network +++ b/package/base-files/files/etc/init.d/network @@ -4,7 +4,18 @@ START=40 STOP=40 +config_cb() { + local cfg_type="$1" + + case "$cfg_type" in + interface) + append networks "$2" "$N" + ;; + esac +} + boot() { + uci_load network setup_switch() { return 0; } include /lib/network @@ -12,6 +23,10 @@ boot() { [ -s /etc/config/wireless ] || \ /sbin/wifi detect > /etc/config/wireless /sbin/wifi up + for network in $networks; do + config_get startupcheck $network started + [ "$startupcheck" = "" ] && ifup $network + done } start() { diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh index bfadf40c89..12a3378b8c 100755 --- a/package/base-files/files/lib/network/config.sh +++ b/package/base-files/files/lib/network/config.sh @@ -153,6 +153,7 @@ set_interface_ifname() { config_get device "$1" device uci_set_state network "$config" ifname "$ifname" uci_set_state network "$config" device "$device" + uci_set_state network "$config" started 1 } setup_interface_none() { diff --git a/package/base-files/files/usr/share/udhcpc/default.script b/package/base-files/files/usr/share/udhcpc/default.script index b32b2c9f25..ea0a28b3ae 100755 --- a/package/base-files/files/usr/share/udhcpc/default.script +++ b/package/base-files/files/usr/share/udhcpc/default.script @@ -203,6 +203,7 @@ for ifc in $interfaces __default; do config_get ifname "$ifc" ifname config_get aliases "$ifc" aliases uci_revert_state network "$ifc" + uci_set_state network "$ifc" started 1 [ -n "$device" ] && uci_set_state network "$ifc" device "$device" [ -n "$ifname" ] && uci_set_state network "$ifc" ifname "$ifname" [ -n "$aliases" ] && uci_set_state network "$ifc" aliases "$aliases"