111 Commits
cudy ... 2410

Author SHA1 Message Date
d1eb177dc8 delete logs 2025-07-13 18:17:18 +08:00
bb1ee36d6b 1
Signed-off-by: nanako <469449812@qq.com>
2025-07-13 17:08:29 +08:00
632b823164 更新配置文件,添加zeroteri网络接口和wwan2网络接口 2025-06-23 11:15:02 +08:00
2e478239b8 提交配置文件 2025-06-23 11:11:52 +08:00
dcc1e49fa2 移除5g-modem
Signed-off-by: nanako <469449812@qq.com>
2025-06-20 00:46:08 +08:00
df1ac86441 q
Signed-off-by: nanako <469449812@qq.com>
2025-06-19 23:14:56 +08:00
403348dbf1 新增QModem,删除5gsupport
Signed-off-by: nanako <469449812@qq.com>
2025-06-19 23:13:51 +08:00
585e94af91 Merge remote-tracking branch 'remotes/source/2410' into 2410 2025-06-19 23:10:16 +08:00
padavanonly
cadf91a8ae Merge pull request #93 from hanimeia/patch-3
Update ppp-down 解决 随机性断线重拨 无ipv6 问题
2025-06-13 14:21:47 +08:00
padavanonly
daa2c5e1a2 Update mtk_smp.init 2025-06-10 14:04:34 +08:00
padavanonly
f34b24c160 reinit eth0 when boot router 2025-06-08 21:00:07 +08:00
hanimeia
227191e1ec Update ppp-down
解决 随机性断线重拨 无ipv6 问题

sleep 3
2025-06-06 14:12:13 +08:00
padavanonly
0dd61c081e Update mt7981-Airpi-emmc16G.dtsi 2025-06-03 22:48:09 +08:00
padavanonly
293ad685b8 ignore invalid mt7981 phy efuse data 2025-06-02 22:33:36 +08:00
padavanonly
392ce4a55c Update modem 2025-05-30 14:37:50 +08:00
padavanonly
d6d57bccb1 mt5700 unicom isp code 2025-05-27 00:51:28 +08:00
padavanonly
6cd446e104 auto dial eth2 usb device and decrease mt7981 emmc boot time 2025-05-26 02:55:24 +08:00
padavanonly
b0444c69ac modem:excute at commands only when icmp is not answered 2025-05-26 00:38:13 +08:00
padavanonly
9e83cfb34c modem:increase scan interval 2025-05-25 23:40:40 +08:00
padavanonly
512316f742 luci-app-modem:refine fm350 dial apn selection 2025-05-25 17:48:42 +08:00
padavanonly
8882f97e46 luci-app-modem:updategit status 2025-05-25 01:53:08 +08:00
padavanonly
b868f5d855 luci-app-modem:update 2025-05-25 01:41:13 +08:00
padavanonly
0a486b1935 qmodem:try fix fm350 ipv6 2025-05-25 00:00:36 +08:00
padavanonly
62781225f6 add 5g modem depends 2025-05-20 23:21:33 +08:00
padavanonly
fd00166b31 Update qmi_wwan.c 2025-05-20 23:01:32 +08:00
padavanonly
095b3d8b44 Update mt7981-Airpi-emmc16G-common.dtsi 2025-05-20 13:12:35 +08:00
padavanonly
e047b33374 airpi:adjust driver 2025-05-20 00:08:04 +08:00
padavanonly
f1b691464b airpi:add pwm fan gpios 2025-05-19 23:28:09 +08:00
padavanonly
0878b767b9 airpi:add led gpios 2025-05-19 22:43:53 +08:00
padavanonly
828704e09c ext-hnat :fix rps seeting with hotplug and eth2 2025-05-18 03:57:44 +08:00
3e511bb64d Merge remote-tracking branch 'remotes/source/2410' into 2410 2025-05-04 23:55:49 +08:00
padavanonly
b7348f6f67 irq:change irq nonereport threshold 2025-05-02 17:08:54 +08:00
25dc73961e 删除无用的包 2025-04-28 01:05:40 +08:00
c8fe53aac1 Merge remote-tracking branch 'remotes/source/2410' into 2410 2025-04-28 00:59:10 +08:00
padavanonly
14fae94204 Update hnat_nf_hook.c 2025-04-26 21:27:31 +08:00
bcd4c04be8 修改权限 2025-04-26 16:36:57 +08:00
111c26c917 上传编译脚本 2025-04-26 16:32:09 +08:00
padavanonly
cfc9700009 Disable mape_toggle by default 2025-04-21 17:09:50 +08:00
padavanonly
9f71cc4aa5 mediatek:add more depends 2025-04-20 14:28:53 +08:00
padavanonly
a477d9dc86 Merge pull request #64 from dailook/2410
support FORESEE FMSH  Dosilicon GSTO spinand & nor BY25Q256FS
2025-04-20 14:00:47 +08:00
dailook
354a59ab95 FORESEE FMSH Dosilicon GSTO spi & nor BY25Q256FS 2025-04-20 12:20:41 +08:00
padavanonly
991e8f64c1 eqos-mtk:depend on ebtables 2025-04-13 18:29:51 +08:00
padavanonly
1f578f9e51 wget:enable ssl to prevent opkg failure 2025-04-13 17:16:30 +08:00
padavanonly
6868c2971f Update 776-4-net-use-jhash-for-software-skb-hashes.patch 2025-04-13 13:17:32 +08:00
padavanonly
0e1e9efc30 Update Makefile 2025-04-13 13:06:58 +08:00
padavanonly
b564e98f93 mt7986:fresh kconfig 2025-04-12 12:55:58 +08:00
padavanonly
6b154eb3e0 mbim: hnat test 2025-04-10 00:09:58 +08:00
padavanonly
627c38d3cd mediatek usb:add auto ksmbd 2025-04-09 21:31:55 +08:00
padavanonly
ecfb1d4d3b Update 20-smb 2025-04-09 11:31:23 +08:00
padavanonly
d568973b6f en8811h:fix dts 2025-04-08 22:23:51 +08:00
padavanonly
575201b5dc en8811h:use 1.2.5 version 2025-04-08 22:21:27 +08:00
padavanonly
5116de248b Update mt7986a-bananapi-bpi-r3mini-emmc.dts 2025-04-08 13:50:29 +08:00
padavanonly
23bd5c14b3 Update mt7986a-bananapi-bpi-r3mini-emmc.dts 2025-04-08 13:42:25 +08:00
padavanonly
8d607607b5 r3-mini:change phy driver dts setting 2025-04-08 00:34:23 +08:00
padavanonly
af1fbe1186 mt7981:flash kconfig 2025-04-08 00:27:47 +08:00
padavanonly
08d6c2c88a en8811h:add dts param 2025-04-07 23:15:23 +08:00
padavanonly
b754a01b54 bpi-r3-mini:update phy driver 2025-04-07 23:08:05 +08:00
padavanonly
dc6faff864 r3-mini:fix dts setting 2025-04-07 22:35:48 +08:00
padavanonly
9094fd7062 qmi-wwan-q:use bpi version 2025-04-07 11:39:53 +08:00
padavanonly
5a078f2587 Merge pull request #52 from kj54321/2410
[BPI r3 mini] Add support new X75 5G module
2025-04-07 00:16:00 +08:00
padavanonly
916896bc37 qmi:disable raw ip mode 2025-04-06 23:50:11 +08:00
Tinker Dong
42879bb5bc fix xhci node definition for 5G module
- Correct clock and ngff PIN define
- Adjust reg address mapping
- Add missing interrupt-parent

Signed-off-by: Tinker Dong <dong115@uwindsor.ca>
2025-04-06 20:10:23 +08:00
padavanonly
6328bcff5e ncm:increase default buffer size 2025-04-05 19:18:41 +08:00
padavanonly
b5866622bb hnat:fix ethext dev upload offload 2025-04-05 16:13:46 +08:00
padavanonly
a812008f7f Update hnat_nf_hook.c 2025-04-05 15:01:52 +08:00
padavanonly
9f98b85297 rndis:reduce cpu load 2025-04-05 13:39:38 +08:00
padavanonly
352a36cbd0 hnat:refine ppd device setting 2025-04-05 04:20:31 +08:00
padavanonly
8aadb539a5 qmi:use mainline kernel version 2025-04-05 01:35:43 +08:00
padavanonly
f6ae1515c8 qmi:update to 1.2.9 2025-04-05 01:09:07 +08:00
padavanonly
aff06a3800 rax3000m:fix ext dev offload 2025-04-05 00:36:42 +08:00
padavanonly
43f76b7db5 qmi:replace kernel driver to quectel version 2025-04-04 23:37:45 +08:00
padavanonly
e15c4473ef Rename mt7981-Airpi-emmc16G .dts to mt7981-Airpi-emmc16G.dts 2025-04-04 21:23:34 +08:00
padavanonly
8d72f68246 air pi:correct dts name 2025-04-04 21:08:47 +08:00
padavanonly
0325733401 airpi:add dependent packages 2025-04-04 18:29:03 +08:00
padavanonly
403f580f42 airpi:add commiter name 2025-04-04 18:26:57 +08:00
padavanonly
003c461a6d air pi:add default packages 2025-04-04 18:13:26 +08:00
padavanonly
44578d2d3c mediatek: add airr pi support 2025-04-04 17:55:17 +08:00
padavanonly
0bff5735ef Merge pull request #51 from hxlls/2410
更新openssl到3.4.0
2025-04-04 11:14:59 +08:00
hxlls
295085d44e 更新openssl到3.4.0 2025-04-03 00:21:46 +08:00
hxlls
6fbcf59456 Delete package/libs/openssl directory 2025-04-03 00:17:53 +08:00
padavanonly
c8f9b0f83c n60 pro:change eeprom 2025-03-30 19:38:54 +08:00
padavanonly
bcff2bc5be mtk_hnat: fix ppd device not released properly 2025-03-30 14:55:31 +08:00
padavanonly
1213e8d674 n60pro: add default usb packages 2025-03-30 11:43:31 +08:00
padavanonly
2be0c325b2 Update README.md 2025-03-30 11:17:09 +08:00
padavanonly
d4e237fc7f mediatek:add more device from dailook 2025-03-30 11:12:42 +08:00
padavanonly
f07376e5b0 Update README.md 2025-03-30 09:28:08 +08:00
padavanonly
84218bb457 mtk_phy: fix autoneg 2025-03-30 09:19:41 +08:00
padavanonly
bc90209e19 turboacc: support setting ap mode 2025-03-29 12:49:19 +08:00
padavanonly
a68b5be912 wrtbwmon:fix ipv6 statics 2025-03-25 09:03:38 +08:00
padavanonly
af1313911f Merge pull request #38 from fildunsky/2410
Fixed typo
2025-03-24 21:32:30 +08:00
padavanonly
9c29779983 upnp:fix typo 2025-03-24 21:16:47 +08:00
padavanonly
1498e12839 upnp:backport upstream changes 2025-03-24 21:09:57 +08:00
Fil Dunsky
0d02c393e5 Fixed typo 2025-03-24 19:37:47 +07:00
padavanonly
f3302cdc99 Merge pull request #37 from fildunsky/2410
Huasifei WH3000 LAN fix
2025-03-24 17:54:59 +08:00
Fil Dunsky
3c4e606420 Huasifei WH3000 LAN fix
I've managed to fix it copying some parts from Cudy DTS. Now LAN and WAN is working, Wifi also works fine. All MAC addresses are correct. The only thing I am still not sure if USB stuff is correct in this DTS. I don't know how to test it.

When I plug in my external SSD, I got this:
```
xhci-mtk 11200000.xhci: ERROR Transfer event for unknown stream ring slot 1 ep 2
```
I am not sure if it's related to missing kernel modules or DTS itself...

Also I've got this messages during the boot.
```
[   49.268843] efuse_probe: efuse = deaddead
[   49.272914] mt_rbus 0000:00:00.0: Direct firmware load for e2p failed with error -2
[   49.280564] mt_rbus 0000:00:00.0: Falling back to sysfs fallback for: e2p
[   49.293624] WiFi@C01L1,os_load_code_from_bin() 2999: fw not available(/lib/firmware/e2p)
[   49.302582] Use default BIN from:/lib/firmware/MT7981_iPAiLNA_EEPROM.bin.
[   49.309432] 7981@C02L1,rtmp_ee_flash_init() 444: The EEPROM in Flash is wrong, use default
[   49.320246] 7981@C02L1,is_cal_free_ic() 830: [a-die version:1]
[   51.823079] 7981@C17L1,RTMPReadTxPwrPerRate() 450: (450): Don't Support this now!
[   51.830596] 7981@C01L1,AntCfgInit() 3118: Not support for HIF_MT yet!
```
2025-03-24 16:16:50 +07:00
padavanonly
9cac636489 Update mt7986a-bananapi-bpi-r3mini-nand-110m.dts 2025-03-24 15:29:43 +08:00
padavanonly
53e1ee3f8c luci-app-mtk-cfg: correct translation 2025-03-24 15:10:57 +08:00
padavanonly
8f16781733 bpi-r3mini:fix eeprom 2025-03-24 15:08:53 +08:00
padavanonly
a4125470d8 wh3000: correct wifi address 2025-03-23 22:58:12 +08:00
padavanonly
da8e685c29 Merge pull request #34 from fildunsky/2410
mediatek: filogic: add support for Huasifei WH3000
2025-03-23 22:48:07 +08:00
Fil Dunsky
3985bbcc8a mediatek: filogic: add support for Huasifei WH3000
**Huasifei WH3000**
Portable Wi-Fi 6 travel router based on MediaTek MT7981A SoC. MT7981B+MT7976CN+RTL8221B Dual Core 1.3-1.6GHZ

**Specifications**
SoC: Filogic 820 MT7981A (1.3GHz base could be overclocked to 1.6GHz by `unlockoc` in factory firmware it will change a BL image with an overclocked one. If you want to go back to 1.3Ghz, run `lockoc` in factory firmware once)
RAM: DDR4 1GB
Flash: eMMC 8GB
WiFi: 2.4GHz and 5GHz with 3 antennas
Ethernet:
1x WAN (10/100/1000M)
1x LAN (10/100/1000/2500M)
USB: 1x USB 3.0 port
Two buttons: power/reset and mode (BTN_0)
LEDS: blue, red, blue+red=pink
UART: 3.3V, TX, RX, GND / 115200 8N1 (no need to use 3.3V! Use only TX, RX, and GND)

**Installation via U-Boot rescue**
1. Set static IP 192.168.1.2 on your computer and default route as 192.168.1.1
2. Connect to the WAN port and hold the reset button while booting the device.
3. Wait for the LED to blink 5 times, and release the reset button.
4. Open `U-boot` web page on your browser at `192.168.1.1`
5. Select the OpenWRT `sysupgrade` image, upload it, and start the upgrade.
6. Wait for the router to flash the new firmware.
7. Wait for the router to reboot itself.

**Installation via sysupgrade**
Flash the `sysupgrade` file via [LuCI upgrade page](http://192.168.1.1/cgi-bin/luci/admin/system/flash) without saving the settings.

**Installation via SSH**
Upload the file to the router `/tmp` directory, `ssh root@192.168.1.1` and issue a command:
```
sysupgrade -n /tmp/openwrt-mediatek-filogic-huasifei_wh3000-emmc-squashfs-sysupgrade.bin
```

**MAC addresses**
You can find your Factory MAC, which is mentioned on the box at `/dev/mmcblck0p2` partition `factory` starting from `0x4`
```
dd if=/dev/mmcblk0p2 bs=1 skip=4 count=6 | hexdump -C
```

Factory MAC is on the label, e.g. `XX:XX:XX:XX:XX:A8`
LAN (eth0) is factory + 2, e.g. `XX:XX:XX:XX:XX:AA`
WAN (eth1) is factory + 3, e.g. `XX:XX:XX:XX:XX:AB`
WLAN (2.4G) is factory, e.g. `XX:XX:XX:XX:XX:A8`
WLAN (5G) is factory + 1, e.g. `XX:XX:XX:XX:XX:A9`

Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
2025-03-23 16:27:16 +07:00
padavanonly
eec850b76d hnat:fix ext dev offload when eth0 is not in br-lan 2025-03-23 14:53:32 +08:00
padavanonly
4ca6980507 ipv6: fix statics data unvalid 2025-03-22 20:25:57 +08:00
padavanonly
1bf32fe661 Update mtk_eth_soc.h 2025-03-22 17:54:18 +08:00
padavanonly
aa24e32173 mtk_eth_soc:disable adma v2 for mt7986 2025-03-22 17:48:20 +08:00
padavanonly
9d63f6091b mtg_eth_soc: disable adma v2 for mt7986 2025-03-22 14:27:21 +08:00
padavanonly
80bef70e39 hqos: disable download speed limit 2025-03-22 10:12:37 +08:00
padavanonly
197345c0f4 usb:delete extra patches 2025-03-20 22:20:40 +08:00
padavanonly
84b42f65bb cudy:fix mac address 2025-03-19 21:11:43 +08:00
padavanonly
1baacdd4e9 rtl8221:work around 7981 issue 2025-03-19 21:07:45 +08:00
padavanonly
3c8095a0ee Update mt7981-cudy-tr3000-v1.dts 2025-03-18 17:16:24 +08:00
1175 changed files with 1929019 additions and 2732 deletions

View File

@@ -1,3 +1,4 @@
{
"git.alwaysSignOff": true
"git.alwaysSignOff": true,
"makefile.configureOnOpen": false
}

View File

@@ -67,9 +67,7 @@ To build your own firmware you need a GNU/Linux, BSD or macOS system (case sensi
# MT7986
cp -f defconfig/mt7986-ax6000.config .config
# MT7981 USB OFFLOAD GSW device (rax3000m)
cp -f defconfig/mt7981-ax3000-gsw-usboffload.config .config
```
rax3000mxr30这种有多个lan口的设备如果想要正常使用usb加速需要将将eth1从wan里删除加入br-lan作为lan使用
6. Run `make` to build your firmware. This will download all sources, build the cross-compile toolchain and then cross-compile the GNU/Linux kernel & all chosen applications for your target system.

748
build_openwrt.sh Executable file
View File

@@ -0,0 +1,748 @@
#!/usr/bin/env bash
#====================================================
# OpenWrt 构建管理脚本
# 功能:提供交互式菜单,可选择执行特定操作
# 更新2025-04-05
#====================================================
#---------------基础配置---------------#
# 日志目录设置
LOGS_ROOT="openwrt_logs"
SESSION_DIR="${LOGS_ROOT}/$(date +%Y%m%d_%H%M%S)"
LOG_FILE="${SESSION_DIR}/main_build_script.log" # 主脚本日志文件名更改,更清晰
#---------------清理配置---------------#
# 需要移除的目录列表 (示例,根据你的需要添加)
declare -a REMOVE_DIRS=(
# "feeds/packages/net/v2ray-geodata" # 示例
)
# 需要移除的包列表 (示例,根据你的需要添加)
declare -a REMOVE_PACKAGES=(
# "package/feeds/luci/luci-app-example" # 示例
)
#---------------自定义包配置---------------#
# 定义自定义包配置,格式:[包名]=[目标目录]=[仓库URL]=[分支]=[是否使用--depth 1]
declare -A CUSTOM_PACKAGES=(
["partexp"]="package/luci-app-partexp=https://github.com/sirpdboy/luci-app-partexp=main=false"
["openclash"]="package/openclash=https://github.com/vernesong/OpenClash=dev=true"
["zerotier"]="package/luci-app-zerotier=https://github.com/Firsgith/luci-app-zerotier.git=main=false"
# ["5gsupport"]="package/5G-Modem-Support=https://nanako.site/gitea/Nanako/openwrt-app-actions.git=main=false"
)
#---------------日志系统---------------#
# 保存原始的标准输出和错误输出文件描述符
exec {STDOUT_ORIG}>&1
exec {STDERR_ORIG}>&2
# 全局变量标记日志是否启用
LOGGING_ENABLED=false # 初始为 false由 init_logger 启用
# 初始化日志系统
init_logger() {
# 创建日志目录结构
mkdir -p "$SESSION_DIR" || {
echo "错误: 无法创建日志目录: $SESSION_DIR" >&2
exit 1
}
LOGGING_ENABLED=true
echo "日志将保存在: $SESSION_DIR"
echo "主脚本日志: $LOG_FILE"
# 重定向主脚本的 stdout 和 stderr 到 tee同时输出到控制台和主日志文件
# 使用 process substitution 和 tee
exec > >(tee -a "$LOG_FILE")
exec 2> >(tee -a "$LOG_FILE" >&2)
# 记录初始信息到日志
echo "[$(date "+%Y-%m-%d %H:%M:%S")] [INFO]: 日志系统初始化完成。主日志文件: $LOG_FILE"
}
# 创建新的特定构建阶段的日志文件
create_build_log() {
local build_type=$1
local timestamp=$(date +%Y%m%d_%H%M%S)
# 使用更明确的文件名
BUILD_LOG_FILE="${SESSION_DIR}/${build_type}_build_${timestamp}.log"
# 确保文件被创建,即使命令没有输出
touch "$BUILD_LOG_FILE" || {
log "ERROR" "无法创建构建日志文件: $BUILD_LOG_FILE"
return 1
}
# 返回创建的日志文件名
echo "$BUILD_LOG_FILE"
return 0
}
# 禁用日志重定向 (用于 menuconfig 等交互场景)
disable_logging() {
if [ "$LOGGING_ENABLED" = true ]; then
log "DEBUG" "禁用日志重定向,恢复原始标准输出/错误。"
exec >&$STDOUT_ORIG
exec 2>&$STDERR_ORIG
LOGGING_ENABLED=false # 标记为禁用
fi
}
# 启用日志重定向 (恢复)
enable_logging() {
# 仅在之前被禁用的情况下才重新启用
if [ "$LOGGING_ENABLED" = false ]; then
# 重新应用重定向到主日志
exec > >(tee -a "$LOG_FILE")
exec 2> >(tee -a "$LOG_FILE" >&2)
LOGGING_ENABLED=true # 标记为启用
log "DEBUG" "重新启用日志重定向到主日志。"
fi
}
# 设置终端颜色
setup_colors() {
if [[ -t 1 ]]; then # 检查标准输出是否连接到终端
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
else
RED='' GREEN='' YELLOW='' BLUE='' NC=''
fi
}
# 记录日志函数 - 使用此函数来明确日志级别
# 注意:此函数输出会经过 init_logger 设置的全局重定向
log() {
local level=$1
local message=$2
local timestamp
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
local color="" level_str=""
case $level in
"INFO") color="$GREEN"; level_str="INFO " ;; # 加空格对齐
"WARN") color="$YELLOW"; level_str="WARN " ;;
"ERROR") color="$RED"; level_str="ERROR" ;;
"DEBUG") color="$BLUE"; level_str="DEBUG" ;;
*) color=""; level_str="LOG " ;; # 默认级别
esac
# 使用 printf 保证原子写入,减少并发问题
printf "[%s] %b[%s]%b: %s\n" "$timestamp" "$color" "$level_str" "$NC" "$message"
}
# 同时记录消息到主日志和特定的构建日志
log_to_both() {
local level=$1
local message=$2
local build_log_file=$3 # 明确参数名
# 1. 输出到主日志(通过全局重定向和 log 函数)
log "$level" "$message"
# 2. 追加到指定的构建日志文件
local timestamp
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
# 直接追加,不需要颜色代码
printf "[%s] [%s]: %s\n" "$timestamp" "$level" "$message" >> "$build_log_file"
}
#---------------自定义包管理函数---------------#
# 更新单个自定义包
update_single_package() {
local pkg_name=$1
local config=$2
# 解析配置 (保持 cut 的方式,假设路径/URL/分支名不含 '=')
# 如果遇到问题,可以切换到 IFS/read
local target_dir repo_url branch use_depth
target_dir=$(echo "$config" | cut -d= -f1)
repo_url=$(echo "$config" | cut -d= -f2)
branch=$(echo "$config" | cut -d= -f3)
use_depth=$(echo "$config" | cut -d= -f4)
# 基础验证
if [ -z "$target_dir" ] || [ -z "$repo_url" ]; then
log "ERROR" "包 '$pkg_name' 的配置无效: $config"
return 1
fi
log "INFO" "更新自定义包: $pkg_name..."
# 检查目标目录的父目录是否存在
local parent_dir
parent_dir=$(dirname "$target_dir")
if [ ! -d "$parent_dir" ]; then
log "INFO" "创建父目录: $parent_dir"
mkdir -p "$parent_dir" || {
log "ERROR" "无法创建父目录: $parent_dir"
return 1
}
fi
# 移除现有目录
if [ -d "$target_dir" ]; then
log "INFO" "移除现有目录: $target_dir"
rm -rf "$target_dir" || {
log "ERROR" "无法删除目录: $target_dir"
return 1
}
fi
# 准备 git clone 命令参数数组 (移除 eval)
local git_options=("--progress") # 总是显示进度
# 处理分支
if [ -n "$branch" ] && [ "$branch" != "master" ]; then
git_options+=("-b" "$branch")
fi
# 处理 depth
if [ "$use_depth" = "true" ]; then
git_options+=("--depth" "1")
fi
# 执行克隆
log "INFO" "执行: git clone ${git_options[*]} $repo_url $target_dir"
if git clone "${git_options[@]}" "$repo_url" "$target_dir"; then
log "INFO" "包 '$pkg_name' 更新成功"
return 0
else
log "ERROR" "克隆包 '$pkg_name' 失败 (仓库: $repo_url)"
# 尝试给出更具体的错误提示
log "ERROR" "请检查网络连接、仓库 URL、分支名称以及目标目录权限。"
# 保留可能存在的空目录或部分克隆,让用户检查
# rm -rf "$target_dir" # 不再自动删除失败的克隆
return 1
fi
}
# 更新所有自定义包的主函数
update_custom_package() {
local failed_packages=()
local success_count=0
local total_packages=${#CUSTOM_PACKAGES[@]}
if [ "$total_packages" -eq 0 ]; then
log "INFO" "没有配置自定义包,跳过更新。"
return 0
fi
log "INFO" "开始更新 $total_packages 个自定义包..."
for pkg_name in "${!CUSTOM_PACKAGES[@]}"; do
# 使用 subshell 执行,避免污染当前环境的变量,但这里影响不大
if update_single_package "$pkg_name" "${CUSTOM_PACKAGES[$pkg_name]}"; then
((success_count++))
else
failed_packages+=("$pkg_name")
fi
done
# 显示更新结果
if [ ${#failed_packages[@]} -eq 0 ]; then
log "INFO" "所有自定义包更新成功 ($success_count/$total_packages)"
return 0
else
log "WARN" "部分自定义包更新失败 (成功: $success_count/$total_packages)"
log "ERROR" "更新失败的包: ${failed_packages[*]}"
return 1 # 返回失败状态码
fi
}
# 更新特定自定义包
update_specific_package() {
local pkg_name=$1
if [ -z "$pkg_name" ]; then
log "ERROR" "未指定包名"
return 1
fi
if [ -z "${CUSTOM_PACKAGES[$pkg_name]}" ]; then
log "ERROR" "未找到包配置:'$pkg_name'"
log "INFO" "可用的包名: ${!CUSTOM_PACKAGES[*]}"
return 1
fi
update_single_package "$pkg_name" "${CUSTOM_PACKAGES[$pkg_name]}"
}
#---------------基础功能函数---------------#
# 清理工作区 (make clean 的替代方案,更彻底)
clean_workspace() {
log "INFO" "开始彻底清理工作区..."
# 清理 feeds (可选,如果 feeds 内容经常变动或出问题可以启用)
# log "INFO" "执行 ./scripts/feeds clean ..."
# ./scripts/feeds clean || log "WARN" "./scripts/feeds clean 执行时遇到问题。"
# 清理编译产物和临时文件
log "INFO" "执行 rm -rf ./tmp ./logs ./staging_dir ./build_dir ./bin ..."
# 注意:这里移除了 logs 目录,但我们的脚本日志在 openwrt_logs 下,不会被删
# 如果 OpenWrt 自身有 logs 目录且需要保留,则从下面移除 ./logs
rm -rf ./tmp ./logs ./staging_dir ./build_dir ./bin || {
log "ERROR" "删除部分工作区目录失败,请检查权限或文件占用。"
return 1
}
log "INFO" "工作区清理完成。"
return 0
}
# 清理编译临时文件 (make clean 的快速版)
clean_build_temp() {
log "INFO" "开始清理编译临时文件..."
log "INFO" "执行 rm -rf ./tmp ./staging_dir ./build_dir ..."
rm -rf ./tmp ./staging_dir ./build_dir || {
log "ERROR" "删除部分编译临时目录失败。"
return 1
}
log "INFO" "编译临时文件清理完成。"
return 0
}
# 更新源码
update_source() {
log "INFO" "开始更新 OpenWrt 源码 (git pull)..."
if git pull --rebase; then # 使用 rebase 避免不必要的 merge commit
log "INFO" "源码更新完成"
return 0
else
log "ERROR" "源码更新失败 (git pull --rebase)"
log "WARN" "请检查本地是否有未提交的修改,或尝试手动解决 Git 冲突。"
return 1
fi
}
# 更新并安装 feeds
update_feeds() {
log "INFO" "开始更新 Feeds (update -a)..."
if ./scripts/feeds update -a; then
log "INFO" "Feeds 更新成功,开始安装 (install -a)..."
if ./scripts/feeds install -a; then
log "INFO" "Feeds 安装成功"
return 0
else
log "ERROR" "Feeds 安装失败 (install -a)"
return 1
fi
else
log "ERROR" "Feeds 更新失败 (update -a)"
return 1
fi
}
# 执行构建相关命令,并将 stdout 重定向到日志stderr 同时输出到控制台和日志
run_build_command() {
local cmd=$1 # 要执行的命令字符串
local log_file=$2 # 目标日志文件
local description=$3 # 操作描述
log_to_both "INFO" "开始执行: $description" "$log_file"
log "DEBUG" "命令详情: $cmd" # 只记录到主日志
# 执行命令
# stdout (>>) 追加到日志文件
# stderr (2>) 通过管道给 tee
# tee -a "$log_file" 将 stderr 追加到日志文件
# tee 默认将其标准输入复制到标准输出,这里即脚本的 stderr因此会显示在控制台
local start_time end_time duration
start_time=$(date +%s)
if eval "$cmd" >> "$log_file" 2> >(tee -a "$log_file" >&2); then
end_time=$(date +%s)
duration=$((end_time - start_time))
log_to_both "INFO" "$description 完成 (耗时: ${duration}s)" "$log_file"
return 0 # 成功返回 0
else
end_time=$(date +%s)
duration=$((end_time - start_time))
local exit_code=$? # 获取命令的退出码
# 错误信息已经通过 stderr 的 tee 输出到控制台了
log_to_both "ERROR" "$description 失败 (退出码: $exit_code, 耗时: ${duration}s)" "$log_file"
log "ERROR" "详细错误请查看控制台输出以及日志文件: $log_file"
return $exit_code # 失败返回命令的退出码
fi
}
# 编译固件
build_firmware() {
# 创建新的固件编译日志文件
local current_log
current_log=$(create_build_log "firmware") || return 1 # 创建失败则退出
log "INFO" "开始编译固件..."
log "INFO" "详细编译日志将保存在: $current_log"
# 1. 下载依赖包
local download_cmd="make download -j$(nproc) V=s"
run_build_command "$download_cmd" "$current_log" "下载依赖包" || {
log "ERROR" "依赖包下载失败,编译中止。"
# 即使下载失败,日志文件也已包含错误信息
return 1
}
# 2. 多线程编译
local cpu_cores
cpu_cores=$(nproc)
log "INFO" "检测到 $cpu_cores 个 CPU 核心,开始多线程编译..."
local build_cmd="make -j${cpu_cores} V=s"
if run_build_command "$build_cmd" "$current_log" "固件编译 (多线程)"; then
log "INFO" "${GREEN}固件编译成功完成!${NC}"
log "INFO" "固件输出目录: ./bin/targets/"
return 0 # 编译成功
else
# 多线程编译失败,询问用户是否重试
log "WARN" "多线程编译失败。"
local retry_choice
# -r: raw input, -p: prompt, -n 1: read only one char (optional but nice), -t 15: timeout (optional)
# Default to No
read -rp "$(echo -e ${YELLOW}"是否尝试使用单线程重新编译? (y/N): "${NC})" -n 1 -t 30 retry_choice
echo # Add a newline after read -n
if [[ "$retry_choice" =~ ^[Yy]$ ]]; then
log "INFO" "用户选择使用单线程重试编译..."
# 3. 单线程编译重试
local build_cmd_single="make -j1 V=s"
if run_build_command "$build_cmd_single" "$current_log" "固件编译 (单线程重试)"; then
log "INFO" "${GREEN}单线程编译成功完成!${NC}"
log "INFO" "固件输出目录: ./bin/targets/"
return 0 # 单线程编译成功
else
log "ERROR" "${RED}单线程编译也失败了。${NC}"
log "ERROR" "请仔细检查控制台错误输出以及日志文件: $current_log"
return 1 # 最终编译失败
fi
else
log "INFO" "用户选择不进行单线程重试编译。"
log "ERROR" "${RED}编译失败,未进行单线程重试。${NC}"
log "ERROR" "请仔细检查控制台错误输出以及日志文件: $current_log"
return 1 # 用户取消重试,编译失败
fi
fi
}
# 清理配置文件中指定的旧包/目录
clean_packages() {
log "INFO" "开始清理配置文件中指定的旧包和目录..."
local removed_count=0
local failed_count=0
local total_to_remove=$((${#REMOVE_DIRS[@]} + ${#REMOVE_PACKAGES[@]}))
if [ "$total_to_remove" -eq 0 ]; then
log "INFO" "配置文件中未指定需要移除的包或目录。"
return 0
fi
# 清理目录
for dir in "${REMOVE_DIRS[@]}"; do
if [ -e "$dir" ]; then # 使用 -e 检查文件或目录是否存在
log "INFO" "正在删除目录: $dir"
if rm -rf "$dir"; then
log "INFO" "已删除: $dir"
((removed_count++))
else
log "ERROR" "删除失败: $dir (请检查权限或是否被占用)"
((failed_count++))
fi
else
log "WARN" "指定的目录不存在,跳过: $dir"
fi
done
# 清理包 (通常包也是目录)
for pkg in "${REMOVE_PACKAGES[@]}"; do
if [ -e "$pkg" ]; then
log "INFO" "正在删除包/目录: $pkg"
if rm -rf "$pkg"; then
log "INFO" "已删除: $pkg"
((removed_count++))
else
log "ERROR" "删除失败: $pkg (请检查权限或是否被占用)"
((failed_count++))
fi
else
log "WARN" "指定的包/目录不存在,跳过: $pkg"
fi
done
if [ $failed_count -eq 0 ]; then
log "INFO" "旧包/目录清理完成,共处理 $removed_count 个项目。"
return 0
else
log "WARN" "旧包/目录清理部分完成 (成功: $removed_count, 失败: $failed_count)"
return 1 # 返回失败状态码
fi
}
# 更新所有组件 (源码 -> 清理旧包 -> 自定义包 -> feeds)
update_all_components() {
log "INFO" "开始更新所有组件..."
local success=true # 假设成功
# 1. 更新源码
log "INFO" "[1/4] 更新 OpenWrt 源码..."
update_source || success=false
# 2. 清理旧包 (即使上一步失败也尝试清理)
log "INFO" "[2/4] 清理配置文件指定的旧包/目录..."
clean_packages || log "WARN" "清理旧包/目录时遇到问题,继续执行..." # 清理失败通常不阻止后续
# 3. 更新自定义包 (只有在源码更新成功时才执行较好)
if [ "$success" = true ]; then
log "INFO" "[3/4] 更新自定义包..."
update_custom_package || success=false
else
log "WARN" "[3/4] 跳过更新自定义包,因为源码更新失败。"
fi
# 4. 更新 Feeds (只有在源码和自定义包都成功时执行较好)
if [ "$success" = true ]; then
log "INFO" "[4/4] 更新 Feeds..."
update_feeds || success=false
else
log "WARN" "[4/4] 跳过更新 Feeds因为之前的步骤失败。"
fi
# 总结
if [ "$success" = true ]; then
log "INFO" "所有组件更新完成!"
return 0
else
log "ERROR" "部分或全部组件更新失败,请检查上面的日志。"
return 1
fi
}
# 菜单配置 (make menuconfig)
menuconfig() {
log "INFO" "准备进入菜单配置 (make menuconfig)..."
log "INFO" "注意:日志重定向将暂时禁用以进行交互。"
# 禁用日志重定向,否则 menuconfig 界面可能显示不正常
disable_logging
# 执行 menuconfig
if make menuconfig; then
# 配置成功后重新启用日志
enable_logging
log "INFO" "菜单配置完成。新配置已保存到 .config"
# 询问是否保存 defconfig (可选)
# read -p "是否将当前配置保存为 defconfig? (y/N): " save_defconfig
# if [[ "$save_defconfig" =~ ^[Yy]$ ]]; then
# ./scripts/diffconfig.sh > my_defconfig
# log "INFO" "当前配置已保存到 my_defconfig"
# fi
return 0
else
# 配置失败或被取消,也要恢复日志
enable_logging
log "WARN" "菜单配置未完成或被取消。"
return 1 # 返回失败状态码
fi
}
#---------------组合功能函数---------------#
# 完整构建流程
full_build() {
log "INFO" "启动完整构建流程..."
local step=1
local total_steps=6 # 预估步骤数
# 1. 清理工作区
log "INFO" "[${step}/${total_steps}] 清理工作区..."
clean_workspace || { log "WARN" "工作区清理可能不完整,尝试继续..."; } # 清理失败通常不致命
((step++))
# 2. 更新源码
log "INFO" "[${step}/${total_steps}] 更新源码..."
update_source || { log "ERROR" "源码更新失败,终止构建流程。"; return 1; }
((step++))
# 3. 清理旧包
log "INFO" "[${step}/${total_steps}] 清理配置文件指定的旧包..."
clean_packages || log "WARN" "清理旧包时遇到问题,继续执行..."
((step++))
# 4. 更新自定义包
log "INFO" "[${step}/${total_steps}] 更新自定义包..."
update_custom_package || { log "ERROR" "自定义包更新失败,终止构建流程。"; return 1; }
((step++))
# 5. 更新 Feeds
log "INFO" "[${step}/${total_steps}] 更新 Feeds..."
update_feeds || { log "ERROR" "Feeds 更新失败,终止构建流程。"; return 1; }
((step++))
# 6. 菜单配置
log "INFO" "[${step}/${total_steps}] 进入菜单配置 (make menuconfig)..."
menuconfig || { log "WARN" "菜单配置未完成或取消,但继续尝试编译..."; } # 允许使用现有配置编译
((step++)) # 无论成功与否,都算一步
# 7. 编译固件 (独立步骤,不计入前面的 total_steps)
log "INFO" "所有准备工作完成,开始编译固件..."
if build_firmware; then
log "INFO" "${GREEN}完整构建流程成功完成!${NC}"
return 0
else
log "ERROR" "${RED}完整构建流程失败于编译阶段。${NC}"
return 1
fi
}
#---------------菜单函数---------------#
# 打印主菜单
print_menu() {
echo -e "\n${BLUE}======= OpenWrt 构建管理菜单 =======${NC}"
echo -e " ${YELLOW}会话日志目录: ${SESSION_DIR}${NC}"
echo -e "${GREEN} 1.${NC} ${BOLD}完整构建流程${NC} (清理 > 更新源码/包/feeds > 配置 > 编译)"
echo -e "${GREEN} 2.${NC} 清理工作区 (删除 tmp, bin, build_dir 等)"
echo -e "${GREEN} 3.${NC} 更新所有组件 (源码 + 旧包清理 + 自定义包 + feeds)"
echo -e "${GREEN} 4.${NC} 清理配置文件指定的旧包/目录"
echo -e "${GREEN} 5.${NC} ${BOLD}编译固件${NC} (make V=s)"
echo -e "${GREEN} 6.${NC} 调整配置 (make menuconfig)"
echo -e "${GREEN} 7.${NC} 更新所有自定义包"
echo -e "${GREEN} 8.${NC} 更新特定的自定义包"
echo -e "${GREEN} 9.${NC} 更新 OpenWrt 源码 (git pull)"
echo -e "${GREEN}10.${NC} 更新并安装 Feeds"
echo -e "-------------------------------------"
echo -e "${GREEN} 0.${NC} 退出脚本"
echo -e "${BLUE}====================================${NC}"
# 使用 read -p 提供提示
read -rp "请输入选项 [0-10]: " choice
}
# 打印并选择特定自定义包进行更新
select_specific_package() {
local pkg_names=("${!CUSTOM_PACKAGES[@]}") # 获取所有包名
local num_packages=${#pkg_names[@]}
if [ "$num_packages" -eq 0 ]; then
log "WARN" "没有配置任何自定义包。"
return 1
fi
echo -e "\n${BLUE}--- 选择要更新的自定义包 ---${NC}"
local i=1
# 使用 sort 命令让包名按字母排序显示
local sorted_pkg_names=($(printf "%s\n" "${pkg_names[@]}" | sort))
for pkg_name in "${sorted_pkg_names[@]}"; do
echo -e " ${GREEN}$i.${NC} $pkg_name"
((i++))
done
echo -e " ${GREEN}0.${NC} 返回主菜单"
echo -e "${BLUE}----------------------------${NC}"
local choice_pkg
read -rp "请输入包的序号 [0-$num_packages]: " choice_pkg
# 验证选择
if [[ ! "$choice_pkg" =~ ^[0-9]+$ ]]; then
log "ERROR" "无效输入,请输入数字。"
return 1
fi
if [ "$choice_pkg" -eq 0 ]; then
log "INFO" "返回主菜单。"
return 0 # 返回成功,表示正常退出选择
elif [ "$choice_pkg" -ge 1 ] && [ "$choice_pkg" -le "$num_packages" ]; then
local selected_pkg=${sorted_pkg_names[$((choice_pkg-1))]}
log "INFO" "选择更新包: $selected_pkg"
update_specific_package "$selected_pkg" # 调用更新函数
return $? # 返回更新函数的执行结果
else
log "ERROR" "无效的选择序号: $choice_pkg"
return 1
fi
}
#---------------主函数---------------#
main() {
# 0. 设置颜色变量
setup_colors
# 1. 初始化日志系统 (会进行第一次输出重定向)
init_logger || exit 1 # 初始化失败则退出
# 2. 检查运行环境和依赖
log "INFO" "检查运行环境..."
local dep_missing=false
if [ ! -f "Makefile" ] || [ ! -d "scripts" ] || [ ! -d ".git" ]; then
log "ERROR" "脚本必须在 OpenWrt 源码的根目录下运行 (需要存在 Makefile, scripts, .git)。"
dep_missing=true
fi
for cmd in git make nproc tee cut dirname mkdir rm git date printf sort read; do
if ! command -v "$cmd" &> /dev/null; then
log "ERROR" "缺少必要的系统命令: $cmd"
dep_missing=true
fi
done
if [ "$dep_missing" = true ]; then
log "ERROR" "环境或依赖检查失败,请修正后重试。"
# 恢复原始输出,避免后续可能的错误信息无法显示
exec >&$STDOUT_ORIG
exec 2>&$STDERR_ORIG
exit 1
fi
log "INFO" "环境检查通过。"
# 记录脚本启动信息
log "INFO" "${BOLD}OpenWrt 构建管理脚本已启动${NC}"
log "INFO" "PID: $$"
log "INFO" "会话日志目录: $SESSION_DIR"
# 3. 主菜单循环
local choice # 提前声明 choice
while true; do
print_menu # 显示菜单并获取输入到 choice 变量
log "DEBUG" "用户选择了: $choice" # 记录用户选择
# 根据选择执行操作
case $choice in
1) full_build ;;
2) clean_workspace ;;
3) update_all_components ;;
4) clean_packages ;;
5) build_firmware ;;
6) menuconfig ;;
7) update_custom_package ;;
8) select_specific_package ;;
9) update_source ;;
10) update_feeds ;;
0)
log "INFO" "收到退出命令,正在退出脚本..."
# 恢复原始输出流 (好习惯)
exec >&$STDOUT_ORIG
exec 2>&$STDERR_ORIG
echo -e "${GREEN}脚本已退出。${NC}"
exit 0
;;
*)
log "WARN" "无效的选项: '$choice',请输入 0 到 10 之间的数字。"
;;
esac
local last_exit_code=$? # 获取上一个命令的退出状态码
# 操作完成后暂停,给用户查看结果的时间
if [[ $choice != 0 ]]; then
if [ $last_exit_code -eq 0 ]; then
echo -e "\n${GREEN}操作 '$choice' 执行完成。${NC}"
else
echo -e "\n${RED}操作 '$choice' 执行时遇到错误 (退出码: $last_exit_code)。${NC}"
fi
echo -e "${YELLOW}按 Enter 键返回主菜单...${NC}"
read -r # 等待用户按回车
fi
done
}
#---------------脚本入口---------------#
# 将所有主逻辑放入 main 函数,并在最后调用它
# "$@" 将所有命令行参数传递给 main 函数 (虽然本脚本目前未使用)
main "$@"

View File

@@ -161,6 +161,7 @@ CONFIG_PACKAGE_ethtool=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_ip-bridge=y
CONFIG_PACKAGE_ip6tables-extra=y
CONFIG_PACKAGE_ip6tables-nft=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-extra=y

View File

@@ -1,6 +1,8 @@
CONFIG_TARGET_mediatek=y
CONFIG_TARGET_mediatek_mt7981=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_huasifei_wh3000-emmc=y
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7981_DEVICE_huasifei_wh3000-emmc=""
CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_abt_asr3000=y
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7981_DEVICE_abt_asr3000=""
CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cetron_ct3003=y
@@ -161,6 +163,7 @@ CONFIG_PACKAGE_ethtool=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_ip-bridge=y
CONFIG_PACKAGE_ip6tables-extra=y
CONFIG_PACKAGE_ip6tables-nft=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-extra=y

View File

@@ -5746,7 +5746,7 @@ CONFIG_PACKAGE_luci-app-turboacc-mtk=y
CONFIG_PACKAGE_luci-app-upnp-mtk-adjust=y
CONFIG_PACKAGE_luci-app-usb-printer=y
# CONFIG_PACKAGE_luci-app-usb3disable is not set
CONFIG_PACKAGE_luci-app-usbmodem=y
# CONFIG_PACKAGE_luci-app-usbmodem is not set
# CONFIG_PACKAGE_luci-app-uugamebooster is not set
# CONFIG_PACKAGE_luci-app-v2ray-server is not set
# CONFIG_PACKAGE_luci-app-v2raya is not set
@@ -6461,6 +6461,7 @@ CONFIG_PACKAGE_ebtables=y
CONFIG_PACKAGE_ip6tables=y
CONFIG_PACKAGE_ip6tables-extra=y
CONFIG_PACKAGE_ip6tables-mod-nat=y
CONFIG_PACKAGE_ip6tables-nft=y
CONFIG_PACKAGE_iptables=y
# CONFIG_IPTABLES_CONNLABEL is not set
# CONFIG_IPTABLES_NFTABLES is not set

View File

@@ -137,6 +137,7 @@ CONFIG_PACKAGE_ebtables=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_ip-bridge=y
CONFIG_PACKAGE_ip6tables-extra=y
CONFIG_PACKAGE_ip6tables-nft=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-extra=y

View File

@@ -139,6 +139,7 @@ CONFIG_PACKAGE_ebtables=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_ip-bridge=y
CONFIG_PACKAGE_ip6tables-extra=y
CONFIG_PACKAGE_ip6tables-nft=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-extra=y

View File

@@ -139,6 +139,7 @@ CONFIG_PACKAGE_ebtables=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_ip-bridge=y
CONFIG_PACKAGE_ip6tables-extra=y
CONFIG_PACKAGE_ip6tables-nft=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-extra=y

View File

@@ -2,3 +2,4 @@ src-git packages https://github.com/immortalwrt/packages.git;openwrt-24.10
src-git luci https://github.com/immortalwrt/luci.git;openwrt-24.10
src-git routing https://github.com/openwrt/routing.git;openwrt-24.10
src-git telephony https://github.com/openwrt/telephony.git;openwrt-24.10
src-git qmodem https://github.com/FUjr/QModem.git;main

6
files/etc/config/3ginfo Normal file
View File

@@ -0,0 +1,6 @@
config 3ginfo
option website 'http://www.btsearch.pl/szukaj.php?mode=std&search='
option network 'wwan'
option device '/dev/ttyUSB2'

87
files/etc/config/mwan3 Normal file
View File

@@ -0,0 +1,87 @@
config globals 'globals'
option mmx_mask '0x3F00'
list rt_table_lookup '220'
config policy 'balanced'
option last_resort 'unreachable'
list use_member 'qmodem'
list use_member 'lls'
config rule 'https'
option sticky '1'
option dest_port '443'
option proto 'tcp'
option use_policy 'balanced'
config rule 'default_rule_v4'
option dest_ip '0.0.0.0/0'
option use_policy 'balanced'
option family 'ipv4'
config rule 'default_rule_v6'
option dest_ip '::/0'
option use_policy 'balanced'
option family 'ipv6'
config interface '2_1'
option initial_state 'online'
option family 'ipv4'
list track_ip '1.1.1.1'
option track_method 'ping'
option reliability '1'
option count '1'
option size '56'
option max_ttl '60'
option timeout '4'
option interval '10'
option failure_interval '1'
option recovery_interval '1'
option down '5'
option up '1'
option enabled '1'
config member 'qmodem'
option interface 'wwan'
option metric '1'
option weight '3'
config interface 'wwan2'
option initial_state 'online'
option family 'ipv4'
list track_ip '1.1.1.1'
option track_method 'ping'
option reliability '1'
option count '1'
option size '56'
option max_ttl '60'
option timeout '4'
option interval '10'
option failure_interval '5'
option recovery_interval '5'
option down '5'
option up '5'
option enabled '1'
config interface 'wwan'
option enabled '1'
option initial_state 'online'
option family 'ipv4'
list track_ip '1.1.1.1'
option track_method 'ping'
option reliability '1'
option count '1'
option size '56'
option max_ttl '60'
option timeout '4'
option interval '10'
option failure_interval '5'
option recovery_interval '1'
option down '5'
option up '1'
config member 'lls'
option interface 'wwan2'
option metric '1'
option weight '3'

36
files/etc/config/network Normal file
View File

@@ -0,0 +1,36 @@
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdc9:5676:20b9::/48'
option packet_steering '2'
option steering_flows '128'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
option promisc '1'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '10.2.39.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'eth0'
option proto 'dhcp'
config interface 'Zerotier'
option proto 'dhcp'
option device 'zt4z6adq6m'
config interface 'wwan2'
option proto 'dhcp'
option metric '1'

333
files/etc/config/openclash Normal file
View File

@@ -0,0 +1,333 @@
config openclash 'config'
option proxy_port '7892'
option tproxy_port '7895'
option mixed_port '7893'
option socks_port '7891'
option http_port '7890'
option dns_port '7874'
option enable '1'
option update '0'
option en_mode 'fake-ip-mix'
option auto_update '0'
option cn_port '9090'
option dashboard_forward_ssl '0'
option rule_source '0'
option enable_custom_dns '0'
option ipv6_enable '0'
option ipv6_dns '0'
option enable_custom_clash_rules '0'
option other_rule_auto_update '0'
option core_version 'linux-arm64'
option enable_redirect_dns '1'
option servers_if_update '0'
option disable_masq_cache '1'
option servers_update '0'
option log_level '0'
option proxy_mode 'rule'
option intranet_allowed '1'
option disable_udp_quic '1'
option operation_mode 'fake-ip'
option enable_rule_proxy '0'
option redirect_dns '1'
option cachesize_dns '1'
option filter_aaaa_dns '0'
option small_flash_memory '0'
option interface_name '0'
option log_size '1024'
option tolerance '0'
option store_fakeip '0'
option custom_fallback_filter '0'
option custom_fakeip_filter '0'
option custom_host '0'
option custom_name_policy '0'
option append_wan_dns '0'
option stream_auto_select '0'
option bypass_gateway_compatible '0'
option github_address_mod '0'
option urltest_address_mod '0'
option urltest_interval_mod '0'
option delay_start '0'
option router_self_proxy '1'
option release_branch 'dev'
option smart_enable '1'
option dashboard_type 'Official'
option yacd_type 'Meta'
option append_default_dns '0'
option enable_respect_rules '0'
option geo_custom_url 'https://testingcf.jsdelivr.net/gh/alecthw/mmdb_china_ip_list@release/lite/Country.mmdb'
option chnr_custom_url 'https://ispip.clang.cn/all_cn.txt'
option chnr6_custom_url 'https://ispip.clang.cn/all_cn_ipv6.txt'
option dashboard_password 'yknbB5AY'
option default_resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option restart '0'
option disable_quic_go_gso '0'
option skip_safe_path_check '0'
option enable_custom_domain_dns_server '0'
option skip_proxy_address '1'
option china_ip_route '1'
option lan_interface_name '0'
option geo_auto_update '0'
option geo_update_week_time '1'
option geo_update_day_time '0'
option geoip_auto_update '0'
option geosite_auto_update '0'
option geoasn_auto_update '0'
option chnr_auto_update '0'
option chnr_update_week_time '1'
option chnr_update_day_time '0'
option auto_restart '0'
option auto_restart_week_time '1'
option auto_restart_day_time '0'
option config_path '/etc/openclash/config/wget.yaml'
option core_type 'Smart'
option dnsmasq_resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option dnsmasq_noresolv '0'
option stack_type 'system'
option dnsmasq_cachesize '8000'
config dns_servers
option type 'udp'
option ip '114.114.114.114'
option enabled '1'
option group 'default'
config dns_servers
option type 'udp'
option ip '119.29.29.29'
option enabled '1'
option group 'default'
config dns_servers
option group 'nameserver'
option type 'udp'
option ip '114.114.114.114'
option enabled '1'
config dns_servers
option type 'udp'
option ip '223.5.5.5'
option enabled '1'
option group 'default'
config dns_servers
option group 'nameserver'
option type 'udp'
option ip '119.29.29.29'
option enabled '1'
config dns_servers
option group 'nameserver'
option type 'udp'
option ip '119.28.28.28'
option enabled '0'
config dns_servers
option group 'nameserver'
option type 'udp'
option ip '223.5.5.5'
option enabled '0'
config dns_servers
option type 'https'
option ip 'doh.pub/dns-query'
option group 'nameserver'
option enabled '1'
config dns_servers
option type 'https'
option ip 'dns.alidns.com/dns-query'
option group 'nameserver'
option enabled '1'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '9.9.9.9'
option type 'udp'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '149.112.112.112'
option type 'udp'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '2620:fe::fe'
option type 'udp'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '2620:fe::9'
option type 'udp'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '8.8.8.8'
option type 'udp'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '8.8.4.4'
option type 'udp'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '2001:4860:4860::8888'
option type 'udp'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '2001:4860:4860::8844'
option type 'udp'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '2001:da8::666'
option type 'udp'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'dns.quad9.net'
option type 'tls'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'dns.google'
option type 'tls'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '1.1.1.1'
option type 'tls'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'jp.tiar.app'
option type 'tls'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'dot.tiar.app'
option type 'tls'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'dns.quad9.net/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'dns.google/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'dns.cloudflare.com/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip '1.1.1.1/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'public.dns.iij.jp/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'jp.tiar.app/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'jp.tiarap.org/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option type 'https'
option ip 'doh.dnslify.com/dns-query'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'dns.twnic.tw/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'dns.oszx.co/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'doh.applied-privacy.net/query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'dnsforge.de/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'doh.ffmuc.net/dns-query'
option type 'https'
config dns_servers
option enabled '0'
option group 'fallback'
option ip 'doh.mullvad.net/dns-query'
option type 'https'
config authentication
option enabled '1'
option username 'Clash'
option password 'cfeprgqp'
config config_subscribe
option enabled '1'
option name 'wget'
option address 'https://bava8u2znaj6bdzzjnfb.wgetcloud.online/link/b7645741-cb50-366c-9049-b53f74856b88'
option sub_ua 'clash.meta'
option sub_convert '0'
config rule_provider_config
option enabled '1'
option interval '86400'
option config 'all'
list rule_name '放行规则-lhie1(建议置顶并直连)'
list rule_name '放行规则-ACL4SSR(建议置顶并直连)'
list rule_name '国内IP白名单(By lhie1)'
list rule_name '国内域名白名单(By lhie1)'
option group 'DIRECT'
option position '0'

33
files/etc/config/qmodem Normal file
View File

@@ -0,0 +1,33 @@
config main 'main'
option enable_dial '1'
option modem_count '1'
option block_auto_probe '1'
config modem-device '2_1'
option slot '/sys/bus/usb/devices/2-1/'
option data_interface 'usb'
option name 'rm551e-gl'
option soft_reboot '1'
option define_connect '1'
option manufacturer 'quectel'
option platform 'qualcomm'
option at_port '/dev/ttyUSB2'
list modes 'ecm'
list modes 'ncm'
list modes 'mbim'
list modes 'rndis'
list modes 'qmi'
option wcdma_band '1/2/4/5/8/19'
option lte_band '1/2/3/4/5/7/8/12/13/14/17/18/19/20/25/26/28/29/30/32/34/38/39/40/41/42/43/46/48/66/71'
option nsa_band '1/2/3/5/7/8/12/13/14/18/20/25/26/28/29/30/38/40/41/48/66/70/71/75/76/77/78/79'
option sa_band '1/2/3/5/7/8/12/13/14/18/20/25/26/28/29/30/38/40/41/48/66/70/71/75/76/77/78/79'
option pre_dial_delay '0'
option post_init_delay '0'
option enable_dial '1'
option sms_at_port '/dev/ttyUSB2'
option pdp_type 'ipv4v6'
option auth 'none'
option metric '10'
option is_fixed_device '1'

View File

@@ -0,0 +1,13 @@
config ipv4
list member_track_ip 'test.ustc.edu.cn'
list member_track_ip 'cip.cc'
list member_track_ip '208.67.222.222'
list member_track_ip '208.67.220.220'
list member_interface 'wan'
option member_priority '10'
option member_weight '1'
config global 'global'
option sticky_mode '0'

View File

@@ -0,0 +1 @@
config main 'main'

View File

@@ -0,0 +1,23 @@
config sms_tool_js
option storage 'SM'
option mergesms '1'
option pnumber '86'
option prefix '1'
option lednotify '0'
option ussd '0'
option pdu '0'
option sendingroup '0'
option information '1'
option readport '/dev/ttyUSB2'
option algorithm 'Advanced'
option direction 'Start'
option sendport '/dev/ttyUSB2'
option coding 'auto'
option checktime '10'
option prestart '6'
option ledtype 'D'
option ussdport '/dev/ttyUSB2'
option atport '/dev/ttyUSB2'
option sms_count '0'

40
files/etc/config/system Normal file
View File

@@ -0,0 +1,40 @@
config system
option hostname 'NanakoWrt'
option timezone 'CST-8'
option ttylogin '0'
option log_size '128'
option urandom_seed '0'
option zonename 'Asia/Shanghai'
option log_proto 'udp'
option conloglevel '8'
option cronloglevel '7'
option zram_comp_algo 'lzo'
config timeserver 'ntp'
list server 'ntp.tencent.com'
list server 'ntp1.aliyun.com'
list server 'ntp.ntsc.ac.cn'
list server 'cn.ntp.org.cn'
config imm_init
option lang '1'
option system_chn '1'
option opkg_mirror 'https://mirrors.vsean.net/openwrt'
config led
option name '2.4'
option sysfs 'r3mini:blue1'
option trigger 'netdev'
option dev 'apcli0'
list mode 'tx'
list mode 'rx'
config led
option name '5'
option sysfs 'r3mini:blue2'
option trigger 'netdev'
option dev 'rax0'
list mode 'tx'
list mode 'rx'

11
files/etc/config/turboacc Normal file
View File

@@ -0,0 +1,11 @@
config turboacc 'config'
option fastpath 'mediatek_hnat'
option fastpath_mh_eth_hnat '1'
option fastpath_mh_eth_hnat_v6 '1'
option fastpath_mh_eth_hnat_macvlan '0'
option fastpath_mh_eth_hnat_bind_rate '30'
option fastpath_mh_eth_hnat_ppenum '2'
option fullcone '2'
option tcpcca 'cubic'

52
files/etc/config/wireless Normal file
View File

@@ -0,0 +1,52 @@
config wifi-device 'MT7986_1_1'
option type 'mtwifi'
option phy 'ra0'
option hwmode '11g'
option band '2g'
option dbdc_main '1'
option channel 'auto'
option txpower '100'
option htmode 'HE40'
option country 'CN'
option mu_beamformer '1'
option noscan '1'
option serialize '1'
config wifi-iface 'default_MT7986_1_1'
option device 'MT7986_1_1'
option network 'lan'
option mode 'ap'
option ssid 'N-2.4G'
option encryption 'sae-mixed'
option hidden '1'
option key 'Nasiko@90'
config wifi-device 'MT7986_1_2'
option type 'mtwifi'
option phy 'rax0'
option hwmode '11a'
option band '5g'
option dbdc_main '0'
option channel '36'
option txpower '100'
option htmode 'HE160'
option country 'CN'
option mu_beamformer '1'
option serialize '1'
config wifi-iface 'default_MT7986_1_2'
option device 'MT7986_1_2'
option network 'lan'
option mode 'ap'
option ssid 'N'
option encryption 'sae-mixed'
option key 'Nasiko@90'
config wifi-iface 'wifinet2'
option device 'MT7986_1_1'
option mode 'sta'
option network 'wwan2'
option ssid 'LLS'
option encryption 'psk2'
option key '1qaz@wsx'

Binary file not shown.

Binary file not shown.

17
files/etc/config/zerotier Normal file
View File

@@ -0,0 +1,17 @@
config zerotier 'global'
option enabled '1'
option fw_allow_input '1'
option local_conf_path '/etc/zerotier.conf'
option config_path '/etc/zerotier'
option port '9994'
option secret '249f53a5b3:0:5268ed39793010a57450706db1b9029c13f70fa378c29ca31ef528d0ccc0ff527ecfb0d7e08c66b9489cacef6a95c8e2b78325b06c679d431f1feb8847eb8c0a:f715f75785d25c39359561b1d4f12042099791a036217413b8bc9f3a8430e257aa03526976e5e51cb14be8d588bd6a40c366855acffe36b6c556d2cd9f54967f'
config network 'earth'
option enabled '0'
option id '8056c2e21c000001'
config network 'nn'
option id '377849d1044812c8'
option fw_allow_input '1'
option fw_allow_forward '1'

View File

@@ -0,0 +1,36 @@
#!/bin/sh
# Quectel RM551E-GL 专用脚本
[ "$PRODUCT" = "2c7c/122/515" ] || exit 0
case "$ACTION" in
add)
logger -t rm551e "Quectel RM551E-GL detected"
# 确保 option 驱动已加载并添加 ID
if ! grep -q "2c7c 0122" /sys/bus/usb-serial/drivers/option1/new_id 2>/dev/null; then
modprobe option
echo "2c7c 0122" > /sys/bus/usb-serial/drivers/option1/new_id
logger -t rm551e "Added USB ID to option driver"
sleep 2
fi
# 等待所有接口就绪
for i in $(seq 1 60); do
if [ -c /dev/cdc-wdm0 ] && \
[ -d /sys/class/net/wwan0 ] && \
[ -c /dev/ttyUSB0 ]; then
logger -t rm551e "All interfaces ready, starting network..."
sleep 3
ifup wwan 2>/dev/null || ifup wan
break
fi
sleep 1
done
;;
remove)
logger -t rm551e "Quectel RM551E-GL removed"
ifdown wwan 2>/dev/null || ifdown wan
;;
esac

18
files/etc/init.d/rm551e-driver Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh /etc/rc.common
START=18 # 在网络启动前,但在 USB 初始化后
STOP=99
boot() {
# 加载 option 驱动
modprobe option
# 添加 Quectel RM551E-GL 的 USB ID
echo "2c7c 0122" > /sys/bus/usb-serial/drivers/option1/new_id
logger -t rm551e-driver "Quectel RM551E-GL USB ID added to option driver"
}
start() {
boot
}

View File

@@ -0,0 +1,10 @@
#!/bin/sh
# 启用驱动加载服务
/etc/init.d/rm551e-driver enable
# 立即执行一次
modprobe option 2>/dev/null
echo "2c7c 0122" > /sys/bus/usb-serial/drivers/option1/new_id 2>/dev/null
exit 0

View File

@@ -0,0 +1 @@
r8kzyhn3kjr2umj4sdi5jvz2

View File

@@ -0,0 +1 @@
249f53a5b3:0:5268ed39793010a57450706db1b9029c13f70fa378c29ca31ef528d0ccc0ff527ecfb0d7e08c66b9489cacef6a95c8e2b78325b06c679d431f1feb8847eb8c0a:f715f75785d25c39359561b1d4f12042099791a036217413b8bc9f3a8430e257aa03526976e5e51cb14be8d588bd6a40c366855acffe36b6c556d2cd9f54967f

View File

@@ -0,0 +1,340 @@
# HELP zt_packet ZeroTier packet type counts
# TYPE zt_packet counter
zt_packet{direction="tx",packet_type="path_negotiation_request"} 0
zt_packet{direction="tx",packet_type="user_message"} 0
zt_packet{direction="tx",packet_type="push_direct_paths"} 116
zt_packet{direction="tx",packet_type="multicast_gather"} 104
zt_packet{direction="tx",packet_type="network_config"} 0
zt_packet{direction="tx",packet_type="remote_trace"} 0
zt_packet{direction="tx",packet_type="network_config_request"} 19
zt_packet{direction="tx",packet_type="multicast_frame"} 2289
zt_packet{direction="tx",packet_type="multicast_like"} 62
zt_packet{direction="tx",packet_type="echo"} 1736
zt_packet{direction="tx",packet_type="frame"} 1673
zt_packet{direction="tx",packet_type="error"} 2
zt_packet{direction="rx",packet_type="user_message"} 0
zt_packet{direction="tx",packet_type="nop"} 0
zt_packet{direction="tx",packet_type="hello"} 569
zt_packet{direction="tx",packet_type="ok"} 577
zt_packet{direction="rx",packet_type="multicast_gather"} 0
zt_packet{direction="rx",packet_type="echo"} 118
zt_packet{direction="rx",packet_type="frame"} 928
zt_packet{direction="rx",packet_type="multicast_like"} 51
zt_packet{direction="rx",packet_type="whois"} 0
zt_packet{direction="rx",packet_type="hello"} 170
zt_packet{direction="rx",packet_type="error"} 0
zt_packet{direction="rx",packet_type="network_config"} 0
zt_packet{direction="rx",packet_type="rendezvous"} 1123
zt_packet{direction="rx",packet_type="qos"} 0
zt_packet{direction="rx",packet_type="ext_frame"} 0
zt_packet{direction="rx",packet_type="network_credentials"} 25
zt_packet{direction="tx",packet_type="ack"} 0
zt_packet{direction="rx",packet_type="ack"} 0
zt_packet{direction="rx",packet_type="nop"} 0
zt_packet{direction="rx",packet_type="network_config_request"} 0
zt_packet{direction="rx",packet_type="path_negotiation_request"} 0
zt_packet{direction="rx",packet_type="multicast_frame"} 291
zt_packet{direction="rx",packet_type="push_direct_paths"} 74
zt_packet{direction="tx",packet_type="network_credentials"} 240
zt_packet{direction="rx",packet_type="remote_trace"} 0
zt_packet{direction="tx",packet_type="ext_frame"} 0
zt_packet{direction="rx",packet_type="ok"} 2544
zt_packet{direction="tx",packet_type="qos"} 0
zt_packet{direction="tx",packet_type="rendezvous"} 0
zt_packet{direction="tx",packet_type="whois"} 170
# HELP zt_packet_error ZeroTier packet errors
# TYPE zt_packet_error counter
zt_packet_error{direction="tx",error_type="internal_server_error"} 0
zt_packet_error{direction="tx",error_type="authentication_required"} 0
zt_packet_error{direction="rx",error_type="unsupported_operation"} 0
zt_packet_error{direction="rx",error_type="unwanted_multicast"} 0
zt_packet_error{direction="rx",error_type="need_membership_certificate"} 0
zt_packet_error{direction="tx",error_type="unwanted_multicast"} 0
zt_packet_error{direction="rx",error_type="identity_collision"} 0
zt_packet_error{direction="rx",error_type="authentication_required"} 0
zt_packet_error{direction="rx",error_type="obj_not_found"} 0
zt_packet_error{direction="rx",error_type="network_access_denied"} 0
zt_packet_error{direction="tx",error_type="identity_collision"} 0
zt_packet_error{direction="rx",error_type="internal_server_error"} 0
zt_packet_error{direction="tx",error_type="obj_not_found"} 0
zt_packet_error{direction="tx",error_type="unsupported_operation"} 0
zt_packet_error{direction="tx",error_type="need_membership_certificate"} 2
zt_packet_error{direction="tx",error_type="network_access_denied"} 0
# HELP zt_data number of bytes ZeroTier has transmitted or received
# TYPE zt_data counter
zt_data{direction="rx",protocol="tcp"} 0
zt_data{direction="tx",protocol="tcp"} 0
zt_data{direction="tx",protocol="udp"} 3439681
zt_data{direction="rx",protocol="udp"} 492484
# HELP zt_num_networks number of networks this instance is joined to
# TYPE zt_num_networks gauge
zt_num_networks 1
# HELP zt_network_multicast_groups_subscribed number of multicast groups networks are subscribed to
# TYPE zt_network_multicast_groups_subscribed gauge
zt_network_multicast_groups_subscribed{network_id="377849d1044812c8"} 6
# HELP zt_network_packets number of incoming/outgoing packets per network
# TYPE zt_network_packets counter
zt_network_packets{accepted="yes",direction="tx",network_id="377849d1044812c8"} 4259
zt_network_packets{accepted="no",direction="tx",network_id="377849d1044812c8"} 0
zt_network_packets{accepted="no",direction="rx",network_id="377849d1044812c8"} 0
zt_network_packets{accepted="yes",direction="rx",network_id="377849d1044812c8"} 1217
# HELP zt_peer_latency peer latency (ms)
# TYPE zt_peer_latency histogram
zt_peer_latency_count{node_id="cafe04eba9"} 0
zt_peer_latency_sum{node_id="cafe04eba9"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="1"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="3"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="6"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="10"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="30"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="60"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="100"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="300"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="600"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="1000"} 0
zt_peer_latency_bucket{node_id="cafe04eba9",le="+Inf"} 0
zt_peer_latency_count{node_id="fbb08c997f"} 0
zt_peer_latency_sum{node_id="fbb08c997f"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="1"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="3"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="6"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="10"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="30"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="60"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="100"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="300"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="600"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="1000"} 0
zt_peer_latency_bucket{node_id="fbb08c997f",le="+Inf"} 0
zt_peer_latency_count{node_id="b22c21bb3a"} 0
zt_peer_latency_sum{node_id="b22c21bb3a"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="1"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="3"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="6"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="10"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="30"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="60"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="100"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="300"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="600"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="1000"} 0
zt_peer_latency_bucket{node_id="b22c21bb3a",le="+Inf"} 0
zt_peer_latency_count{node_id="7ca0f22f1f"} 0
zt_peer_latency_sum{node_id="7ca0f22f1f"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="1"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="3"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="6"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="10"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="30"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="60"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="100"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="300"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="600"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="1000"} 0
zt_peer_latency_bucket{node_id="7ca0f22f1f",le="+Inf"} 0
zt_peer_latency_count{node_id="cafe80ed74"} 0
zt_peer_latency_sum{node_id="cafe80ed74"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="1"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="3"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="6"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="10"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="30"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="60"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="100"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="300"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="600"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="1000"} 0
zt_peer_latency_bucket{node_id="cafe80ed74",le="+Inf"} 0
zt_peer_latency_count{node_id="d0611c5d2e"} 171
zt_peer_latency_sum{node_id="d0611c5d2e"} 1093
zt_peer_latency_bucket{node_id="d0611c5d2e",le="1"} 0
zt_peer_latency_bucket{node_id="d0611c5d2e",le="3"} 108
zt_peer_latency_bucket{node_id="d0611c5d2e",le="6"} 135
zt_peer_latency_bucket{node_id="d0611c5d2e",le="10"} 135
zt_peer_latency_bucket{node_id="d0611c5d2e",le="30"} 171
zt_peer_latency_bucket{node_id="d0611c5d2e",le="60"} 171
zt_peer_latency_bucket{node_id="d0611c5d2e",le="100"} 171
zt_peer_latency_bucket{node_id="d0611c5d2e",le="300"} 171
zt_peer_latency_bucket{node_id="d0611c5d2e",le="600"} 171
zt_peer_latency_bucket{node_id="d0611c5d2e",le="1000"} 171
zt_peer_latency_bucket{node_id="d0611c5d2e",le="+Inf"} 171
zt_peer_latency_count{node_id="c42c47ae75"} 170
zt_peer_latency_sum{node_id="c42c47ae75"} 69782
zt_peer_latency_bucket{node_id="c42c47ae75",le="1"} 0
zt_peer_latency_bucket{node_id="c42c47ae75",le="3"} 0
zt_peer_latency_bucket{node_id="c42c47ae75",le="6"} 0
zt_peer_latency_bucket{node_id="c42c47ae75",le="10"} 0
zt_peer_latency_bucket{node_id="c42c47ae75",le="30"} 133
zt_peer_latency_bucket{node_id="c42c47ae75",le="60"} 157
zt_peer_latency_bucket{node_id="c42c47ae75",le="100"} 169
zt_peer_latency_bucket{node_id="c42c47ae75",le="300"} 169
zt_peer_latency_bucket{node_id="c42c47ae75",le="600"} 169
zt_peer_latency_bucket{node_id="c42c47ae75",le="1000"} 169
zt_peer_latency_bucket{node_id="c42c47ae75",le="+Inf"} 170
zt_peer_latency_count{node_id="747ee101e8"} 0
zt_peer_latency_sum{node_id="747ee101e8"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="1"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="3"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="6"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="10"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="30"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="60"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="100"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="300"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="600"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="1000"} 0
zt_peer_latency_bucket{node_id="747ee101e8",le="+Inf"} 0
zt_peer_latency_count{node_id="73ca7dd80a"} 118
zt_peer_latency_sum{node_id="73ca7dd80a"} 7733130
zt_peer_latency_bucket{node_id="73ca7dd80a",le="1"} 0
zt_peer_latency_bucket{node_id="73ca7dd80a",le="3"} 0
zt_peer_latency_bucket{node_id="73ca7dd80a",le="6"} 0
zt_peer_latency_bucket{node_id="73ca7dd80a",le="10"} 0
zt_peer_latency_bucket{node_id="73ca7dd80a",le="30"} 0
zt_peer_latency_bucket{node_id="73ca7dd80a",le="60"} 0
zt_peer_latency_bucket{node_id="73ca7dd80a",le="100"} 0
zt_peer_latency_bucket{node_id="73ca7dd80a",le="300"} 0
zt_peer_latency_bucket{node_id="73ca7dd80a",le="600"} 0
zt_peer_latency_bucket{node_id="73ca7dd80a",le="1000"} 0
zt_peer_latency_bucket{node_id="73ca7dd80a",le="+Inf"} 118
zt_peer_latency_count{node_id="c85a9a7afa"} 0
zt_peer_latency_sum{node_id="c85a9a7afa"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="1"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="3"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="6"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="10"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="30"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="60"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="100"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="300"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="600"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="1000"} 0
zt_peer_latency_bucket{node_id="c85a9a7afa",le="+Inf"} 0
zt_peer_latency_count{node_id="377849d104"} 6
zt_peer_latency_sum{node_id="377849d104"} 196655
zt_peer_latency_bucket{node_id="377849d104",le="1"} 0
zt_peer_latency_bucket{node_id="377849d104",le="3"} 0
zt_peer_latency_bucket{node_id="377849d104",le="6"} 0
zt_peer_latency_bucket{node_id="377849d104",le="10"} 0
zt_peer_latency_bucket{node_id="377849d104",le="30"} 3
zt_peer_latency_bucket{node_id="377849d104",le="60"} 3
zt_peer_latency_bucket{node_id="377849d104",le="100"} 3
zt_peer_latency_bucket{node_id="377849d104",le="300"} 3
zt_peer_latency_bucket{node_id="377849d104",le="600"} 3
zt_peer_latency_bucket{node_id="377849d104",le="1000"} 3
zt_peer_latency_bucket{node_id="377849d104",le="+Inf"} 6
# HELP zt_peer_path_count number of paths to peer
# TYPE zt_peer_path_count gauge
zt_peer_path_count{node_id="cafe80ed74",status="dead"} 0
zt_peer_path_count{node_id="cafe04eba9",status="alive"} 0
zt_peer_path_count{node_id="fbb08c997f",status="dead"} 0
zt_peer_path_count{node_id="747ee101e8",status="alive"} 0
zt_peer_path_count{node_id="377849d104",status="alive"} 1
zt_peer_path_count{node_id="377849d104",status="dead"} 4
zt_peer_path_count{node_id="c85a9a7afa",status="alive"} 0
zt_peer_path_count{node_id="fbb08c997f",status="alive"} 0
zt_peer_path_count{node_id="c85a9a7afa",status="dead"} 0
zt_peer_path_count{node_id="d0611c5d2e",status="alive"} 6
zt_peer_path_count{node_id="7ca0f22f1f",status="dead"} 0
zt_peer_path_count{node_id="73ca7dd80a",status="alive"} 0
zt_peer_path_count{node_id="d0611c5d2e",status="dead"} 0
zt_peer_path_count{node_id="73ca7dd80a",status="dead"} 0
zt_peer_path_count{node_id="cafe04eba9",status="dead"} 0
zt_peer_path_count{node_id="b22c21bb3a",status="dead"} 0
zt_peer_path_count{node_id="c42c47ae75",status="alive"} 6
zt_peer_path_count{node_id="c42c47ae75",status="dead"} 0
zt_peer_path_count{node_id="747ee101e8",status="dead"} 0
zt_peer_path_count{node_id="7ca0f22f1f",status="alive"} 0
zt_peer_path_count{node_id="cafe80ed74",status="alive"} 0
zt_peer_path_count{node_id="b22c21bb3a",status="alive"} 0
# HELP zt_peer_packets number of packets to/from a peer
# TYPE zt_peer_packets counter
zt_peer_packets{direction="tx",node_id="cafe80ed74"} 0
zt_peer_packets{direction="rx",node_id="cafe04eba9"} 176
zt_peer_packets{direction="rx",node_id="fbb08c997f"} 0
zt_peer_packets{direction="tx",node_id="747ee101e8"} 301
zt_peer_packets{direction="rx",node_id="747ee101e8"} 0
zt_peer_packets{direction="rx",node_id="377849d104"} 1381
zt_peer_packets{direction="tx",node_id="377849d104"} 253
zt_peer_packets{direction="tx",node_id="c85a9a7afa"} 301
zt_peer_packets{direction="rx",node_id="cafe80ed74"} 68
zt_peer_packets{direction="tx",node_id="b22c21bb3a"} 301
zt_peer_packets{direction="tx",node_id="d0611c5d2e"} 1856
zt_peer_packets{direction="rx",node_id="c85a9a7afa"} 26
zt_peer_packets{direction="tx",node_id="cafe04eba9"} 0
zt_peer_packets{direction="tx",node_id="fbb08c997f"} 301
zt_peer_packets{direction="rx",node_id="c42c47ae75"} 1227
zt_peer_packets{direction="rx",node_id="73ca7dd80a"} 327
zt_peer_packets{direction="tx",node_id="c42c47ae75"} 1000
zt_peer_packets{direction="tx",node_id="73ca7dd80a"} 319
zt_peer_packets{direction="rx",node_id="d0611c5d2e"} 2117
zt_peer_packets{direction="rx",node_id="7ca0f22f1f"} 0
zt_peer_packets{direction="tx",node_id="7ca0f22f1f"} 301
zt_peer_packets{direction="rx",node_id="b22c21bb3a"} 0
# HELP zt_peer_packet_errors number of incoming packet errors from a peer
# TYPE zt_peer_packet_errors counter
zt_peer_packet_errors{node_id="cafe04eba9"} 0
zt_peer_packet_errors{node_id="fbb08c997f"} 0
zt_peer_packet_errors{node_id="b22c21bb3a"} 0
zt_peer_packet_errors{node_id="7ca0f22f1f"} 0
zt_peer_packet_errors{node_id="cafe80ed74"} 0
zt_peer_packet_errors{node_id="d0611c5d2e"} 0
zt_peer_packet_errors{node_id="c42c47ae75"} 0
zt_peer_packet_errors{node_id="747ee101e8"} 0
zt_peer_packet_errors{node_id="73ca7dd80a"} 0
zt_peer_packet_errors{node_id="c85a9a7afa"} 0
zt_peer_packet_errors{node_id="377849d104"} 0
# HELP controller_network_count number of networks the controller is serving
# TYPE controller_network_count gauge
controller_network_count 0
# HELP controller_member_count number of network members the controller is serving
# TYPE controller_member_count gauge
controller_member_count 0
# HELP controller_network_change_count number of times a network configuration is changed
# TYPE controller_network_change_count counter
controller_network_change_count 0
# HELP controller_member_change_count number of times a network member configuration is changed
# TYPE controller_member_change_count counter
controller_member_change_count 0
# HELP controller_member_auth_count number of network member auths
# TYPE controller_member_auth_count counter
controller_member_auth_count 0
# HELP controller_member_deauth_count number of network member deauths
# TYPE controller_member_deauth_count counter
controller_member_deauth_count 0
# HELP controller_network_config_request_queue number of entries in the request queue for network configurations
# TYPE controller_network_config_request_queue gauge
controller_network_config_request_queue 0
# HELP controller_sso_expiration_checks number of sso expiration checks done
# TYPE controller_sso_expiration_checks counter
controller_sso_expiration_checks 0
# HELP controller_sso_timeouts number of sso timeouts
# TYPE controller_sso_timeouts counter
controller_sso_timeouts 0
# HELP controller_network_config_request count of config requests handled
# TYPE controller_network_config_request counter
controller_network_config_request 0
# HELP controller_network_config_request_threads number of active network config handling threads
# TYPE controller_network_config_request_threads gauge
controller_network_config_request_threads 0
# HELP controller_db_get_network counter
# TYPE controller_db_get_network counter
controller_db_get_network 0
# HELP controller_db_get_network_and_member counter
# TYPE controller_db_get_network_and_member counter
controller_db_get_network_and_member 0
# HELP controller_db_get_networK_and_member_summary counter
# TYPE controller_db_get_networK_and_member_summary counter
controller_db_get_networK_and_member_summary 0
# HELP controller_db_get_member_list counter
# TYPE controller_db_get_member_list counter
controller_db_get_member_list 0
# HELP controller_db_get_network_list counter
# TYPE controller_db_get_network_list counter
controller_db_get_network_list 0
# HELP controller_db_member_change counter
# TYPE controller_db_member_change counter
controller_db_member_change 0
# HELP controller_db_network_change counter
# TYPE controller_db_network_change counter
controller_db_network_change 0

View File

@@ -0,0 +1 @@
nsoqvidi1fg915clbvlwvjbd

Binary file not shown.

View File

@@ -0,0 +1,21 @@
v=0000000000000007
nwid=377849d1044812c8
ts=000001979aa3a59f
ctmd=00000000001b7740
r=000000000000000e
id=249f53a5b3
tt=0000000000
tl=0000000000000000
f=0000000000000002
ml=0000000000000020
t=0000000000000000
n=Nanako
mtu=0000000000000af0
C=\0\0\0\0\0\0\0\0\0\0\0—š£¥Ÿ\0\0\0\0\0w@\0\0\0\0\0\0\07xIÑHÈ\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$ŸS¥³ÿÿÿÿÿÿÿÿ\0\0\0\0\0\0\0‚¢è „ÿÿÿÿÿÿÿÿ\0\0\0\0\0\0\0<04>öÃ/‡ÈNYÿÿÿÿÿÿÿÿ\0\0\0\0\0\0\05¹3•<Áiÿÿÿÿÿÿÿÿ\0\0\0\0\0\0\0ûl<C3BB>¤*´Oÿÿÿÿÿÿÿÿ7xIÑÄ3Å߉mB€žM`u ë«ÐXh"b)·–œ\eIÓŸ%…ê\n±j~<Üfdªý”ä!Ï®½X¨“ˆ¾Óê¾Õ\06Á<36>¦rú~Õ%7+CÑ ¿xêGãV×KuL®ê
COO=7xIÑHÈ\0\0—š£¥Ÿ\0\0\0\0\0\0\0\0\0\0\0\0\np,¦\0\0\0\0\0\0\0\0\0\0\0\0$ŸS¥³7xIÑ\0`z\0d×\r`ä¿£é¯éÀ®\r®Kèƒ>ù‡èªPfà<66>:³õùˆ']ûJr<1F>»ò <09>*\rü…޾€ü饥À´òÀ^ #w(Z“hÑ2ÓZ²Ô6 B¼5íR’ƒ¢>ÇD)<29>$\0\0
RT=\np,\0\0\0\0\0\0\0\n'\0\0\np,[\0\0\0\0\0\0\n'\0\0\np,¦\0\0\0\0\0\0
I=\np,¦\0
R=\0
DNS=\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
ssov=0000000000000000
ssoe=0

View File

@@ -0,0 +1,4 @@
allowManaged=1
allowGlobal=0
allowDefault=0
allowDNS=0

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
files/etc/zerotier/planet Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
6125

View File

@@ -0,0 +1 @@
9994

View File

@@ -0,0 +1,35 @@
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=autoksmbd
PKG_VERSION:=1
PKG_RELEASE:=12
include $(INCLUDE_DIR)/package.mk
define Package/autoksmbd
TITLE:=ksmbd autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=+luci-app-ksmbd +wsdd2
PKGARCH:=all
endef
define Package/autoksmbd/description
A hotplug script to config Ksmbd share automatically.
endef
define Build/Compile
endef
define Package/autoksmbd/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/block
$(INSTALL_BIN) ./files/20-ksmbd $(1)/etc/hotplug.d/block/
endef
$(eval $(call BuildPackage,autoksmbd))

View File

@@ -0,0 +1,120 @@
#!/bin/sh
#
# D-Team Technology Co.,Ltd. ShenZhen
# 作者:Vic
#
# 警告:对着屏幕的哥们,我们允许你使用此脚本,但不允许你抹去作者的信息,请保留这段话。
#
. /lib/functions.sh
. /lib/functions/service.sh
global=0
config_file="/etc/config/ksmbd"
[ ! -f /etc/config/ksmbd ] && {
echo "
config globals
option 'workgroup' 'WORKGROUP'
option 'description' 'Ksmbd on OpenWrt'
" > $config_file
}
wait_for_init() {
for i in `seq 30`
do
[ -e /tmp/procd.done ] || {
sleep 1; continue;
}
return
done
}
smb_handle() {
config_get path $1 path
if [ "$path" = "$2" ] ;then
global=1
fi
}
chk_en() {
config_get_bool autoshare $1 autoshare 1
[ $autoshare -eq 0 ] && exit
}
config_load ksmbd
config_foreach chk_en ksmbd
device=`basename $DEVPATH`
case "$ACTION" in
add)
case "$device" in
sd*);;
md*);;
hd*);;
*) return;;
esac
path="/dev/$device"
wait_for_init
[ "$(uci -q get ksmbd.@globals[0].autoshare)" == "1" ] && {
/etc/init.d/ksmbd restart
exit 0;
}
cat /proc/mounts | grep -v '/boot\|/opt' | while read j
do
str=${j%% *}
if [ "$str" == $path ];then
strr=${j#* }
target=${strr%% *}
global=0
config_foreach smb_handle share $target
name=${target#*/mnt/}
name=$(echo $name | sed -e "s/^\///")
if [ $global -eq 0 ] ;then
echo -e "\n\nconfig share" >> $config_file
echo -e "\toption auto '1'" >> $config_file
echo -e "\toption name '$name'" >> $config_file
echo -e "\toption path '$target'" >> $config_file
echo -e "\toption read_only 'no'" >> $config_file
echo -e "\toption guest_ok 'yes'" >> $config_file
echo -e "\toption create_mask '0666'" >> $config_file
echo -e "\toption dir_mask '0777'" >> $config_file
echo -e "\toption device '$device'" >> $config_file
echo -e "\toption force_root '1'" >> $config_file
/etc/init.d/ksmbd reload
return
fi
fi
done
uci -q set ksmbd.@globals[0].autoshare='1'
uci commit ksmbd
;;
remove)
i=0
while true
do
dev=`uci get ksmbd.@share[$i].device`
[ $? -ne 0 ] && break
[ "$dev" = "$device" ] && {
auto=`uci get ksmbd.@share[$i].auto`
[ $auto = "1" ] && {
mount_dir=`uci get ksmbd.@share[$i].name`
uci delete ksmbd.@share[$i]
uci commit
/etc/init.d/ksmbd reload
return
}
}
let i+=1
done
;;
esac

View File

@@ -13,6 +13,15 @@
global=0
config_file="/etc/config/samba4"
[ ! -f /etc/config/samba4 ] && {
echo "
config samba
option workgroup 'WORKGROUP'
option charset 'UTF-8'
option description 'Samba on OpenWRT'
" > $config_file
}
wait_for_init() {
for i in `seq 30`
do
@@ -47,7 +56,6 @@ case "$ACTION" in
sd*);;
md*);;
hd*);;
mmcblk*);;
*) return;;
esac
@@ -55,6 +63,11 @@ case "$ACTION" in
wait_for_init
[ "$(uci -q get samba4.@samba[0].autoshare)" == "1" ] && {
/etc/init.d/samba4 restart
exit 0;
}
cat /proc/mounts | grep -v '/boot\|/opt' | while read j
do
str=${j%% *}
@@ -64,7 +77,7 @@ case "$ACTION" in
global=0
config_foreach smb_handle sambashare $target
name=${target#*/mnt/}
name=$(echo $name | sed -e "s/^\///")
if [ $global -eq 0 ] ;then
echo -e "\n\nconfig sambashare" >> $config_file
echo -e "\toption auto '1'" >> $config_file
@@ -75,12 +88,14 @@ case "$ACTION" in
echo -e "\toption create_mask '0666'" >> $config_file
echo -e "\toption dir_mask '0777'" >> $config_file
echo -e "\toption device '$device'" >> $config_file
echo -e "\toption inherit_owner 'yes'" >> $config_file
echo -e "\toption force_root '1'" >> $config_file
/etc/init.d/samba4 reload
return
fi
fi
done
uci -q set samba4.@samba[0].autoshare='1'
uci commit samba4
;;
remove)
@@ -103,4 +118,3 @@ case "$ACTION" in
let i+=1
done
;;
esac

View File

@@ -0,0 +1,39 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=Airpi-gpio-fan
PKG_VERSION:=1.0
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define KernelPackage/Airpi-gpio-fan
SUBMENU:=Other modules
TITLE:=Airpi GPIO Fan Control Driver
FILES:=$(PKG_BUILD_DIR)/Airpi-gpio-fan.ko
AUTOLOAD:=$(call AutoLoad,90,Airpi-gpio-fan)
KCONFIG:=
endef
define KernelPackage/Airpi-gpio-fan/description
Kernel module for PWM fan control using GPIO
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
MAKE_OPTS:= \
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
KDIR="$(LINUX_DIR)"
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
M="$(PKG_BUILD_DIR)" \
modules
endef
$(eval $(call KernelPackage,Airpi-gpio-fan))

View File

@@ -0,0 +1,131 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/gpio.h>
#include <linux/hrtimer.h>
#include <linux/ktime.h>
#include <linux/thermal.h>
#define GPIO_FAN 483
#define MAX_DUTY_CYCLE 255
#define PWM_PERIOD_NS 1000000 // 1ms period
//by Manper 20250519
static struct thermal_cooling_device *fan_cdev;
static int duty_cycle = 0; // Duty cycle value from 0 to 255
static struct hrtimer pwm_timer;
static ktime_t ktime_period;
static unsigned int current_state = 0;
static int fan_get_max_state(struct thermal_cooling_device *cdev, unsigned long *state) {
*state = 3;
return 0;
}
static int fan_get_cur_state(struct thermal_cooling_device *cdev, unsigned long *state) {
*state = current_state;
return 0;
}
static int fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) {
if (state > 3)
return -EINVAL;
current_state = state;
switch (state) {
case 0: duty_cycle = 40; break;
case 1: duty_cycle = 80; break;
case 2: duty_cycle = 160; break;
case 3: duty_cycle = 220; break;
}
return 0;
}
static const struct thermal_cooling_device_ops fan_cooling_ops = {
.get_max_state = fan_get_max_state,
.get_cur_state = fan_get_cur_state,
.set_cur_state = fan_set_cur_state,
};
static enum hrtimer_restart pwm_timer_callback(struct hrtimer *timer) {
static bool fan_on = false;
int dc = READ_ONCE(duty_cycle);
int on_time_ns = ((MAX_DUTY_CYCLE - dc) * PWM_PERIOD_NS) / MAX_DUTY_CYCLE;
ktime_t ktime_on = ktime_set(0, on_time_ns);
ktime_t ktime_off = ktime_set(0, PWM_PERIOD_NS - on_time_ns);
if (fan_on) {
gpio_set_value(GPIO_FAN, 0);
hrtimer_forward_now(timer, ktime_off);
} else {
gpio_set_value(GPIO_FAN, 1);
hrtimer_forward_now(timer, ktime_on);
}
fan_on = !fan_on;
return HRTIMER_RESTART;
}
static ssize_t set_duty_cycle(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) {
int ret, new_duty_cycle;
ret = kstrtoint(buf, 10, &new_duty_cycle);
if (ret < 0 || new_duty_cycle < 0 || new_duty_cycle > MAX_DUTY_CYCLE)
return -EINVAL;
duty_cycle = new_duty_cycle;
return count;
}
static struct kobj_attribute duty_cycle_attr = __ATTR(duty_cycle, 0220, NULL, set_duty_cycle);
static int __init gpio_pwm_fan_init(void) {
int ret;
// Request the GPIO
ret = gpio_request(GPIO_FAN, "gpio_pwm_fan");
if (ret) {
printk(KERN_ERR "Failed to request GPIO %d\n", GPIO_FAN);
return ret;
}
// Set GPIO direction
gpio_direction_output(GPIO_FAN, 0);
// Initialize high-resolution timer
ktime_period = ktime_set(0, PWM_PERIOD_NS);
hrtimer_init(&pwm_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
pwm_timer.function = pwm_timer_callback;
hrtimer_start(&pwm_timer, ktime_period, HRTIMER_MODE_REL);
// Create sysfs entry
ret = sysfs_create_file(kernel_kobj, &duty_cycle_attr.attr);
if (ret) {
hrtimer_cancel(&pwm_timer);
gpio_free(GPIO_FAN);
return ret;
}
fan_cdev = thermal_cooling_device_register("pwm_fan", NULL, &fan_cooling_ops);
if (IS_ERR(fan_cdev)) {
gpio_free(GPIO_FAN);
hrtimer_cancel(&pwm_timer);
sysfs_remove_file(kernel_kobj, &duty_cycle_attr.attr);
return PTR_ERR(fan_cdev);
}
printk(KERN_INFO "GPIO PWM Fan module loaded\n");
return 0;
}
static void __exit gpio_pwm_fan_exit(void) {
hrtimer_cancel(&pwm_timer);
sysfs_remove_file(kernel_kobj, &duty_cycle_attr.attr);
gpio_free(GPIO_FAN);
thermal_cooling_device_unregister(fan_cdev);
printk(KERN_INFO "GPIO PWM Fan module unloaded\n");
}
module_init(gpio_pwm_fan_init);
module_exit(gpio_pwm_fan_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Your Name");
MODULE_DESCRIPTION("GPIO PWM Fan Control");

View File

@@ -0,0 +1 @@
obj-m += Airpi-gpio-fan.o

View File

@@ -244,7 +244,9 @@ $(eval $(call KernelPackage,phy-realtek))
define KernelPackage/phy-air-en8811h
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Airoha EN8811H PHY Driver
KCONFIG:=CONFIG_AIR_EN8811H_PHY
KCONFIG:= \
CONFIG_AIROHA_EN8811H_PHY=y \
CONFIG_AIROHA_EN8811H_PHY_DEBUGFS=y
DEPENDS:=+kmod-libphy
FILES:=$(LINUX_DIR)/drivers/net/phy/air_en8811h.ko
AUTOLOAD:=$(call AutoLoad,20,air_en8811h,1)

View File

@@ -1306,6 +1306,20 @@ endef
$(eval $(call KernelPackage,usb-net-qmi-wwan))
define KernelPackage/usb-net-qmi-wwan-quectel-bpi
TITLE:=QMI WWAN driver
KCONFIG:=CONFIG_USB_NET_QMI_WWAN
FILES:= $(LINUX_DIR)/drivers/$(USBNET_DIR)/qmi_wwan_q.ko
AUTOLOAD:=$(call AutoProbe,qmi_wwan_q)
$(call AddDepends/usb-net,+kmod-usb-wdm)
endef
define KernelPackage/usb-net-qmi-wwan-quectel-bpi/description
QMI WWAN driver for Quectel bpi version
endef
$(eval $(call KernelPackage,usb-net-qmi-wwan-quectel-bpi))
define KernelPackage/usb-net-rtl8150
TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
KCONFIG:=CONFIG_USB_RTL8150

View File

@@ -4,7 +4,7 @@ comment "Build Options"
config OPENSSL_OPTIMIZE_SPEED
bool
default y
default y if x86_64 || i386
prompt "Enable optimization for speed instead of size"
select OPENSSL_WITH_ASM
help
@@ -38,9 +38,9 @@ config OPENSSL_WITH_ASM
config OPENSSL_WITH_SSE2
bool
default y if x86_64 || i386 && !TARGET_x86_legacy
default y if !TARGET_x86_legacy && !TARGET_x86_geode
prompt "Enable use of x86 SSE2 instructions"
depends on OPENSSL_WITH_ASM && x86_64 || i386
depends on OPENSSL_WITH_ASM && i386
help
Use of SSE2 instructions greatly increase performance with a
minimum increase in package size, but it will bring no benefit
@@ -133,7 +133,7 @@ config OPENSSL_WITH_CHACHA_POLY1305
config OPENSSL_PREFER_CHACHA_OVER_GCM
bool
default y if !x86_64
default y if !x86_64 && !aarch64
prompt "Prefer ChaCha20-Poly1305 over AES-GCM by default"
depends on OPENSSL_WITH_CHACHA_POLY1305
help

View File

@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=openssl
PKG_VERSION:=3.0.16
PKG_VERSION:=3.4.0
PKG_RELEASE:=1
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
@@ -17,11 +17,13 @@ PKG_BUILD_PARALLEL:=1
PKG_BASE:=$(subst $(space),.,$(wordlist 1,2,$(subst .,$(space),$(PKG_VERSION))))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= \
https://www.openssl.org/source/ \
https://www.openssl.org/source/old/$(PKG_BASE)/ \
https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
http://www.openssl.org/source/ \
http://www.openssl.org/source/old/$(PKG_BASE)/ \
https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/ \
http://ftp.fi.muni.cz/pub/openssl/source/ \
http://ftp.fi.muni.cz/pub/openssl/source/old/$(PKG_BASE)/
PKG_HASH:=57e03c50feab5d31b152af2b764f10379aecd8ee92f16c985983ce4a99f7ef86
PKG_HASH:=e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE

0
package/libs/openssl/files/openssl.init Executable file → Normal file
View File

View File

@@ -10,7 +10,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/Configure
+++ b/Configure
@@ -1677,7 +1677,9 @@ $config{CFLAGS} = [ map { $_ eq '--ossl-
@@ -1788,7 +1788,9 @@ $config{CFLAGS} = [ map { $_ eq '--ossl-
unless ($disabled{afalgeng}) {
$config{afalgeng}="";
@@ -18,6 +18,6 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
+ if ($target =~ m/openwrt$/) {
+ push @{$config{engdirs}}, "afalg";
+ } elsif (grep { $_ eq 'afalgeng' } @{$target{enable}}) {
my $minver = 4*10000 + 1*100 + 0;
if ($config{CROSS_COMPILE} eq "") {
my $verstr = `uname -r`;
push @{$config{engdirs}}, "afalg";
} else {
disable('not-linux', 'afalgeng');

View File

@@ -10,7 +10,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/crypto/build.info
+++ b/crypto/build.info
@@ -109,7 +109,7 @@ DEFINE[../libcrypto]=$UPLINKDEF
@@ -115,7 +115,7 @@ DEFINE[../libcrypto]=$UPLINKDEF
DEPEND[info.o]=buildinf.h
DEPEND[cversion.o]=buildinf.h

View File

@@ -16,7 +16,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -1506,11 +1506,29 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
@@ -1487,11 +1487,29 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head,
&tail);
@@ -46,7 +46,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
/*
* ...and generally, our preferred cipher is AES.
@@ -1565,7 +1583,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
@@ -1546,7 +1564,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
* Within each group, ciphers remain sorted by strength and previous
* preference, i.e.,
* 1) ECDHE > DHE
@@ -55,7 +55,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
* 3) AES > rest
* 4) TLS 1.2 > legacy
*
@@ -2236,7 +2254,13 @@ const char *OSSL_default_cipher_list(voi
@@ -2245,7 +2263,13 @@ const char *OSSL_default_cipher_list(voi
*/
const char *OSSL_default_ciphersuites(void)
{
@@ -71,7 +71,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
}
--- a/include/openssl/ssl.h.in
+++ b/include/openssl/ssl.h.in
@@ -195,9 +195,15 @@ extern "C" {
@@ -199,9 +199,15 @@ extern "C" {
* DEPRECATED IN 3.0.0, in favor of OSSL_default_ciphersuites()
* Update both macro and function simultaneously
*/

View File

@@ -21,7 +21,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/engines/e_devcrypto.c
+++ b/engines/e_devcrypto.c
@@ -905,7 +905,7 @@ static void prepare_digest_methods(void)
@@ -906,7 +906,7 @@ static void prepare_digest_methods(void)
for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data);
i++) {
@@ -30,7 +30,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
/*
* Check that the digest is usable
@@ -1119,7 +1119,7 @@ static const ENGINE_CMD_DEFN devcrypto_c
@@ -1120,7 +1120,7 @@ static const ENGINE_CMD_DEFN devcrypto_c
#ifdef IMPLEMENT_DIGEST
{DEVCRYPTO_CMD_DIGESTS,
"DIGESTS",

View File

@@ -10,7 +10,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/engines/e_devcrypto.c
+++ b/engines/e_devcrypto.c
@@ -211,9 +211,8 @@ static int cipher_init(EVP_CIPHER_CTX *c
@@ -212,9 +212,8 @@ static int cipher_init(EVP_CIPHER_CTX *c
int ret;
/* cleanup a previous session */

Submodule package/luci-app-partexp added at b2ffa8b8ea

Submodule package/luci-app-zerotier added at 84061c8aff

View File

@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Easy QoS
LUCI_DEPENDS:=+tc +kmod-sched-core +kmod-ifb @!PACKAGE_luci-app-eqos
LUCI_DEPENDS:=+wget-ssl +tc +kmod-sched-core +kmod-ifb +ebtables-legacy-utils +ebtables-legacy @!PACKAGE_luci-app-eqos
PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
PKG_NAME:=luci-app-eqos-mtk

View File

@@ -72,10 +72,10 @@ iptables_stop() {
for i in $(seq 32 63); do
echo 1 0 0 0 0 4 4 > /sys/kernel/debug/hnat/qdma_txq$i
done
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch0
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch1
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch2
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch3
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch0
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch1
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch2
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch3
}
iptables_start_prepare() {
@@ -95,8 +95,8 @@ iptables_start_inital() {
iptables -t mangle -D FORWARD -j eqos
iptables -t mangle -A FORWARD -j eqos
echo 1 > /sys/kernel/debug/hnat/qos_toggle
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch0
echo 0 wrr 10000000 > /sys/kernel/debug/hnat/qdma_sch1
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch0
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch1
echo 0 0 0 0 0 0 0 > /sys/kernel/debug/hnat/qdma_txq0
echo 1 0 0 0 0 0 0 > /sys/kernel/debug/hnat/qdma_txq32
echo "11 5" >/sys/kernel/debug/hnat/hnat_setting

View File

@@ -24,7 +24,7 @@
},
"admin/status/routes": {
"title": "Routes",
"title": "Routing",
"order": 3,
"action": {
"type": "view",

View File

@@ -158,13 +158,6 @@ return view.extend({
]);
}
/* Mark user edited */
s = m.section(form.NamedSection, 'global', 'turboacc');
o = s.option(form.HiddenValue, 'set');
o.load = (/* ... */) => { return 1 };
o.readonly = true;
o.rmempty = false;
s = m.section(form.NamedSection, 'config', 'turboacc');
o = s.option(form.ListValue, 'fastpath', _('Fastpath engine'),
@@ -226,10 +219,9 @@ return view.extend({
o.rmempty = false;
o.depends('fastpath_mh_eth_hnat', '1');
o = s.option(form.Flag, 'fastpath_mh_eth_hnat_macvlan', _('Enable ethernet HNAT for MACVLAN WAN device'),
_('Enable hardware offloading for macvlan.'));
o.default = o.disabled;
o.rmempty = false;
o = s.option(form.Value, 'fastpath_mh_eth_hnat_ap', _('Enable AP Mode'),
_('Fill in ip to enable AP Mode(reboot needed)'));
o.optional = true;
o.depends('fastpath_mh_eth_hnat', '1');
o = s.option(form.Value, 'fastpath_mh_eth_hnat_bind_rate', _('HNAT bind rate threshold (pps)'),
@@ -260,7 +252,7 @@ return view.extend({
o.value(i);
o.default = 'cubic';
o.rmempty = false;
return m.render();
}
});

View File

@@ -33,11 +33,11 @@ msgid "Enable IPv6 Acceleration."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:177
msgid "Enable ethernet HNAT for MACVLAN WAN device"
msgid "Enable AP Mode"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:178
msgid "Enable hardware offloading for macvlan (sing wan only)."
msgid "Fill in ip to enable AP Mode(reboot needed)"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:183

View File

@@ -58,12 +58,12 @@ msgid "Enable hardware offloading for wired IPv6 connections."
msgstr "为有线 IPv6 连接启用硬件加速。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:177
msgid "Enable ethernet HNAT for MACVLAN WAN device"
msgstr "启用MACVLAN WAN 设备 HNAT"
msgid "Enable AP Mode"
msgstr "启用AP模式"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:178
msgid "Enable hardware offloading for macvlan."
msgstr "为MACVLAN 连接启用硬件加速。"
msgid "Fill in ip to enable AP Mode(reboot needed)"
msgstr "填写IP将启动AP模式同网段不重复ip,需重启后生效.对于无线桥接请桥接完成后再启用AP模式)"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:183
msgid "HNAT bind rate threshold (pps)"

View File

@@ -1,6 +1,2 @@
config turboacc 'global'
option set '0'
config turboacc 'config'

View File

@@ -4,8 +4,8 @@
START=90
STOP=10
start() {
USE_PROCD=1
start_service() {
config_load "turboacc"
local fastpath
@@ -50,7 +50,7 @@ start() {
echo "$fastpath_mh_eth_hnat" > "$hnat_path/hook_toggle"
if [ "$fastpath_mh_eth_hnat" -eq "1" ]; then
local fastpath_mh_eth_hnat_v6 fastpath_mh_eth_hnat_macvlan fastpath_mh_eth_hnat_bind_rate
local fastpath_mh_eth_hnat_v6 fastpath_mh_eth_hnat_ap fastpath_mh_eth_hnat_bind_rate
config_get_bool "fastpath_mh_eth_hnat_v6" "config" "fastpath_mh_eth_hnat_v6" "1"
echo "8 $fastpath_mh_eth_hnat_v6" > "$hnat_path/hnat_setting"
@@ -58,14 +58,13 @@ start() {
config_get "fastpath_mh_eth_hnat_bind_rate" "config" "fastpath_mh_eth_hnat_bind_rate" "30"
echo "11 $fastpath_mh_eth_hnat_bind_rate" > "$hnat_path/hnat_setting"
config_get_bool "fastpath_mh_eth_hnat_macvlan" "config" "fastpath_mh_eth_hnat_macvlan" "0"
echo "12 $fastpath_mh_eth_hnat_macvlan" > "$hnat_path/hnat_setting"
config_get "fastpath_mh_eth_hnat_ap" "config" "fastpath_mh_eth_hnat_ap" ""
fi
;;
esac
local fullcone
config_get "fullcone" "config" "fullcone" "0"
config_get "fullcone" "config" "fullcone" "2"
echo "$fullcone" > /proc/sys/net/netfilter/nf_conntrack_nat_mode
local tcpcca
@@ -74,4 +73,55 @@ start() {
uci -q commit "firewall"
/etc/init.d/firewall restart >"/dev/null" 2>&1
available_interfaces=""
for iface in eth0 eth1 wan; do
if ifconfig $iface 2>&1 | grep -qv "error fetching interface information"; then
echo "$iface interface detected."
available_interfaces="$available_interfaces $iface"
else
echo "$iface interface not found."
fi
done
if echo "$fastpath_mh_eth_hnat_ap" | grep -qE '^([0-9]{1,3}\.){3}[0-9]{1,3}$'; then
echo "Valid IPv4 address detected: $fastpath_mh_eth_hnat_ap"
uci delete network.wan
uci delete network.wwan
uci delete network.wan6
current_ports=$(uci get network.@device[0].ports)
echo "Current bridge ports: $current_ports"
new_ports="$current_ports"
for port in $available_interfaces; do
if echo "$current_ports" | grep -qw "$port"; then
echo "Port $port is already part of the bridge"
else
echo "Adding port $port to the bridge"
new_ports="$new_ports $port"
fi
done
uci set network.@device[0].ports="$new_ports"
uci set dhcp.lan.ignore=1
uci set network.lan.ipaddr="$fastpath_mh_eth_hnat_ap"
uci set wireless.wifinet1.network='lan'
uci set wireless.wifinet2.network='lan'
echo "Committing changes"
uci commit
else
echo "Invalid IPv4 address: $fastpath_mh_eth_hnat_ap"
fi
}
reload_service() {
start
}
stop_service() {
stop
}
service_triggers() {
procd_add_reload_trigger "turboacc"
}

View File

@@ -1,16 +1,5 @@
#!/bin/sh
[ "$(uci -q get "turboacc.global.set")" -eq "1" ] && exit 0
cat <<-EOF > "/etc/config/turboacc"
config turboacc 'global'
option set '0'
config turboacc 'config'
option tcpcca 'cubic'
EOF
kernel_ver="$(uname -r)"
@@ -42,8 +31,7 @@ uci -q commit "turboacc"
uci -q batch <<-EOF >"/dev/null"
delete ucitrack.@turboacc[-1]
add ucitrack turboacc
set ucitrack.@turboacc[-1].init=turboacc
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@@ -319,7 +319,7 @@ delete_redirect_and_filter_rules(unsigned short eport, int proto)
refresh_nft_cache_redirect();
// Delete Redirect Rule
// Delete Redirect Rule eport => iaddr:iport
LIST_FOREACH(p, &head_redirect, entry) {
if (p->dport == eport && p->proto == proto &&
(p->type == RULE_NAT && p->nat_type == NFT_NAT_DNAT)) {
@@ -337,8 +337,8 @@ delete_redirect_and_filter_rules(unsigned short eport, int proto)
refresh_nft_cache_filter();
// Delete Forward Rule
LIST_FOREACH(p, &head_filter, entry) {
if (p->nat_port == iport &&
p->nat_addr == iaddr && p->type == RULE_FILTER) {
if (p->dport == iport && p->daddr == iaddr && p->proto == proto
&& p->type == RULE_FILTER) {
r = rule_del_handle(p);
/* Todo: send bulk request */
nft_send_rule(r, NFT_MSG_DELRULE, RULE_CHAIN_FILTER);

View File

@@ -283,6 +283,9 @@ parse_rule_nat(struct nftnl_expr *e, rule_t *r)
r->family = nftnl_expr_get_u32(e, NFTNL_EXPR_NAT_FAMILY);
addr_min_reg = nftnl_expr_get_u32(e, NFTNL_EXPR_NAT_REG_ADDR_MIN);
addr_max_reg = nftnl_expr_get_u32(e, NFTNL_EXPR_NAT_REG_ADDR_MAX);
/* see expr_add_nat() :
* NFTNL_EXPR_NAT_REG_PROTO_MIN/NFTNL_EXPR_NAT_REG_PROTO_MAX is used
* for destination port */
proto_min_reg = nftnl_expr_get_u32(e, NFTNL_EXPR_NAT_REG_PROTO_MIN);
proto_max_reg = nftnl_expr_get_u32(e, NFTNL_EXPR_NAT_REG_PROTO_MAX);
@@ -300,9 +303,11 @@ parse_rule_nat(struct nftnl_expr *e, rule_t *r)
}
reg_val_ptr = get_reg_val_ptr(r, addr_min_reg);
if (reg_val_ptr != NULL) {
/* destination address */
r->nat_addr = (in_addr_t)*reg_val_ptr;
if (proto_min_reg == NFT_REG_1) {
r->nat_port = proto_min_val;
/* destination port */
if (proto_min_reg == NFT_REG_1 || proto_min_reg == NFT_REG_2) {
r->nat_port = proto_min_val;
}
} else {
syslog(LOG_ERR, "%s: invalid addr_min_reg %u", "parse_rule_nat", addr_min_reg);

View File

@@ -4,5 +4,7 @@ START=99
USE_PROCD=1
start_service() {
ifconfig eth0 down
ifconfig eth0 up
/sbin/smp.sh
}

View File

@@ -677,7 +677,7 @@ scan_usbnet()
[ -d "$dev" ] || continue
dev_name=$(basename $dev)
dev_prefix="${dev_name%%[0-9]*}"
if [ "$dev_prefix" = "usb" ] || [ "$dev_prefix" = "wwan" ] || [ "$dev_prefix" = "rmnet" ] || [ "$dev_prefix" = "eth2" ] || [ "$dev_prefix" = "eth3" ] || [ "$dev_prefix" = "eth4" ] || [ "$dev_prefix" = "eth5" ]; then
if [ "$dev_prefix" = "usb" ] || [ "$dev_prefix" = "wwan" ] || [ "$dev_prefix" = "rmnet" ] || [ "$dev_name" = "eth2" ]; then
IS_USBNET=1
return
fi

View File

@@ -83,7 +83,7 @@ if [ "$hqos" -eq 0 ]; then
done
echo 1 > $hqos_path/hook_toggle
echo 1 > $hqos_path/qos_toggle
echo 0 > $hqos_path/qos_toggle
exit 0
fi
@@ -153,4 +153,4 @@ config_foreach setup_queue queue
# enable hooks
echo 1 > $hqos_path/hook_toggle
echo 1 > $hqos_path/qos_toggle
echo 0 > $hqos_path/qos_toggle

View File

@@ -460,7 +460,7 @@ function mtwifi_cfg_setup(argv)
if dats.ApCliEnable == 1 then
dats.MUTxRxEnable = 3
else
dats.MUTxRxEnable = 1
dats.MUTxRxEnable = 3
end
dats.ITxBfEn = 1
else

View File

@@ -0,0 +1,98 @@
#
# Copyright (C) 2006-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ndisc6
PKG_VERSION:=1.0.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.remlab.net/files/ndisc6
PKG_MD5SUM:=50cb4c19606cf6ff2b7388e71832f579
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/ndisc
SECTION:=ipv6
CATEGORY:=IPv6
SUBMENU:=IPv6 discovery tools
TITLE:=IPv6 discovery tools
URL:=http://www.remlab.net/ndisc6/
DEPENDS:=+libpthread +librt
endef
define Package/ndisc/description
IPv6 discovery tools
endef
define Package/ndisc6
$(call Package/ndisc)
TITLE:=An ICMPv6 neighbour discovery tool
endef
define Package/ndisc6/description
An ICMPv6 neighbour discovery tools
endef
define Package/rdisc6
$(call Package/ndisc)
TITLE:=An ICMPv6 router discovery tool
endef
define Package/rdisc6/description
An ICMPv6 router discovery tool
endef
define Package/traceroute6
$(call Package/ndisc)
TITLE:=An IPv6-based traceroute implementation
endef
define Package/traceroute6/description
An IPv6-based traceroute implementation
endef
define Package/rdnssd
$(call Package/ndisc)
TITLE:=DNS server discovery daemon
endef
define Package/rdnssd/description
A recursive DNS server discovery daemon gathering
information through stateless IPv6 autoconfiguration (RFC5006)
endef
TARGET_CFLAGS += -std=c99
define Package/ndisc6/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ndisc6 $(1)/usr/bin/
endef
define Package/rdisc6/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdisc6 $(1)/usr/bin/
endef
define Package/traceroute6/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{rl,tcp}traceroute6 $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tracert6 $(1)/usr/bin/
endef
define Package/rdnssd/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rdnssd $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,ndisc6))
$(eval $(call BuildPackage,rdisc6))
$(eval $(call BuildPackage,traceroute6))
$(eval $(call BuildPackage,rdnssd))

View File

@@ -0,0 +1,20 @@
--- a/src/trace-tcp.c
+++ b/src/trace-tcp.c
@@ -24,6 +24,7 @@
#undef _GNU_SOURCE
#define _BSD_SOURCE 1
+#define __FAVOR_BSD 1
#include <string.h>
#include <inttypes.h>
--- a/src/trace-udp.c
+++ b/src/trace-udp.c
@@ -24,6 +24,7 @@
#undef _GNU_SOURCE
#define _BSD_SOURCE 1
+#define __FAVOR_BSD 1
#include <string.h>
#include <stdbool.h>

View File

@@ -0,0 +1,175 @@
--- a/rdnssd/Makefile.am
+++ b/rdnssd/Makefile.am
@@ -30,7 +30,8 @@ conf_SCRIPTS = merge-hook
# rdnssd
rdnssd_SOURCES = rdnssd.c rdnssd.h \
icmp.c \
- netlink.c
+ netlink.c \
+ strverscmp.c
rdnssd_LDADD = $(LIBRT) \
@top_builddir@/compat/libcompat.a
--- a/rdnssd/Makefile.in
+++ b/rdnssd/Makefile.in
@@ -60,7 +60,7 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(confdir)"
PROGRAMS = $(sbin_PROGRAMS)
-am_rdnssd_OBJECTS = rdnssd.$(OBJEXT) icmp.$(OBJEXT) netlink.$(OBJEXT)
+am_rdnssd_OBJECTS = rdnssd.$(OBJEXT) icmp.$(OBJEXT) netlink.$(OBJEXT) strverscmp.$(OBJEXT)
rdnssd_OBJECTS = $(am_rdnssd_OBJECTS)
am__DEPENDENCIES_1 =
rdnssd_DEPENDENCIES = $(am__DEPENDENCIES_1) \
@@ -251,7 +251,8 @@ conf_SCRIPTS = merge-hook
# rdnssd
rdnssd_SOURCES = rdnssd.c rdnssd.h \
icmp.c \
- netlink.c
+ netlink.c \
+ strverscmp.c
rdnssd_LDADD = $(LIBRT) \
@top_builddir@/compat/libcompat.a
@@ -373,6 +374,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strverscmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdnssd.Po@am__quote@
.c.o:
--- /dev/null
+++ b/rdnssd/strverscmp.c
@@ -0,0 +1,131 @@
+/* Compare strings while treating digits characters numerically.
+ Copyright (C) 1997, 2000, 2002, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+#include <ctype.h>
+
+/* states: S_N: normal, S_I: comparing integral part, S_F: comparing
+ fractional parts, S_Z: idem but with leading Zeroes only */
+#define S_N 0x0
+#define S_I 0x4
+#define S_F 0x8
+#define S_Z 0xC
+
+/* result_type: CMP: return diff; LEN: compare using len_diff/diff */
+#define CMP 2
+#define LEN 3
+
+
+/* ISDIGIT differs from isdigit, as follows:
+ - Its arg may be any int or unsigned int; it need not be an unsigned char.
+ - It's guaranteed to evaluate its argument exactly once.
+ - It's typically faster.
+ POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
+ ISDIGIT_LOCALE unless it's important to use the locale's definition
+ of `digit' even when the host does not conform to POSIX. */
+#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
+
+#undef __strverscmp
+#undef strverscmp
+
+#ifndef weak_alias
+# define __strverscmp strverscmp
+#endif
+
+/* Compare S1 and S2 as strings holding indices/version numbers,
+ returning less than, equal to or greater than zero if S1 is less than,
+ equal to or greater than S2 (for more info, see the texinfo doc).
+*/
+
+int
+__strverscmp (const char *s1, const char *s2)
+{
+ const unsigned char *p1 = (const unsigned char *) s1;
+ const unsigned char *p2 = (const unsigned char *) s2;
+ unsigned char c1, c2;
+ int state;
+ int diff;
+
+ /* Symbol(s) 0 [1-9] others (padding)
+ Transition (10) 0 (01) d (00) x (11) - */
+ static const unsigned int next_state[] =
+ {
+ /* state x d 0 - */
+ /* S_N */ S_N, S_I, S_Z, S_N,
+ /* S_I */ S_N, S_I, S_I, S_I,
+ /* S_F */ S_N, S_F, S_F, S_F,
+ /* S_Z */ S_N, S_F, S_Z, S_Z
+ };
+
+ static const int result_type[] =
+ {
+ /* state x/x x/d x/0 x/- d/x d/d d/0 d/-
+ 0/x 0/d 0/0 0/- -/x -/d -/0 -/- */
+
+ /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
+ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
+ /* S_I */ CMP, -1, -1, CMP, 1, LEN, LEN, CMP,
+ 1, LEN, LEN, CMP, CMP, CMP, CMP, CMP,
+ /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
+ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
+ /* S_Z */ CMP, 1, 1, CMP, -1, CMP, CMP, CMP,
+ -1, CMP, CMP, CMP
+ };
+
+ if (p1 == p2)
+ return 0;
+
+ c1 = *p1++;
+ c2 = *p2++;
+ /* Hint: '0' is a digit too. */
+ state = S_N | ((c1 == '0') + (ISDIGIT (c1) != 0));
+
+ while ((diff = c1 - c2) == 0 && c1 != '\0')
+ {
+ state = next_state[state];
+ c1 = *p1++;
+ c2 = *p2++;
+ state |= (c1 == '0') + (ISDIGIT (c1) != 0);
+ }
+
+ state = result_type[state << 2 | ((c2 == '0') + (ISDIGIT (c2) != 0))];
+
+ switch (state)
+ {
+ case CMP:
+ return diff;
+
+ case LEN:
+ while (ISDIGIT (*p1++))
+ if (!ISDIGIT (*p2++))
+ return 1;
+
+ return ISDIGIT (*p2) ? -1 : diff;
+
+ default:
+ return state;
+ }
+}
+#ifdef weak_alias
+weak_alias (__strverscmp, strverscmp)
+#endif

View File

@@ -26,7 +26,7 @@ function total(i) {
BEGIN {
if (ipv6) {
iptNF = 8
iptNF = 9
iptKey = "ip6tables"
} else {
iptNF = 9
@@ -82,7 +82,7 @@ FNR==1 {
ARGIND==2 {
#!@todo regex match IPs and MACs for sanity
if (ipv6) {
statFlag= ($4 != "FAILED" && $4 != "INCOMPLETE")
statFlag = ($6 != "FAILED" && $6 != "INCOMPLETE" && substr($1,1,1) != "f" && substr($1,1,1) != "d")
macAddr = $5
hwIF = $3
} else {
@@ -113,7 +113,7 @@ ARGIND==2 {
# at the top.
ARGIND==3 && NF==iptNF && $1!="pkts" { # iptables input
if (ipv6) {
lfn = 5
lfn = 6
tag = "::/0"
} else {
lfn = 6

View File

@@ -20,7 +20,6 @@ endif
endif
PKG_BUILD_DEPENDS:=warp
PKG_SOURCE:=mt798x-7.6.6.1-src.tar.xz
PKG_VERSION:=7.6.6.1-$(PKG_SUFFIX)
PKG_BUILD_PARALLEL:=1
@@ -329,13 +328,16 @@ if [ "$$(CONFIG_MTK_WIFI_FW_BIN_LOAD)" = "y" ]; then \
./files/$$(MT7986_FW_DIR)/mt7986_patch_e1_hdr.bin \
./files/$$(MT7986_FW_DIR)/mt7986_patch_e1_hdr_mt7975.bin \
./files/$$(MT7986_FW_DIR)/7986_WACPU_RAM_CODE_release.bin $(1)/lib/firmware/; \
if [ "$$(CONFIG_MTK_MT7986_NEW_FW)" = "y" ]; then \
if [ "$$(CONFIG_MTK_WIFI_SKU_TYPE)" = "AX4200" ] ; then \
$(INSTALL_BIN) ./files/$$(MT7986_FW_DIR)/MT7986_ePAeLNA_EEPROM_ONEADIE_DBDC.bin \
$(1)/lib/firmware/; \
fi; \
else \
if [ "$$(CONFIG_MTK_WIFI_SKU_TYPE)" = "AX6000" -o "$$(CONFIG_MTK_WIFI_SKU_TYPE)" = "AX8400" ] ; then \
$(INSTALL_BIN) ./files/mt7986-default-eeprom/MT7986_iPAiLNA_EEPROM_AX6000.bin ./files/mt7986-default-eeprom/MT7986_ePAeLNA_EEPROM_AX6000.bin \
$(1)/lib/firmware/; \
fi; \
if [ "$$(CONFIG_MTK_WIFI_SKU_TYPE)" = "AX4200" ] ; then \
$(INSTALL_BIN) ./files/$$(MT7986_FW_DIR)/MT7986_ePAeLNA_EEPROM_ONEADIE_DBDC.bin \
$(1)/lib/firmware/; \
fi; \
fi; \
if [ "$$(CONFIG_MTK_CHIP_MT7916)" = "y" ] ; then \
@@ -343,6 +345,7 @@ if [ "$$(CONFIG_MTK_WIFI_FW_BIN_LOAD)" = "y" ]; then \
fi; \
if [ "$$(CONFIG_MTK_CHIP_MT7981)" = "y" ] ; then \
$(INSTALL_BIN) ./files/mt7981-default-eeprom/MT7981_iPAiLNA_EEPROM.bin \
./files/mt7981-default-eeprom/e2p \
./files/mt7981-default-eeprom/MT7981_ePAeLNA_EEPROM.bin $(1)/lib/firmware/; \
if [ "$$(CONFIG_MTK_MT7981_NEW_FW)" = "y" ]; then \
$(INSTALL_BIN) ./files/$$(MT7981_FW_DIR)/WIFI_RAM_CODE_MT7981.bin \

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:97238e2228897a7388370604cbe7175e0bfa0cc35f562b64330b12c1aaeeb751
size 4096

Some files were not shown because too many files have changed in this diff Show More