diff --git a/board/common/overlay/etc/init.d/S35wifi b/board/common/overlay/etc/init.d/S35wifi index ce09558d03..b0f0f870f5 100755 --- a/board/common/overlay/etc/init.d/S35wifi +++ b/board/common/overlay/etc/init.d/S35wifi @@ -79,7 +79,6 @@ start() { if [ $count -gt $link_watch_timeout ] || ! pidof wpa_supplicant > /dev/null; then msg_fail - reboot return 1 fi @@ -119,5 +118,7 @@ case "$1" in exit 1 esac -exit $? +# continue after an unsuccessfull wifi start +# as we may still have an ethernet connection available +exit 0 diff --git a/board/common/overlay/etc/init.d/S40network b/board/common/overlay/etc/init.d/S40network index 8c117368ab..2c3eff3be4 100755 --- a/board/common/overlay/etc/init.d/S40network +++ b/board/common/overlay/etc/init.d/S40network @@ -102,7 +102,7 @@ start_eth() { count=$(($count + 1)) if [ $count -ge 3 ]; then msg_done "no device" - return + return 1 fi done @@ -116,7 +116,7 @@ start_eth() { count=$(($count + 1)) if [ $count -ge 3 ]; then msg_done "no link" - return + return 1 fi done @@ -127,7 +127,7 @@ start_eth() { count=$(($count + 1)) if [ $count -ge $link_nego_timeout ]; then msg_done "no link" - return + return 1 fi done @@ -157,13 +157,20 @@ start() { start_lo - test -n "$ssid" && start_wlan + test -n "$ssid" && start_wlan && wlan_ok="ok" - # if wifi or ppp connection configured, start eth in background - if [ -n "$ssid" ] || [ -r /data/etc/ppp/modem ]; then + test -r /data/etc/ppp/modem && ppp_ok="ok" # TODO actually test the ppp link + + # if wifi or ppp link ok, start eth in background + if [ "$wlan_ok" == "ok" ] || [ "$ppp_ok" == "ok" ]; then start_eth &>/dev/null & else - start_eth + start_eth && eth_ok="ok" + fi + + if [ "$eth_ok" != "ok" ] && [ "$wlan_ok" != "ok" ] && [ "$ppp_ok" != "ok" ]; then + reboot + return 1 fi if [ -n "$static_gw" ]; then diff --git a/board/common/overlay/etc/init.d/rcK b/board/common/overlay/etc/init.d/rcK index 90d77ec140..57424ee304 100755 --- a/board/common/overlay/etc/init.d/rcK +++ b/board/common/overlay/etc/init.d/rcK @@ -12,7 +12,7 @@ echo "---- shutting down $os_name $os_version ----" >> $boot_log (for i in $(ls -r /etc/init.d/S??*); do [ ! -x "$i" ] && continue [ -f /data/etc/no_$(basename $i) ] && continue - $i stop + $i stop || break done& echo $! > $pid_file) | tee -a $boot_log & pid=$(cat $pid_file) diff --git a/board/common/overlay/etc/init.d/rcS b/board/common/overlay/etc/init.d/rcS index 4ef21aaf4f..c4079c65d0 100755 --- a/board/common/overlay/etc/init.d/rcS +++ b/board/common/overlay/etc/init.d/rcS @@ -13,7 +13,7 @@ echo "---- booting $os_name $os_version----" >> $tmp_boot_log (for i in /etc/init.d/S??*; do [ ! -x "$i" ] && continue [ -f /data/etc/no_$(basename $i) ] && continue - $i start + $i start || break done& echo $! > $pid_file) | tee -a $tmp_boot_log & pid=$(cat $pid_file)