Files
wyze-firmware/SD_ROOT/wz_mini/etc/rc.d/S04usbdirect
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

55 řádky
1.4 KiB
Bash

#!/bin/sh
### BEGIN INIT INFO
# Provides:
# Short-Description: USB Direct Networking
# Description: Enable USB Direct Networking kernel modules and support
### 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_DIRECT" == "true" ]]; then
HOST_MACADDR=$(echo "$CUSTOM_HOSTNAME"|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
if [ -f /opt/wz_mini/tmp/.T20 ]; then
echo connect > /sys/devices/platform/jz-dwc2/dwc2/udc/dwc2/soft_connect
sleep 1
devmem 0x10000040 32 0x0b800096
sleep 1
devmem 0x13500000 32 0x001100cc
else
echo "Set dwc2 ID_PIN driver memory"
devmem 0x13500000 32 0x001100cc
devmem 0x10000040 32 0x0b000096
echo "wipe dwc2 memory bits to set the ID_PIN, only for the V3"
devmem 0x10000040 32 0x0b000FFF
fi
insmod $KMOD_PATH/kernel/drivers/usb/gadget/libcomposite.ko
if [ -f /opt/wz_mini/tmp/.T31 ]; then
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/usb/gadget/u_ether.ko
insmod /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/kernel/drivers/usb/gadget/usb_f_ncm.ko
fi
insmod $KMOD_PATH/kernel/drivers/usb/gadget/g_ncm.ko iManufacturer=wz_mini_ncm host_addr="$HOST_MACADDR" dev_addr="$USB_DIRECT_MAC_ADDR"
echo "USB Direct enabled"
else
echo "USB Direct disabled"
fi
;;
*)
echo "Usage: $0 {start}"
exit 1
;;
esac