2021-01-05 23:38:00 +00:00
#!/bin/bash
2021-06-06 05:53:18 +00:00
# AutoBuild Module by Hyy2001 <https://github.com/Hyy2001X/AutoBuild-Actions>
2021-01-05 23:38:00 +00:00
# AutoBuild DiyScript
2021-11-20 14:04:51 +00:00
Firmware_Diy_Core( ) {
2021-08-04 10:58:50 +00:00
2021-11-20 14:04:51 +00:00
Author = AUTO
2022-09-13 07:26:34 +00:00
Author_URL = https://www.115115.xyz/
2022-03-23 12:59:28 +00:00
Default_Flag = AUTO
2022-09-13 07:26:34 +00:00
Default_IP = "192.168.2.200"
Default_Title = "Powered by X-OpenWrt"
2021-08-09 15:50:07 +00:00
2022-03-23 12:59:28 +00:00
Short_Fw_Date = true
2022-09-13 07:26:34 +00:00
x86_Full_Images = true
2022-03-23 12:59:28 +00:00
Fw_Format = false
2022-09-07 13:08:41 +00:00
Regex_Skip = "packages|buildinfo|sha256sums|manifest|kernel|rootfs|factory|itb|profile|ext4|json"
2021-01-11 13:44:45 +00:00
2022-03-23 12:59:28 +00:00
AutoBuild_Features = true
2021-01-05 23:38:00 +00:00
}
2021-11-20 14:04:51 +00:00
Firmware_Diy( ) {
2021-08-04 10:58:50 +00:00
AutoBuild-Actions: 20211212 功能更新
2021/12/12 更新内容
1. 新增固件标签 Default_FLAG, 一键更新固件时会自动检测带该标签的固件版本, e.g. 若固件标签为 Full, 则更新固件时仅可以更新到固件名称中带 Full 标签的版本
补充: 用户自定义变量 Default_FLAG, 支持数字与字母的组合 [0-9a-zA-Z] 例如 [Full Lite Daily1 Test2], 不支持标点符号, 不能为空
当该值为 AUTO 时, 将自动从配置文件名称获取, 格式为 <TARGET_PROFILE>-<FLAG>, e.g. 配置文件名称为 [x86_64-Test 或 d-team_newifi-d2-Lite], 则标签分别为 [Test Lite]; 配置文件若为不规则命名或无标签例如 [x86_64 X86 NEWIFI-D2], 则标签自动设定为 Full
同时支持在手动编译时临时修改, 点击 Run workflow 后修改 固件名称后缀 [可选] 值即可, 优先级高于用户自定义变量 Default_FLAG
固件内支持标签的快速切换, 切换方法 autoupdate --flag <标签名>, 恢复默认 autoupdate --flag reset
2. AutoBuild_Function.sh Firmware_Diy 函数中新增 CONFIG_FILE TARGET_FLAG 等可调用变量
3. 新增一些设备支持 (也许, 我也不知道)
改动内容较大, 建议重新 Fork 本仓库
2021-12-11 17:05:38 +00:00
# 请在该函数内定制固件
2021-08-04 10:58:50 +00:00
2021-11-20 14:04:51 +00:00
# 可用预设变量, 其他可用变量请参考运行日志
# ${OP_AUTHOR} OpenWrt 源码作者
# ${OP_REPO} OpenWrt 仓库名称
# ${OP_BRANCH} OpenWrt 源码分支
AutoBuild-Actions: 20211212 功能更新
2021/12/12 更新内容
1. 新增固件标签 Default_FLAG, 一键更新固件时会自动检测带该标签的固件版本, e.g. 若固件标签为 Full, 则更新固件时仅可以更新到固件名称中带 Full 标签的版本
补充: 用户自定义变量 Default_FLAG, 支持数字与字母的组合 [0-9a-zA-Z] 例如 [Full Lite Daily1 Test2], 不支持标点符号, 不能为空
当该值为 AUTO 时, 将自动从配置文件名称获取, 格式为 <TARGET_PROFILE>-<FLAG>, e.g. 配置文件名称为 [x86_64-Test 或 d-team_newifi-d2-Lite], 则标签分别为 [Test Lite]; 配置文件若为不规则命名或无标签例如 [x86_64 X86 NEWIFI-D2], 则标签自动设定为 Full
同时支持在手动编译时临时修改, 点击 Run workflow 后修改 固件名称后缀 [可选] 值即可, 优先级高于用户自定义变量 Default_FLAG
固件内支持标签的快速切换, 切换方法 autoupdate --flag <标签名>, 恢复默认 autoupdate --flag reset
2. AutoBuild_Function.sh Firmware_Diy 函数中新增 CONFIG_FILE TARGET_FLAG 等可调用变量
3. 新增一些设备支持 (也许, 我也不知道)
改动内容较大, 建议重新 Fork 本仓库
2021-12-11 17:05:38 +00:00
# ${TARGET_PROFILE} 设备名称
# ${TARGET_BOARD} 设备架构
# ${TARGET_FLAG} 固件名称后缀
2021-08-04 10:58:50 +00:00
2022-08-21 02:13:10 +00:00
# ${WORK} OpenWrt 源码位置
AutoBuild-Actions: 20211212 功能更新
2021/12/12 更新内容
1. 新增固件标签 Default_FLAG, 一键更新固件时会自动检测带该标签的固件版本, e.g. 若固件标签为 Full, 则更新固件时仅可以更新到固件名称中带 Full 标签的版本
补充: 用户自定义变量 Default_FLAG, 支持数字与字母的组合 [0-9a-zA-Z] 例如 [Full Lite Daily1 Test2], 不支持标点符号, 不能为空
当该值为 AUTO 时, 将自动从配置文件名称获取, 格式为 <TARGET_PROFILE>-<FLAG>, e.g. 配置文件名称为 [x86_64-Test 或 d-team_newifi-d2-Lite], 则标签分别为 [Test Lite]; 配置文件若为不规则命名或无标签例如 [x86_64 X86 NEWIFI-D2], 则标签自动设定为 Full
同时支持在手动编译时临时修改, 点击 Run workflow 后修改 固件名称后缀 [可选] 值即可, 优先级高于用户自定义变量 Default_FLAG
固件内支持标签的快速切换, 切换方法 autoupdate --flag <标签名>, 恢复默认 autoupdate --flag reset
2. AutoBuild_Function.sh Firmware_Diy 函数中新增 CONFIG_FILE TARGET_FLAG 等可调用变量
3. 新增一些设备支持 (也许, 我也不知道)
改动内容较大, 建议重新 Fork 本仓库
2021-12-11 17:05:38 +00:00
# ${CONFIG_FILE} 使用的配置文件名称
# ${FEEDS_CONF} OpenWrt 源码目录下的 feeds.conf.default 文件
2021-11-20 14:04:51 +00:00
# ${CustomFiles} 仓库中的 /CustomFiles 绝对路径
# ${Scripts} 仓库中的 /Scripts 绝对路径
AutoBuild-Actions: 20211212 功能更新
2021/12/12 更新内容
1. 新增固件标签 Default_FLAG, 一键更新固件时会自动检测带该标签的固件版本, e.g. 若固件标签为 Full, 则更新固件时仅可以更新到固件名称中带 Full 标签的版本
补充: 用户自定义变量 Default_FLAG, 支持数字与字母的组合 [0-9a-zA-Z] 例如 [Full Lite Daily1 Test2], 不支持标点符号, 不能为空
当该值为 AUTO 时, 将自动从配置文件名称获取, 格式为 <TARGET_PROFILE>-<FLAG>, e.g. 配置文件名称为 [x86_64-Test 或 d-team_newifi-d2-Lite], 则标签分别为 [Test Lite]; 配置文件若为不规则命名或无标签例如 [x86_64 X86 NEWIFI-D2], 则标签自动设定为 Full
同时支持在手动编译时临时修改, 点击 Run workflow 后修改 固件名称后缀 [可选] 值即可, 优先级高于用户自定义变量 Default_FLAG
固件内支持标签的快速切换, 切换方法 autoupdate --flag <标签名>, 恢复默认 autoupdate --flag reset
2. AutoBuild_Function.sh Firmware_Diy 函数中新增 CONFIG_FILE TARGET_FLAG 等可调用变量
3. 新增一些设备支持 (也许, 我也不知道)
改动内容较大, 建议重新 Fork 本仓库
2021-12-11 17:05:38 +00:00
# ${FEEDS_LUCI} OpenWrt 源码目录下的 package/feeds/luci 目录
# ${FEEDS_PKG} OpenWrt 源码目录下的 package/feeds/packages 目录
# ${BASE_FILES} OpenWrt 源码目录下的 package/base-files/files 目录
2021-11-20 14:04:51 +00:00
case " ${ OP_AUTHOR } / ${ OP_REPO } : ${ OP_BRANCH } " in
2021-08-04 10:58:50 +00:00
coolsnowwolf/lede:master)
2022-08-21 02:13:10 +00:00
cat >> ${ Version_File } <<EOF
sed -i '/check_signature/d' /etc/opkg.conf
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/aliyundrive-webdav.lua
sed -i 's/services/nas/g' /usr/lib/lua/luci/view/aliyundrive-webdav/aliyundrive-webdav_log.htm
sed -i 's/services/nas/g' /usr/lib/lua/luci/view/aliyundrive-webdav/aliyundrive-webdav_status.htm
sed -i 's/\"services\"/\"vpn\"/g' /usr/lib/lua/luci/controller/v2ray_server.lua
sed -i 's/\"services\"/\"vpn\"/g' /usr/lib/lua/luci/model/cbi/v2ray_server/index.lua
sed -i 's/\"services\"/\"vpn\"/g' /usr/lib/lua/luci/model/cbi/v2ray_server/user.lua
sed -i 's/services/vpn/g' /usr/lib/lua/luci/view/v2ray_server/log.htm
sed -i 's/services/vpn/g' /usr/lib/lua/luci/view/v2ray_server/users_list_status.htm
sed -i 's/services/vpn/g' /usr/lib/lua/luci/view/v2ray_server/users_list_status.htm
sed -i 's/services/vpn/g' /usr/lib/lua/luci/view/v2ray_server/v2ray.htm
if [ -z "\$(grep " REDIRECT --to-ports 53" /etc/firewall.user 2> /dev/null)" ]
then
echo '#iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53' >> /etc/firewall.user
echo '#iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53' >> /etc/firewall.user
echo '#[ -n "\$(command -v ip6tables)" ] && ip6tables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53' >> /etc/firewall.user
echo '#[ -n "\$(command -v ip6tables)" ] && ip6tables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53' >> /etc/firewall.user
fi
exit 0
EOF
2023-12-11 07:30:26 +00:00
# sed -i "s?/bin/login?/usr/libexec/login.sh?g" ${FEEDS_PKG}/ttyd/files/ttyd.config
2022-08-31 14:23:32 +00:00
# sed -i 's/luci-theme-bootstrap/luci-theme-argon-mod/g' feeds/luci/collections/luci/Makefile
# sed -i '/uci commit luci/i\uci set luci.main.mediaurlbase="/luci-static/argon-mod"' $(PKG_Finder d package default-settings)/files/zzz-default-settings
2024-01-19 16:18:37 +00:00
# AddPackage svn dir pkg_name user branch repo gitdir
2023-10-28 02:06:22 +00:00
for i in eqos mentohust minieap unblockneteasemusic-go
2022-08-31 14:18:29 +00:00
do
2024-01-19 16:18:37 +00:00
#AddPackage svn apps luci-app-${i} immortalwrt/luci/branches/openwrt-18.06/applications
AddPackage svn apps luci-app-${ i } immortalwrt openwrt-18.06 luci applications
2022-08-31 14:18:29 +00:00
sed -i 's/..\/..\//\$\(TOPDIR\)\/feeds\/luci\//g' ${ WORK } /package/apps/luci-app-${ i } /Makefile
done ; unset i
2024-01-19 16:18:37 +00:00
AddPackage svn apps minieap immortalwrt openwrt-18.06 packages net
2022-09-13 07:26:34 +00:00
AddPackage git other luci-theme-atmaterial-ColorIcon esirplayground master
2021-11-16 12:24:58 +00:00
AddPackage git lean luci-app-argon-config jerrykuku master
2021-11-20 14:04:51 +00:00
AddPackage git other OpenClash vernesong master
2023-12-11 09:15:52 +00:00
# AddPackage git other luci-app-vssr jerrykuku master
2022-09-13 07:26:34 +00:00
AddPackage git other lua-maxminddb jerrykuku master
AddPackage git other luci-theme-neobird thinktip main
2022-01-17 14:07:42 +00:00
AddPackage git other luci-app-ikoolproxy iwrt main
2022-03-15 03:46:54 +00:00
AddPackage git other helloworld fw876 master
2022-11-08 15:00:13 +00:00
AddPackage git other luci-app-smartdns pymumu lede
2022-08-24 02:27:17 +00:00
# sed -i 's/143/143,8080,8443,6969,1337/' $(PKG_Finder d package luci-app-ssr-plus)/root/etc/init.d/shadowsocksr
2024-03-02 08:07:44 +00:00
# Close patch 2024.03.02 by xinb
# for x in $(ls -1 ${CustomFiles}/Patches/luci-app-shadowsocksr)
# do
# patch < ${CustomFiles}/Patches/luci-app-shadowsocksr/${x} -p1 -d ${WORK}
# done ; unset x
2022-08-22 09:19:36 +00:00
2022-09-07 09:49:45 +00:00
patch < ${ CustomFiles } /Patches/fix_coremark.patch -p1 -d ${ WORK }
2022-12-20 06:57:13 +00:00
#patch < ${CustomFiles}/Patches/fix_aria2_auto_create_download_path.patch -p1 -d ${WORK}
2022-11-08 15:00:13 +00:00
patch < ${ CustomFiles } /Patches/fix_luci-app-autoreboot-generic.patch -p1 -d ${ WORK }
2023-08-16 11:38:11 +00:00
# delete adguardhome in lede package
2023-08-16 17:21:01 +00:00
# rm package/feeds/packages/net/adguardhome -rf
2021-08-03 10:41:36 +00:00
2022-07-10 14:08:13 +00:00
case " ${ TARGET_BOARD } " in
ramips)
sed -i "/DEVICE_COMPAT_VERSION := 1.1/d" target/linux/ramips/image/mt7621.mk
Copy ${ CustomFiles } /Depends/automount $( PKG_Finder d "package" automount) /files 15-automount
; ;
esac
2021-11-20 14:04:51 +00:00
case " ${ TARGET_PROFILE } " in
d-team_newifi-d2)
Copy ${ CustomFiles } /${ TARGET_PROFILE } _system ${ BASE_FILES } /etc/config system
2022-06-23 03:04:40 +00:00
patch < ${ CustomFiles } /d-team_newifi-d2_mt76_dualband.patch -p1 -d ${ WORK }
2022-03-22 16:46:35 +00:00
; ;
2021-11-20 14:04:51 +00:00
x86_64)
2022-08-31 14:18:29 +00:00
Copy ${ CustomFiles } /Depends/cpuset ${ BASE_FILES } /bin
2023-09-19 15:47:05 +00:00
AddPackage git passwall-depends openwrt-passwall-packages xiaorouji main
AddPackage git passwall-luci openwrt-passwall xiaorouji main
2023-12-11 07:30:26 +00:00
AddPackage git passwall2-luci openwrt-passwall2 xiaorouji main
2022-09-13 07:26:34 +00:00
AddPackage git other luci-app-dockerman lisaac master
2023-07-12 19:36:27 +00:00
rm -rf packages/lean/autocore # May Can Delete
2023-03-12 15:55:38 +00:00
AddPackage git lean autocore-modify xopenwrt master
2022-07-24 04:58:43 +00:00
sed -i -- 's:/bin/ash:' /bin/bash':g' ${ BASE_FILES } /etc/passwd
2022-11-08 15:00:13 +00:00
#sed -i "s?6.0?5.19?g" ${WORK}/target/linux/x86/Makefile
2022-08-31 14:18:29 +00:00
# patch < ${CustomFiles}/Patches/upgrade_intel_igpu_drv.patch -p1 -d ${WORK}
2023-07-10 17:29:48 +00:00
patch < ${ CustomFiles } /Patches/fix_mac80211.patch -p1 -d ${ WORK }
2023-07-11 19:30:59 +00:00
#fix hostapd
2023-07-12 19:36:27 +00:00
sed -i "s/\#CONFIG_AP/CONFIG_AP/g" ${ WORK } /package/network/services/hostapd/files/wpa*
2021-11-20 14:04:51 +00:00
; ;
esac
2021-06-24 08:20:23 +00:00
; ;
2022-03-22 15:16:55 +00:00
immortalwrt/immortalwrt*)
2023-12-11 07:30:26 +00:00
# sed -i "s?/bin/login?/usr/libexec/login.sh?g" ${FEEDS_PKG}/ttyd/files/ttyd.config
2022-03-22 15:16:55 +00:00
; ;
2021-03-24 12:50:54 +00:00
esac
2021-08-29 15:03:38 +00:00
}