update bonding functions, add fail_over_mac option

This commit is contained in:
Alfonso Gamboa 2022-06-26 20:02:06 -07:00
parent 2a0515761f
commit 65e839b6a9
4 changed files with 45 additions and 44 deletions

View File

@ -117,6 +117,33 @@ rename_interface_and_setup_bonding() {
eth_wlan_up
}
bonding_setup() {
echo "bonding kernel module setup"
if [[ "$BONDING_ENABLED" == "true" ]]; then
if [[ "$BONDING_LINK_MONITORING_FREQ_MS" == "" ]]; then
BONDING_LINK_MONITORING_FREQ_MS="100"
fi
if [[ "$BONDING_DOWN_DELAY_MS" == "" ]]; then
BONDING_DOWN_DELAY_MS="5000"
fi
if [[ "$BONDING_UP_DELAY_MS" == "" ]]; then
BONDING_UP_DELAY_MS="5000"
fi
if [[ "$BONDING_PRIMARY_INTERFACE" == "" ]]; then
BONDING_PRIMARY_INTERFACE="$1"
fi
if [[ "$BONDING_SECONDARY_INTERFACE" == "" ]]; then
BONDING_SECONDARY_INTERFACE="$2"
fi
if [[ "$BONDING_FAIL_OVER_MAC" == "" ]]; then
BONDING_FAIL_OVER_MAC="0"
fi
# Insert the bonding driver into the kernel
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" fail_over_mac="$BONDING_FAIL_OVER_MAC"
fi
}
eth_wlan_up() {
##Run DHCP client, and bind mount our fake wpa_cli.sh to fool iCamera
ifconfig wlan0 up
@ -282,26 +309,7 @@ if [[ "$ENABLE_USB_ETH" == "true" ]]; then
insmod $KMOD_PATH/kernel/drivers/net/usb/$i.ko
done
if [[ "$BONDING_ENABLED" == "true" ]]; then
if [[ "$BONDING_LINK_MONITORING_FREQ_MS" == "" ]]; then
"$BONDING_LINK_MONITORING_FREQ_MS" = "100"
fi
if [[ "$BONDING_DOWN_DELAY_MS" == "" ]]; then
"$BONDING_DOWN_DELAY_MS" = "5000"
fi
if [[ "$BONDING_UP_DELAY_MS" == "" ]]; then
"$BONDING_UP_DELAY_MS" = "5000"
fi
if [[ "$BONDING_PRIMARY_INTERFACE" == "" ]]; then
"$BONDING_PRIMARY_INTERFACE" = "eth0"
fi
if [[ "$BONDING_SECONDARY_INTERFACE" == "" ]]; then
"$BONDING_SECONDARY_INTERFACE" = "wlan0"
fi
# Insert the bonding driver into the kernel
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
bonding_setup eth0 wlan0
swap_enable
@ -340,26 +348,7 @@ if [[ "$ENABLE_USB_DIRECT" == "true" ]]; then
sleep 1
if [[ "$BONDING_ENABLED" == "true" ]]; then
if [[ "$BONDING_LINK_MONITORING_FREQ_MS" == "" ]]; then
"$BONDING_LINK_MONITORING_FREQ_MS" = "100"
fi
if [[ "$BONDING_DOWN_DELAY_MS" == "" ]]; then
"$BONDING_DOWN_DELAY_MS" = "5000"
fi
if [[ "$BONDING_UP_DELAY_MS" == "" ]]; then
"$BONDING_UP_DELAY_MS" = "5000"
fi
if [[ "$BONDING_PRIMARY_INTERFACE" == "" ]]; then
"$BONDING_PRIMARY_INTERFACE" = "usb0"
fi
if [[ "$BONDING_SECONDARY_INTERFACE" == "" ]]; then
"$BONDING_SECONDARY_INTERFACE" = "wlan0"
fi
# Insert the bonding driver into the kernel
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
bonding_setup usb0 wlan0
swap_enable

View File

@ -32,7 +32,17 @@ ENABLE_IPTABLES="false"
ENABLE_NFSv4="false"
ENABLE_RTL8189FS_DRIVER="false"
ENABLE_RTL8189FS_DRIVER="true"
ENABLE_ATBM603X_DRIVER="true"
##### NETWORK INTERFACE BONDING #####
BONDING_ENABLED="false"
BONDING_PRIMARY_INTERFACE="eth0"
BONDING_SECONDARY_INTERFACE="wlan0"
BONDING_LINK_MONITORING_FREQ_MS="100"
BONDING_DOWN_DELAY_MS="5000"
BONDING_UP_DELAY_MS="5000"
BONDING_FAIL_OVER_MAC="0"
#####ACCESSORIES#####
REMOTE_SPOTLIGHT="false"
@ -76,6 +86,7 @@ ENABLE_CIFS="false"
DISABLE_FW_UPGRADE="false"
AUDIO_PROMPT_VOLUME="50"
ENABLE_MP4_WRITE="false"
NIGHT_DROP_DISABLE="false"
#####DEBUG#####
#drops you to a shell via serial, doesn't load app_init.sh

View File

@ -42,6 +42,7 @@ BONDING_SECONDARY_INTERFACE="wlan0"
BONDING_LINK_MONITORING_FREQ_MS="100"
BONDING_DOWN_DELAY_MS="5000"
BONDING_UP_DELAY_MS="5000"
BONDING_FAIL_OVER_MAC="0"
#####ACCESSORIES#####
REMOTE_SPOTLIGHT="false"

View File

@ -4,11 +4,11 @@ d41d8cd98f00b204e9800998ecf8427e SD_ROOT/wz_mini/mnt/.gitignore
34c6a4c3a941ff2becd9f487826d7692 SD_ROOT/wz_mini/etc/uvc.config
ad7d1a2f9db3079617731b5854ce3b6a SD_ROOT/wz_mini/etc/init.d/wz_cam.sh
0774518c06d6ef8e7181d35f194777cc SD_ROOT/wz_mini/etc/init.d/wz_init.sh
4805abc167689c2e236f8203cfabb0d5 SD_ROOT/wz_mini/etc/init.d/wz_user.sh
3fd0f9fe7d0a321fb16e0b47ddc4789d SD_ROOT/wz_mini/etc/init.d/wz_user.sh
b0f094a80f7ab79fdf26b0e359ab68db SD_ROOT/wz_mini/etc/init.d/wz_post.sh
e3034eac02d8eda9902ca9cf89f0a586 SD_ROOT/wz_mini/etc/inittab
840aa9c26726201f7cffbf001bee193a SD_ROOT/wz_mini/etc/uvc_jxf22.config
2609cae8b3b084d83e84299528d8bc93 SD_ROOT/wz_mini/etc/wz_mini.conf.dist
f83ed621e60de66f1e6e36c85650484c SD_ROOT/wz_mini/etc/wz_mini.conf.dist
8b5e58acfcbb20034dc4873a08b45fd9 SD_ROOT/wz_mini/etc/profile
2c2df1b9cb603f9c31c46162d6ac307f SD_ROOT/wz_mini/etc/alsa/alsa.conf
9e5591da95042bcca910403bde25dc60 SD_ROOT/wz_mini/etc/fstab
@ -193,7 +193,7 @@ aafb0749425838f41e68ecced758ab6c SD_ROOT/wz_mini/lib/modules/3.10.14__isvp_swan
14865a6e2e2df87a8362c6f20377a934 SD_ROOT/wz_mini/lib/libtinyalsa.so.2
bd383994491e4bdca81788c168feb2eb SD_ROOT/wz_mini/lib/libasound.so.2
f6f0d5a9ebd916de6bdb9695067809ae SD_ROOT/wz_mini/lib/libaudioProcess.so
d756ed6cdc899cc7d75afc2a97727d33 SD_ROOT/wz_mini/wz_mini.conf
f83ed621e60de66f1e6e36c85650484c SD_ROOT/wz_mini/wz_mini.conf
d41d8cd98f00b204e9800998ecf8427e SD_ROOT/wz_mini/tmp/.gitignore
00b99816217a740f5169709ef01eddf6 v2_install/compile_image.sh
ff15869fe24297b9a5f75335a458a44f v2_install/fw_tool.sh