🌴 Sync 2026-03-05 23:51:42

This commit is contained in:
github-actions[bot] committed 2026-03-05 23:51:42 +08:00
1 parent 97c049ed0a
commit 0acff03804
14253 files changed
+3893239

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
#
# Copyright (C) 2018-2023 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# Originally made by DairyMan@Whirlpool come from https://github.com/ofmodemsandmen/ROOterSource2305/tree/main/package/rooter/0routerspecfic/z8102
#
include $(TOPDIR)/rules.mk
PKG_NAME:=z8102
PKG_VERSION:=0.2
PKG_RELEASE:=1
PKG_MAINTAINER:=Yannick Chabanois <contact@openmptcprouter.com>
include $(INCLUDE_DIR)/package.mk
define Package/z8102
SECTION:=OMR
CATEGORY:=OpenMPTCProuter
TITLE:=Install scripts for z8102
DEPENDS:=+gpiod-tools
PKGARCH:=all
endef
define Package/z8102/description
Helper scripts to install scripts for z8102
endef
define Build/Compile
endef
define Package/z8102/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,z8102))
+73
View File
@@ -0,0 +1,73 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2013 OpenWrt.org
# Copyright (C) 2023-2025 Yannick Chabanois (Ycarus) for OpenMPTCProuter
START=00
USE_PROCD=1
log() {
logger -t "z8102" "$@"
}
modem_reset()
{
modemnb=$1
# sim
if [ -e /sys/class/gpio/sim${modemnb}/value ]; then
echo "0" > /sys/class/gpio/sim${modemnb}/value
elif [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "sim=${modemnb}"`=0
else
gpioset -t0 sim${modemnb}=0
fi
# stop modem
if [ -e /sys/class/gpio/modem${modemnb}/value ]; then
echo "0" > /sys/class/gpio/modem${modemnb}/value
elif [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "modem${modemnb}"`=0
else
gpioset -t0 modem${modemnb}=0
fi
sleep 1
# run modem
if [ -e /sys/class/gpio/modem${modemnb}/value ]; then
echo "1" > /sys/class/gpio/modem${modemnb}/value
elif [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "modem${modemnb}"`=1
else
gpioset -t0 modem${modemnb}=1
fi
}
start_service()
{
modem="$1"
if [ -z "$modem" ]; then
log "Enable SIMs and reboot modems..."
modem_reset 1
modem_reset 2
if [ -n "$(cat /etc/board.json | grep z8109)" ]; then
modem_reset 3
modem_reset 4
fi
elif [ "$modem" = "modem1" ]; then
log "Enable SIM1 and reboot modem1..."
modem_reset 1
elif [ "$modem" = "modem2" ]; then
log "Enable SIM2 and reboot modem2..."
modem_reset 2
elif [ "$modem" = "modem3" ]; then
log "Enable SIM3 and reboot modem3..."
modem_reset 3
elif [ "$modem" = "modem4" ]; then
log "Enable SIM4 and reboot modem4..."
modem_reset 4
fi
}
restart()
{
start_service "$@"
}
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2013 OpenWrt.org
# Copyright (C) 2023 Yannick Chabanois (Ycarus) for OpenMPTCProuter
START=01
USE_PROCD=1
log() {
logger -t "z8102-wdg" "$@"
}
start_service()
{
# watchdog
procd_open_instance
procd_set_param command /usr/lib/custom/wdg.sh
procd_set_param respawn
procd_close_instance
}
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
#i=457
#echo $i > /sys/class/gpio/export
#echo "out" > /sys/class/gpio/gpio${i}/direction
while true
do
#echo "1" > /sys/class/gpio/gpio${i}/value
if [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "watchdog"`=1 2>&1 >/dev/null
else
gpioset -t0 watchdog=1 2>&1 >/dev/null
fi
sleep 1
#echo "0" > /sys/class/gpio/gpio${i}/value
if [ -f /usr/bin/gpiofind ]; then
gpioset `gpiofind "watchdog"`=0 2>&1 >/dev/null
else
gpioset -t0 watchdog=0 2>&1 >/dev/null
fi
sleep 1
done