mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2025-07-01 17:09:47 +00:00
Start to parameterize the Binding values, so users can select them or not.
This commit is contained in:
parent
9d78ea2ea6
commit
adaa3ccf0b
@ -63,30 +63,54 @@ wait_wlan() {
|
|||||||
rename_interface() {
|
rename_interface() {
|
||||||
##Fool iCamera by renaming the hardline interface to wlan0
|
##Fool iCamera by renaming the hardline interface to wlan0
|
||||||
echo "renaming interfaces"
|
echo "renaming interfaces"
|
||||||
|
|
||||||
# Bring all interfaces down
|
|
||||||
ifconfig $1 down
|
ifconfig $1 down
|
||||||
ifconfig wlan0 down
|
ifconfig wlan0 down
|
||||||
ifconfig bond0 down
|
|
||||||
|
|
||||||
# Rename the real wlan0 interface
|
|
||||||
/opt/wz_mini/bin/busybox ip link set wlan0 name wlanold
|
/opt/wz_mini/bin/busybox ip link set wlan0 name wlanold
|
||||||
/opt/wz_mini/bin/busybox ip addr flush dev wlanold
|
/opt/wz_mini/bin/busybox ip addr flush dev wlanold
|
||||||
|
/opt/wz_mini/bin/busybox ip link set $1 name wlan0
|
||||||
|
eth_wlan_up
|
||||||
|
}
|
||||||
|
|
||||||
# Have to bring bond0 up to be able to bond our slaves.
|
rename_interface_and_setup_bonding() {
|
||||||
/opt/wz_mini/bin/busybox ip link set bond0 up
|
##Fool iCamera by renaming the hardline interface to wlan0
|
||||||
|
## $1 Bonding Interface, $2 Primary Interface, $3 Secondary Interface
|
||||||
|
bonding_interface=$1
|
||||||
|
primary_interface=$2
|
||||||
|
secondary_interface=$3
|
||||||
|
|
||||||
|
echo "renaming interfaces"
|
||||||
|
|
||||||
|
# Bring all interfaces down
|
||||||
|
ifconfig $bonding_interface down
|
||||||
|
ifconfig $primary_interface down
|
||||||
|
ifconfig $secondary_interface down
|
||||||
|
|
||||||
|
# Have to bring bonding interface up to be able to bond our slaves.
|
||||||
|
/opt/wz_mini/bin/busybox ip link set $bonding_interface up
|
||||||
|
|
||||||
|
# Rename the real wlan0 interface if needed/used
|
||||||
|
if [[ "$primary_interface" == "wlan0" ]]; then
|
||||||
|
/opt/wz_mini/bin/busybox ip link set $primary_interface name wlanold
|
||||||
|
/opt/wz_mini/bin/busybox ip addr flush dev wlanold
|
||||||
|
primary_interface="wlanold"
|
||||||
|
fi
|
||||||
|
if [[ "$secondary_interface" == "wlan0" ]]; then
|
||||||
|
/opt/wz_mini/bin/busybox ip link set $secondary_interface name wlanold
|
||||||
|
/opt/wz_mini/bin/busybox ip addr flush dev wlanold
|
||||||
|
secondary_interface="wlanold"
|
||||||
|
fi
|
||||||
|
|
||||||
# Enslave the Ethernet and Original Wifi interfaces
|
# Enslave the Ethernet and Original Wifi interfaces
|
||||||
# under the Bonding interface.
|
# under the bonding interface.
|
||||||
/opt/wz_mini/tmp/.bin/ifenslave bond0 eth0 wlanold
|
/opt/wz_mini/tmp/.bin/ifenslave $bonding_interface $primary_interface $secondary_interface
|
||||||
|
|
||||||
# Have to bring bond0 down to be rename the interface
|
# Have to bring bonding interface down to be rename the interface
|
||||||
/opt/wz_mini/bin/busybox ip link set bond0 down
|
/opt/wz_mini/bin/busybox ip link set $bonding_interface down
|
||||||
|
|
||||||
# Name the bond0 interface to be the "new" wlan0 interface
|
# Name the bonding interface to be the "new" wlan0 interface
|
||||||
/opt/wz_mini/bin/busybox ip link set bond0 name wlan0
|
/opt/wz_mini/bin/busybox ip link set $bonding_interface name wlan0
|
||||||
|
|
||||||
# Bring the newly renamed wlan0 back up
|
# Bring the newly renamed wlan0 (actually the bond interface) back up
|
||||||
eth_wlan_up
|
eth_wlan_up
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,10 +120,12 @@ eth_wlan_up() {
|
|||||||
pkill udhcpc
|
pkill udhcpc
|
||||||
udhcpc -i wlan0 -x hostname:$HOSTNAME -p /var/run/udhcpc.pid -b
|
udhcpc -i wlan0 -x hostname:$HOSTNAME -p /var/run/udhcpc.pid -b
|
||||||
|
|
||||||
# Kill any existing wpa_supplicant that might be running
|
# If running with Interface Bonding enabled, kill any existing
|
||||||
# and spawn our own instead
|
# wpa_supplicant that might be running and spawn our own instead
|
||||||
|
if [[ "$BONDING_ENABLED" == "true" ]]; then
|
||||||
/opt/wz_mini/bin/busybox killall wpa_supplicant
|
/opt/wz_mini/bin/busybox killall wpa_supplicant
|
||||||
wpa_supplicant -D nl80211 -i wlanold -c /tmp/wpa_supplicant.conf -B -s
|
wpa_supplicant -D nl80211 -i wlanold -c /tmp/wpa_supplicant.conf -B -s
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$V2" == "true" ]]; then
|
if [[ "$V2" == "true" ]]; then
|
||||||
mount -o bind /opt/wz_mini/bin/wpa_cli.sh /system/bin/wpa_cli
|
mount -o bind /opt/wz_mini/bin/wpa_cli.sh /system/bin/wpa_cli
|
||||||
@ -134,8 +160,12 @@ wlanold_check() {
|
|||||||
eth_wlan_up
|
eth_wlan_up
|
||||||
else
|
else
|
||||||
echo "wlanold doesn't exist"
|
echo "wlanold doesn't exist"
|
||||||
|
if [[ "$BONDING_ENABLED" == "true" ]]; then
|
||||||
|
rename_interface_and_setup_bonding bond0 "$BONDING_PRIMARY_INTERFACE" "$BONDING_SECONDARY_INTERFACE"
|
||||||
|
else
|
||||||
rename_interface $1
|
rename_interface $1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
netloop() {
|
netloop() {
|
||||||
@ -250,8 +280,10 @@ if [[ "$ENABLE_USB_ETH" == "true" ]]; then
|
|||||||
insmod $KMOD_PATH/kernel/drivers/net/usb/$i.ko
|
insmod $KMOD_PATH/kernel/drivers/net/usb/$i.ko
|
||||||
done
|
done
|
||||||
|
|
||||||
# Insert the bonding driver when running Ethernet
|
if [[ "$BONDING_ENABLED" == "true" ]]; then
|
||||||
insmod $KMOD_PATH/kernel/drivers/net/bonding/bonding.ko mode=active-backup miimon=100 downdelay=5000 updelay=5000 primary=eth0
|
# Insert the bonding driver if requested
|
||||||
|
insmod $KMOD_PATH/kernel/drivers/net/bonding/bonding.ko mode=active-backup miimon="$BONDING_LINK_MONITORING_FREQ_MS" downdelay="$BONDING_DOWN_DELAY_MS" updelay="$BONDING_UP_DELAY_MS" primary="$BONDING_PRIMARY_INTERFACE"
|
||||||
|
fi
|
||||||
|
|
||||||
swap_enable
|
swap_enable
|
||||||
|
|
||||||
|
@ -32,6 +32,14 @@ ENABLE_IPTABLES="false"
|
|||||||
|
|
||||||
ENABLE_NFSv4="false"
|
ENABLE_NFSv4="false"
|
||||||
|
|
||||||
|
##### NETWORK INTERFACE BONDING #####
|
||||||
|
BONDING_ENABLED="true"
|
||||||
|
BONDING_PRIMARY_INTERFACE="eth0"
|
||||||
|
BONDING_SECONDARY_INTERFACE="wlan0"
|
||||||
|
BONDING_LINK_MONITORING_FREQ_MS="100"
|
||||||
|
BONDING_DOWN_DELAY_MS="5000"
|
||||||
|
BONDING_UP_DELAY_MS="5000"
|
||||||
|
|
||||||
#####ACCESSORIES#####
|
#####ACCESSORIES#####
|
||||||
REMOTE_SPOTLIGHT="false"
|
REMOTE_SPOTLIGHT="false"
|
||||||
REMOTE_SPOTLIGHT_HOST="0.0.0.0"
|
REMOTE_SPOTLIGHT_HOST="0.0.0.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user