From 70bea9edbd0b6dd5d62a8c3bb07003c623c99c2e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 8 Oct 2016 13:42:47 +0100 Subject: [PATCH] v11 --- config/network/interfaces.default | 2 +- scripts/firstrun | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/config/network/interfaces.default b/config/network/interfaces.default index b9c7a030a3..face963a31 100644 --- a/config/network/interfaces.default +++ b/config/network/interfaces.default @@ -22,7 +22,7 @@ iface wlan0 inet dhcp # wireless-key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # wpa-psk xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # to generate a secure encrypted key: wpa_passphrase yourSSID yourpassword -# Disable power saving on most chipsets (prevents SSH/connection dropouts) +# Disable power saving on compatible chipsets (prevents SSH/connection dropouts over WiFi) wireless-mode Managed wireless-power off diff --git a/scripts/firstrun b/scripts/firstrun index 0c871fac54..2f1928aca5 100644 --- a/scripts/firstrun +++ b/scripts/firstrun @@ -271,7 +271,7 @@ do_firstrun_automated_user_configuration() { #----------------------------------------------------------------------------- #Set Network - # - Get 1st active index of wlan and eth adapters + # - Get 1st index of available wlan and eth adapters local fp_ifconfig_tmp='/tmp/.ifconfig' ifconfig -a > "$fp_ifconfig_tmp" #export to file, should be quicker in loop than calling ifconfig each time. @@ -331,9 +331,21 @@ do_firstrun_automated_user_configuration() { #Disable powersaving for known chips that suffer from powersaving features causing connection dropouts. # This is espically true for the 8192cu and 8188eu. - #FOURDEE: This may be better located as a default setting in ARMbian. - echo -e "options 8192cu rtw_power_mgnt=0" > /etc/modprobe.d/8192cu.conf - echo -e "options 8188eu rtw_power_mgnt=0" > /etc/modprobe.d/8188eu.conf + #FOURDEE: This may be better located as default in ARMbian during build (eg: common), as currently, not active until after a reboot. + # - Realtek | all use the same option, so create array. + local realtek_array=( + "8192cu" + "8188eu" + ) + + for ((i=0; i<${#realtek_array[@]}; i++)) + do + + echo -e "options ${realtek_array[$i]} rtw_power_mgnt=0" > /etc/modprobe.d/realtek_"${realtek_array[$i]}".conf + + done + + unset realtek_array # - Ethernet enable elif (( $FR_net_ethernet_enabled )); then @@ -411,7 +423,8 @@ main() { # old distros can't handle allow-hotplug if [[ "$DISTRIBUTION" == "wheezy" || "$DISTRIBUTION" == "trusty" ]]; then - sed -i "s/allow-hotplug eth0/auto eth0/" /etc/network/interfaces + sed -i "s/allow-hotplug eth/auto eth/" /etc/network/interfaces + sed -i "s/allow-hotplug wlan/auto wlan/" /etc/network/interfaces fi # some hardware workarounds