ファイル
wyze-firmware/SD_ROOT/wz_mini/etc/rc.d/S03ethernet
T
gtxaspec 9ce6bbd92a New init system (#216)
* new init system

* update new init scripts

* update checksum

* fix broken audio promps with new init scripts

* fix debug/upgrade mode

* fix bonding and eth0 hw addr

* add checksum

* fix bonding setup

* add rtsp auth disable

* adjust network init scripts path

* recreated repo and re added cron scripts (#211)

* recreated repo and re added cron scripts

* rename cron script and move it to the right folder.

* Delete .vs directory

remove .vs directory

* add deubg message to bonding rc.d script

* add crontab variable to wz_mini.conf

* fix mp4write

* add syslog debug feature

* fix syslog init blocking

* fix syslog save function

* increase imp_helper rerun delay

* update init scripts

* fix bonding and usb-direct

* update checksum

* add netmon for bonding

* fix supervisor function

* update model detection

* fix debugging injection on T20 devices

Co-authored-by: sideup66 <47700565+sideup66@users.noreply.github.com>
2022-08-07 18:46:00 -07:00

72 行
2.4 KiB
Bash

#!/bin/sh
### BEGIN INIT INFO
# Provides:
# Short-Description: USB Ethernet Support
# Description: Enable USB Ethernet adapter support and kernel module
### END INIT INFO
. /opt/wz_mini/etc/rc.common
. /opt/wz_mini/wz_mini.conf
case "$1" in
start)
echo "#####$(basename "$0")#####"
if [[ "$ENABLE_USB_ETH" == "true" ]]; then
insmod $KMOD_PATH/kernel/drivers/net/usb/usbnet.ko
echo "Auto-Detect an Ethernet Driver and load it"
if [[ "$ENABLE_USB_ETH_MODULE_AUTODETECT" == "true" ]]; then
for DEVICE in `lsusb | awk '{print $6}'| tr '[:upper:]' '[:lower:]'`; do
case $DEVICE in
'077b:2226' | '0846:1040' | '2001:1a00' | '0b95:1720' | '07b8:420a' |\
'08dd:90ff' | '0557:2009' | '0411:003d' | '0411:006e' | '6189:182d' |\
'0df6:0056' | '07aa:0017' | '1189:0893' | '1631:6200' | '04f1:3008' |\
'17ef:7203' | '0b95:772b' | '0b95:7720' | '0b95:1780' | '0789:0160' |\
'13b1:0018' | '1557:7720' | '07d1:3c05' | '2001:3c05' | '2001:1a02' |\
'1737:0039' | '04bb:0930' | '050d:5055' | '05ac:1402' | '0b95:772a' |\
'14ea:ab11' | '0db0:a877' | '0b95:7e2b' | '0b95:172a' | '066b:20f9')
echo "Loading ASIX Ethernet driver..."
modprobe asix
;;
'0b95:1790' | '0b95:178a' | '0df6:0072')
echo "Loading AX88179 Gigabit Ethernet driver..."
modprobe ax88179_178a
;;
'1004:61aa' | '046d:c11f' | '1410:b001' | '1410:9010' | '413c:8195' |\
'413c:8196' | '413c:819b' | '16d5:650a' | '12d1:14ac')
echo "Loading USB CDC Ethernet driver..."
modprobe cdc_ether
;;
'0bda:8152')
echo "Loading Realtek RTL8152 driver..."
modprobe r8152
;;
esac
done
fi
echo "Manually load any other Ethernet Drivers if asked for"
if [[ "$ENABLE_USB_ETH_MODULE_MANUAL" != "" ]]; then
for i in $(echo "$ENABLE_USB_ETH_MODULE_MANUAL" | tr "," "\n")
do
insmod $KMOD_PATH/kernel/drivers/net/usb/$i.ko
done
fi
cat /sys/class/net/eth0/address | tr '[:lower:]' '[:upper:]' > /opt/wz_mini/tmp/eth0_mac
else
echo "USB Ethernet disabled"
fi
;;
*)
echo "Usage: $0 {start}"
exit 1
;;
esac