Merge Mainline

This commit is contained in:
CN_SZTL
2020-10-01 21:55:59 +08:00
52 changed files with 281 additions and 192 deletions

View File

@@ -6,12 +6,12 @@ ifdef CONFIG_TESTING_KERNEL
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
endif
LINUX_VERSION-4.14 = .199
LINUX_VERSION-4.19 = .148
LINUX_VERSION-4.14 = .200
LINUX_VERSION-4.19 = .149
LINUX_VERSION-5.4 = .68
LINUX_KERNEL_HASH-4.14.199 = 02f3432a262b3804745501f8c3c51d735133af48a39909df8b031d0b9653d4f9
LINUX_KERNEL_HASH-4.19.148 = 3308c74a93ce6d4e495fde35d1351061240a895f76a288248c343713bd63555b
LINUX_KERNEL_HASH-4.14.200 = 5d404a0224a34b5379f1871cc46825487d557c2660459d2b5c3cd4871d699a38
LINUX_KERNEL_HASH-4.19.149 = d9cdcb9a66942a56b91c8d4b273d15a3c5b8e59fad44b79e03362cfffaa62a00
LINUX_KERNEL_HASH-5.4.68 = 0e93876c5ae8dc0c55cbe631971a46ab02b90cf7461fed3085703a5e4e3cd6dd
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))

View File

@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.40.6
PKG_VERSION:=0.40.7
PKG_RELEASE:=beta
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>

View File

@@ -55,6 +55,17 @@ function index()
end
local fs = require "luci.openclash"
local core_path_mode = luci.sys.exec("uci get openclash.config.small_flash_memory 2>/dev/null |tr -d '\n'")
if core_path_mode ~= "1" then
dev_core_path="/etc/openclash/core/clash"
tun_core_path="/etc/openclash/core/clash_tun"
game_core_path="/etc/openclash/core/clash_game"
else
dev_core_path="/tmp/etc/openclash/core/clash"
tun_core_path="/tmp/etc/openclash/core/clash_tun"
game_core_path="/tmp/etc/openclash/core/clash_game"
end
local function is_running()
return luci.sys.call("pidof clash >/dev/null") == 0
end
@@ -143,26 +154,26 @@ local function coremodel()
end
local function corecv()
if not nixio.fs.access("/etc/openclash/core/clash") and not nixio.fs.access("/etc/openclash/clash") then
if not nixio.fs.access(dev_core_path) then
return "0"
else
return luci.sys.exec("/etc/openclash/core/clash -v 2>/dev/null |awk -F ' ' '{print $2}'")
return luci.sys.exec(string.format("%s -v 2>/dev/null |awk -F ' ' '{print $2}'",dev_core_path))
end
end
local function coretuncv()
if not nixio.fs.access("/etc/openclash/core/clash_tun") then
if not nixio.fs.access(tun_core_path) then
return "0"
else
return luci.sys.exec("/etc/openclash/core/clash_tun -v 2>/dev/null |awk -F ' ' '{print $2}'")
return luci.sys.exec(string.format("%s -v 2>/dev/null |awk -F ' ' '{print $2}'",tun_core_path))
end
end
local function coregamecv()
if not nixio.fs.access("/etc/openclash/core/clash_game") then
if not nixio.fs.access(game_core_path) then
return "0"
else
return luci.sys.exec("/etc/openclash/core/clash_game -v 2>/dev/null |awk -F ' ' '{print $2}'")
return luci.sys.exec(string.format("%s -v 2>/dev/null |awk -F ' ' '{print $2}'",game_core_path))
end
end

View File

@@ -89,6 +89,12 @@ o:depends("en_mode", "redir-host-tun")
o:depends("en_mode", "redir-host-vpn")
o:depends("en_mode", "redir-host-mix")
o = s:taboption("op_mode", ListValue, "small_flash_memory", font_red..bold_on..translate("Small Flash Memory")..bold_off..font_off)
o.description = translate("Move Core And GEOIP Data File To /tmp/etc/openclash For Small Flash Memory Device")
o:value("0", translate("Disable"))
o:value("1", translate("Enable"))
o.default = "0"
---- Operation Mode
switch_mode = s:taboption("op_mode", DummyValue, "", nil)
switch_mode.template = "openclash/switch_mode"

View File

@@ -1039,4 +1039,10 @@ msgid "Convert Subscribe Online With Template, Mix Proxies and Keep Settings opt
msgstr "根据模板在线转换配置文件,混合节点和保留配置功能将不可用"
msgid "Convert Subscribe function of Online is Supported By subconverter Written By tindy X"
msgstr "在线订阅转换功能由tindy X通过subconverter提供支持"
msgstr "在线订阅转换功能由tindy X通过subconverter提供支持"
msgid "Small Flash Memory"
msgstr "小闪存模式"
msgid "Move Core And GEOIP Data File To /tmp/etc/openclash For Small Flash Memory Device"
msgstr "针对闪存空间不够的设备移动内核和GEOIP数据库文件到 /tmp/etc/openclash 文件夹"

View File

@@ -28,6 +28,7 @@ config openclash 'config'
option operation_mode 'redir-host'
option enable_rule_proxy '0'
option redirect_dns '0'
option small_flash_memory '0'
config dns_servers
option group 'nameserver'

View File

@@ -126,11 +126,6 @@ start_fail()
yml_merge()
{
#合并文件
if [ -z "$(grep "^Proxy:#d" "$PROXY_FILE")" ]; then
sed -i "s/^Proxy:/proxies:/g" "$PROXY_FILE" 2>/dev/null
else
sed -i "s/^Proxy:#d/proxies:/g" "$PROXY_FILE" 2>/dev/null
fi
cat "$CHANGE_FILE" "$DNS_FILE" "$PROXY_PROVIDER_FILE" "$PROXY_FILE" "$GROUP_FILE" "$RULE_PROVIDER_FILE" "$SCRIPT_FILE" "$RULE_FILE" > "$CONFIG_FILE" 2>/dev/null
}
@@ -655,27 +650,35 @@ sed -i '/OpenClash-Game-Rules-End/d' "$RULE_FILE" 2>/dev/null
sed -i '/OpenClash-Game-Rules/r/tmp/yaml_game_rule_group.yaml' "$RULE_FILE" 2>/dev/null
}
yml_merge
#处理游戏节点与策略组
config_load "openclash"
config_foreach yml_rule_group_get "rule_provider_config"
config_foreach yml_rule_group_get "game_config"
sed -i '/^ \{0,\}proxy-groups:/r/tmp/yaml_groups.yaml' "$CONFIG_FILE" 2>/dev/null
sed -i '/^ \{0,\}proxy-groups:/r/tmp/yaml_groups.yaml' "$GROUP_FILE" 2>/dev/null
sed -i '/^ \{0,\}Proxy:/d' /tmp/yaml_servers.yaml 2>/dev/null
sed -i '/^ \{0,\}proxy-providers:/d' /tmp/yaml_provider.yaml 2>/dev/null
if [ -z "$(grep "^ \{0,\}Proxy:" "$CONFIG_FILE" 2>/dev/null)" ] && [ -f "/tmp/yaml_servers.yaml" ]; then
sed -i '/^ \{0,\}proxy-groups:/i\Proxy:' "$CONFIG_FILE" 2>/dev/null
sed -i '/^ \{0,\}Proxy:/r/tmp/yaml_servers.yaml' "$CONFIG_FILE" 2>/dev/null
elif [ -f "/tmp/yaml_servers.yaml" ]; then
sed -i '/^ \{0,\}Proxy:/r/tmp/yaml_servers.yaml' "$CONFIG_FILE" 2>/dev/null
if [ ! -f "$PROXY_FILE" ] && [ -f "/tmp/yaml_servers.yaml" ]; then
echo "Proxy:" > "$PROXY_FILE" 2>/dev/null
sed -i '/Proxy:/r/tmp/yaml_servers.yaml' "$PROXY_FILE" 2>/dev/null
elif [ -f "/tmp/yaml_servers.yaml" ] && [ -z "$(grep "^Proxy:#d" "$PROXY_FILE")" ]; then
sed -i '/^Proxy:/r/tmp/yaml_servers.yaml' "$PROXY_FILE" 2>/dev/null
elif [ -f "/tmp/yaml_servers.yaml" ] && [ -n "$(grep "^Proxy:#d" "$PROXY_FILE")" ]; then
sed -i '/^Proxy:#d/r/tmp/yaml_servers.yaml' "$PROXY_FILE" 2>/dev/null
fi
if [ -z "$(grep "^ \{0,\}proxy-providers:" "$CONFIG_FILE" 2>/dev/null)" ] && [ -f "/tmp/yaml_provider.yaml" ]; then
sed -i '/OpenClash-General-Settings/a\proxy-providers:' "$CONFIG_FILE" 2>/dev/null
sed -i '/^ \{0,\}proxy-providers:/r/tmp/yaml_provider.yaml' "$CONFIG_FILE" 2>/dev/null
if [ ! -f "$PROXY_PROVIDER_FILE" ] && [ -f "/tmp/yaml_provider.yaml" ]; then
echo "proxy-providers:" > "$PROXY_PROVIDER_FILE" 2>/dev/null
sed -i '/proxy-providers:/r/tmp/yaml_provider.yaml' "$PROXY_PROVIDER_FILE" 2>/dev/null
elif [ -f "/tmp/yaml_servers.yaml" ]; then
sed -i '/^ \{0,\}proxy-providers:r/tmp/yaml_provider.yaml' "$CONFIG_FILE" 2>/dev/null
sed -i '/^proxy-providers:r/tmp/yaml_provider.yaml' "$PROXY_PROVIDER_FILE" 2>/dev/null
fi
#关键字还原
if [ -z "$(grep "^Proxy:#d" "$PROXY_FILE")" ]; then
sed -i "s/^Proxy:/proxies:/g" "$PROXY_FILE" 2>/dev/null
else
sed -i "s/^Proxy:#d/proxies:/g" "$PROXY_FILE" 2>/dev/null
fi
}
yml_rule_set_add()
@@ -962,13 +965,13 @@ if [ ! -f "$CONFIG_FILE" ]; then
echo "配置文件不存在,您已设置订阅信息,准备开始下载..." >$START_LOG
sleep 3
kill_clash
stop
nohup /usr/share/openclash/openclash.sh &
exit 0
elif [ ! -f "$CONFIG_FILE" ]; then
echo "错误: 缺少配置文件,请上传或更新配置文件!" >$START_LOG
echo "${LOGTIME} Config Not Found" >> $LOG_FILE
sleep 5
start_fail
exit 0
fi
fi
}
@@ -1009,84 +1012,105 @@ do_run_mode()
fi
}
do_run_core()
do_run_file()
{
if [ ! -h "/etc/openclash/clash" ] && [ -s "/etc/openclash/clash" ] && [ ! -s "/etc/openclash/core/clash" ]; then
mv "/etc/openclash/clash" "/etc/openclash/core/clash" 2>/dev/null
fi
if [ "$small_flash_memory" != "1" ]; then
dev_core_path="/etc/openclash/core/clash"
tun_core_path="/etc/openclash/core/clash_tun"
game_core_path="/etc/openclash/core/clash_game"
geoip_path="/etc/openclash/Country.mmdb"
else
dev_core_path="/tmp/etc/openclash/core/clash"
tun_core_path="/tmp/etc/openclash/core/clash_tun"
game_core_path="/tmp/etc/openclash/core/clash_game"
geoip_path="/tmp/etc/openclash/Country.mmdb"
fi
rm -rf "/etc/openclash/clash" 2>/dev/null
rm -rf "/etc/openclash/clash" 2>/dev/null
if [ "$en_mode_tun" = "1" ] || [ "$en_mode_tun" = "3" ]; then
ln -s /etc/openclash/core/clash_tun /etc/openclash/clash 2>/dev/null
core_type="Tun"
echo "检测到配置了【Tun】内核专属功能调用【Tun】内核启动..." >$START_LOG
sleep 1
fi
if [ "$en_mode_tun" = "1" ] || [ "$en_mode_tun" = "3" ]; then
ln -s "$tun_core_path" /etc/openclash/clash 2>/dev/null
core_type="Tun"
core_start_log="检测到配置了【Tun】内核专属功能调用【Tun】内核启动..."
fi
if [ "$en_mode_tun" = "2" ]; then
ln -s /etc/openclash/core/clash_game /etc/openclash/clash 2>/dev/null
core_type="Game"
echo "检测到配置了【Game】内核专属功能调用【Game】内核启动..." >$START_LOG
sleep 1
fi
if [ "$proxy_mode" = "script" ] || [ "$rule_source" = "ConnersHua" ] || [ "$rule_source" = "lhie1" ]; then
ln -s /etc/openclash/core/clash_tun /etc/openclash/clash 2>/dev/null
core_type="Tun"
echo "检测到配置了【Tun】内核专属功能调用【Tun】内核启动..." >$START_LOG
sleep 1
fi
if [ "$en_mode_tun" = "2" ]; then
ln -s "$game_core_path" /etc/openclash/clash 2>/dev/null
core_type="Game"
core_start_log="检测到配置了【Game】内核专属功能调用【Game】内核启动..."
fi
if [ -n "$(grep "^ \{0,\}rule-providers:" "$RULE_PROVIDER_FILE" 2>/dev/null)" ] && [ -n "$(grep "^ \{0,\}behavior" "$RULE_PROVIDER_FILE" 2>/dev/null |grep -v "^ \{0,\}#")" ]; then
ln -s /etc/openclash/core/clash_tun /etc/openclash/clash 2>/dev/null
core_type="Tun"
echo "检测到配置了【Tun】内核专属功能调用【Tun】内核启动..." >$START_LOG
sleep 1
fi
if [ "$proxy_mode" = "script" ] || [ "$rule_source" = "ConnersHua" ] || [ "$rule_source" = "lhie1" ]; then
ln -s "$tun_core_path" /etc/openclash/clash 2>/dev/null
core_type="Tun"
core_start_log="检测到配置了【Tun】内核专属功能调用【Tun】内核启动..."
fi
if [ -n "$(grep "^ \{0,\}rule-providers:" "$CONFIG_FILE" 2>/dev/null)" ] && [ -n "$(grep "^ \{0,\}behavior" "$CONFIG_FILE" 2>/dev/null |grep -v "^ \{0,\}#")" ]; then
ln -s "$tun_core_path" /etc/openclash/clash 2>/dev/null
core_type="Tun"
core_start_log="检测到配置了【Tun】内核专属功能调用【Tun】内核启动..."
fi
if [ ! -f "/etc/openclash/clash" ] && [ -f "/etc/openclash/core/clash" ] && [ -z "$core_type" ]; then
ln -s /etc/openclash/core/clash /etc/openclash/clash 2>/dev/null
echo "未检测到特殊配置调用【Dev】内核启动..." >$START_LOG
sleep 1
fi
if [ ! -f "/etc/openclash/clash" ] && [ -f "$dev_core_path" ] && [ -z "$core_type" ]; then
ln -s "$dev_core_path" /etc/openclash/clash 2>/dev/null
core_start_log="未检测到特殊配置调用【Dev】内核启动..."
fi
if [ ! -f "/etc/openclash/clash" ] && [ -f "/etc/openclash/core/clash_tun" ] && [ "$core_type" != "Game" ]; then
ln -s /etc/openclash/core/clash_tun /etc/openclash/clash 2>/dev/null
echo "检测到【Dev】内核未安装调用【Tun】内核启动..." >$START_LOG
sleep 1
fi
if [ ! -f "/etc/openclash/clash" ] && [ -f "$tun_core_path" ] && [ "$core_type" != "Game" ]; then
ln -s "$tun_core_path" /etc/openclash/clash 2>/dev/null
core_start_log="检测到【Dev】内核未安装调用【Tun】内核启动..."
fi
if [ ! -f "/etc/openclash/clash" ] && [ -f "/etc/openclash/core/clash_game" ] && [ "$core_type" != "Tun" ]; then
ln -s /etc/openclash/core/clash_game /etc/openclash/clash 2>/dev/null
echo "检测到【Dev】内核未安装调用【Game】内核启动..." >$START_LOG
sleep 1
fi
if [ ! -f "/etc/openclash/clash" ] && [ -f "$game_core_path" ] && [ "$core_type" != "Tun" ]; then
ln -s "$game_core_path" /etc/openclash/clash 2>/dev/null
core_start_log="检测到【Dev】内核未安装调用【Game】内核启动..."
fi
#权限检查
[ ! -x "/etc/openclash/core/clash_tun" ] && chmod 4755 /etc/openclash/core/clash_tun 2>/dev/null
[ ! -x "/etc/openclash/core/clash_game" ] && chmod 4755 /etc/openclash/core/clash_game 2>/dev/null
[ ! -x "/etc/openclash/core/clash" ] && chmod 4755 /etc/openclash/core/clash 2>/dev/null
[ ! -f "$CLASH" ] && {
echo "检测到内核文件不存在,准备开始下载..." >$START_LOG
sleep 3
rm -rf "/tmp/clash_last_version" 2>/dev/null
[ ! -x "$tun_core_path" ] && chmod 4755 "$tun_core_path" 2>/dev/null
[ ! -x "$game_core_path" ] && chmod 4755 "$game_core_path" 2>/dev/null
[ ! -x "$dev_core_path" ] && chmod 4755 "$dev_core_path" 2>/dev/null
[ -f "$geoip_path" ] && [ "$small_flash_memory" = "1" ] && {
rm -rf "/etc/openclash/Country.mmdb" 2>/dev/null
ln -s "$geoip_path" /etc/openclash/Country.mmdb 2>/dev/null
}
[ ! -f "$geoip_path" ] && {
echo "检测到GEOIP数据库文件不存在准备开始下载..." >$START_LOG
sleep 3
kill_clash
nohup /usr/share/openclash/openclash_ipdb.sh &
exit 0
}
[ ! -f "$CLASH" ] && {
echo "检测到内核文件不存在,准备开始下载..." >$START_LOG
sleep 3
rm -rf "/tmp/clash_last_version" 2>/dev/null
kill_clash
nohup /usr/share/openclash/openclash_core.sh "$core_type" &
exit 0
}
}
start_run_core()
{
echo "$core_start_log" >$START_LOG
sleep 1
ulimit -SHn 65535 2>/dev/null
config_reload=$(uci get openclash.config.config_reload 2>/dev/null)
if [ -n "$(pidof clash)" ] && [ "$core_type" != "Tun" ] && [ "$config_reload" != "0" ]; then
curl -s --connect-timeout 5 -m 5 -H 'Content-Type: application/json' -H "Authorization: Bearer ${da_password}" -XPUT http://"$lan_ip":"$cn_port"/configs -d "{\"path\": \"$CONFIG_FILE\"}" 2>/dev/null
else
kill_clash
stop
nohup /usr/share/openclash/openclash_core.sh "$core_type" &
}
ulimit -SHn 65535 2>/dev/null
config_reload=$(uci get openclash.config.config_reload 2>/dev/null)
if [ -n "$(pidof clash)" ] && [ "$core_type" != "Tun" ] && [ "$config_reload" != "0" ]; then
curl -s --connect-timeout 5 -m 5 -H 'Content-Type: application/json' -H "Authorization: Bearer ${da_password}" -XPUT http://"$lan_ip":"$cn_port"/configs -d "{\"path\": \"$CONFIG_FILE\"}" 2>/dev/null
else
kill_clash
nohup "$CLASH" -d "$CLASH_CONFIG" -f "$CONFIG_FILE" >> $LOG_FILE 2>&1 &
fi
uci set openclash.config.config_reload=1 2>/dev/null
uci commit openclash
nohup "$CLASH" -d "$CLASH_CONFIG" -f "$CONFIG_FILE" >> $LOG_FILE 2>&1 &
fi
uci set openclash.config.config_reload=1 2>/dev/null
uci commit openclash
}
set_firewall()
@@ -1437,6 +1461,7 @@ get_config()
enable_rule_proxy=$(uci get openclash.config.enable_rule_proxy 2>/dev/null)
stack_type=$(uci get openclash.config.stack_type 2>/dev/null)
china_ip_route=$(uci get openclash.config.china_ip_route 2>/dev/null)
small_flash_memory=$(uci get openclash.config.small_flash_memory 2>/dev/null)
}
yml_field_check()
@@ -1479,6 +1504,9 @@ start()
echo "第一步: 获取配置..." >$START_LOG
get_config
#检查文件是否存在
do_run_file
echo "第二步: 配置文件检查..." >$START_LOG
yml_check "$en_mode" "$enable_custom_dns" "$CONFIG_FILE" "$BACKUP_FILE" "$START_BACKUP"
yml_dns_check
@@ -1496,6 +1524,7 @@ start()
yml_provider_path "$RULE_PROVIDER_FILE" "rule_provider"
yml_custom_rule_provider
yml_game_custom
yml_merge
echo "第四步: DNS设置检查..." >$START_LOG
if [ -n "$(sed -n '/^ \{0,\}nameserver:/{n;p}' "$CONFIG_FILE" |grep '^ \{0,\}fallback:')" ] || [ -n "$(sed -n '/^ \{0,\}nameserver:/{n;p}' "$CONFIG_FILE" |grep 'OpenClash-General')" ]; then
@@ -1507,8 +1536,8 @@ start()
fi
echo "第五步: 启动主程序..." >$START_LOG
#检查是否存在核心文件
do_run_core
sleep 1
start_run_core
#检测proxy_provider配置文件状态
echo "第六步: 等待主程序下载外部文件..." >$START_LOG

View File

@@ -0,0 +1,19 @@
{
"files": {
"main.css": "./static/css/main.83e4b341.chunk.css",
"main.js": "./static/js/main.33688145.chunk.js",
"runtime-main.js": "./static/js/runtime-main.fefd5bb9.js",
"static/js/2.4c19c7e9.chunk.js": "./static/js/2.4c19c7e9.chunk.js",
"index.html": "./index.html",
"service-worker.js": "./service-worker.js",
"static/js/2.4c19c7e9.chunk.js.LICENSE.txt": "./static/js/2.4c19c7e9.chunk.js.LICENSE.txt",
"static/media/logo.45983944.png": "./static/media/logo.45983944.png",
"workbox-8a532145.js": "./workbox-8a532145.js"
},
"entrypoints": [
"static/js/runtime-main.fefd5bb9.js",
"static/js/2.4c19c7e9.chunk.js",
"static/css/main.83e4b341.chunk.css",
"static/js/main.33688145.chunk.js"
]
}

View File

@@ -1 +1 @@
<!doctype html><html lang="en" dir="ltr"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link rel="icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/Dreamacro/clash/docs/logo.png"/><title>Clash</title><link href="main.01d1a3c82895ade21dbf.css" rel="stylesheet"></head><body><div id="root"></div><script src="js/1.bundle.01d1a3c82895ade21dbf.min.js"></script><script src="js/bundle.01d1a3c82895ade21dbf.min.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/Dreamacro/clash/docs/logo.png"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"/><meta name="description" content="Clash web port"/><title>Clash</title><link href="./static/css/main.83e4b341.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,a,l=r[0],f=r[1],i=r[2],p=0,s=[];p<l.length;p++)a=l[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(c&&c(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var f=t[l];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={1:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,function(r){return e[r]}.bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="./";var l=this["webpackJsonpclash-dashboard"]=this["webpackJsonpclash-dashboard"]||[],f=l.push.bind(l);l.push=r,l=l.slice();for(var i=0;i<l.length;i++)r(l[i]);var c=f;t()}([])</script><script src="./static/js/2.4c19c7e9.chunk.js"></script><script src="./static/js/main.33688145.chunk.js"></script></body></html>

View File

@@ -0,0 +1 @@
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let s=Promise.resolve();return r[e]||(s=new Promise(async s=>{if("document"in self){const r=document.createElement("script");r.src=e,document.head.appendChild(r),r.onload=s}else importScripts(e),s()})),s.then(()=>{if(!r[e])throw new Error(`Module ${e} didnt register its module`);return r[e]})},s=(s,r)=>{Promise.all(s.map(e)).then(e=>r(1===e.length?e[0]:e))},r={require:Promise.resolve(s)};self.define=(s,i,c)=>{r[s]||(r[s]=Promise.resolve().then(()=>{let r={};const t={uri:location.origin+s.slice(1)};return Promise.all(i.map(s=>{switch(s){case"exports":return r;case"module":return t;default:return e(s)}})).then(e=>{const s=c(...e);return r.default||(r.default=s),r})}))}}define("./service-worker.js",["./workbox-8a532145"],(function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.clientsClaim(),e.precacheAndRoute([{url:"./index.html",revision:"b1a27ccef352baebb9667369555f9309"},{url:"./static/css/main.83e4b341.chunk.css",revision:"5a48466e5ff2a8ceec3348c3c498c260"},{url:"./static/js/2.4c19c7e9.chunk.js",revision:"d46b87667ddd715dd648d1ef8779c0b7"},{url:"./static/js/2.4c19c7e9.chunk.js.LICENSE.txt",revision:"176c1a1a28b19c611d9701905d8d60b7"},{url:"./static/js/main.33688145.chunk.js",revision:"62d6fab15c25a50205f635111e4e9e01"},{url:"./static/js/runtime-main.fefd5bb9.js",revision:"98f4f314ef9abb714a6c74c41e1e5a04"},{url:"./static/media/logo.45983944.png",revision:"198a55c9efe85ab0145d4402c07cfe65"}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("./index.html"),{denylist:[/^\/_/,/\/[^/?]+\.[^/]+$/]}))}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
!function(e){function r(r){for(var n,a,l=r[0],f=r[1],i=r[2],p=0,s=[];p<l.length;p++)a=l[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(c&&c(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var f=t[l];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={1:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,function(r){return e[r]}.bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="./";var l=this["webpackJsonpclash-dashboard"]=this["webpackJsonpclash-dashboard"]||[],f=l.push.bind(l);l.push=r,l=l.slice();for(var i=0;i<l.length;i++)r(l[i]);var c=f;t()}([]);

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

View File

@@ -7,11 +7,23 @@ LOG_FILE="/tmp/openclash.log"
CORE_TYPE="$1"
[ -z "$CORE_TYPE" ] || [ "$1" = "one_key_update" ] && CORE_TYPE="Dev"
en_mode=$(uci get openclash.config.en_mode 2>/dev/null)
small_flash_memory=$(uci get openclash.config.small_flash_memory 2>/dev/null)
CPU_MODEL=$(uci get openclash.config.core_version 2>/dev/null)
HTTP_PORT=$(uci get openclash.config.http_port 2>/dev/null)
PROXY_ADDR=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null)
[ ! -f "/tmp/clash_last_version" ] && /usr/share/openclash/clash_version.sh 2>/dev/null
mkdir -p /etc/openclash/core
if [ "$small_flash_memory" != "1" ]; then
dev_core_path="/etc/openclash/core/clash"
tun_core_path="/etc/openclash/core/clash_tun"
game_core_path="/etc/openclash/core/clash_game"
mkdir -p /etc/openclash/core
else
dev_core_path="/tmp/etc/openclash/core/clash"
tun_core_path="/tmp/etc/openclash/core/clash_tun"
game_core_path="/tmp/etc/openclash/core/clash_game"
mkdir -p /tmp/etc/openclash/core
fi
[ -s "/tmp/openclash.auth" ] && {
PROXY_AUTH=$(cat /tmp/openclash.auth |awk -F '- ' '{print $2}' |sed -n '1p' 2>/dev/null)
@@ -19,8 +31,9 @@ mkdir -p /etc/openclash/core
case $CORE_TYPE in
"Tun")
CORE_CV=$(/etc/openclash/core/clash_tun -v 2>/dev/null |awk -F ' ' '{print $2}')
CORE_CV=$($tun_core_path -v 2>/dev/null |awk -F ' ' '{print $2}')
CORE_LV=$(sed -n 2p /tmp/clash_last_version 2>/dev/null)
echo $CORE_CV >>/tmp/1
if [ -z "$CORE_LV" ]; then
echo "获取【Tun】内核最新版本信息失败请稍后再试..." >$START_LOG
echo "${LOGTIME} 【Tun】Core Version Check Error, Please Try Again After A few seconds" >>$LOG_FILE
@@ -33,14 +46,14 @@ case $CORE_TYPE in
fi
;;
"Game")
CORE_CV=$(/etc/openclash/core/clash_game -v 2>/dev/null |awk -F ' ' '{print $2}')
CORE_CV=$($game_core_path -v 2>/dev/null |awk -F ' ' '{print $2}')
CORE_LV=$(sed -n 3p /tmp/clash_last_version 2>/dev/null)
if [ "$en_mode" = "fake-ip-vpn" ] || [ "$en_mode" = "redir-host-vpn" ]; then
if_restart=1
fi
;;
*)
CORE_CV=$(/etc/openclash/core/clash -v 2>/dev/null |awk -F ' ' '{print $2}')
CORE_CV=$($dev_core_path -v 2>/dev/null |awk -F ' ' '{print $2}')
CORE_LV=$(sed -n 1p /tmp/clash_last_version 2>/dev/null)
if [ "$en_mode" = "fake-ip" ] || [ "$en_mode" = "redir-host" ]; then
if_restart=1
@@ -87,7 +100,7 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
[ -s "/tmp/clash_tun.gz" ] && {
gzip -d /tmp/clash_tun.gz >/dev/null 2>&1
rm -rf /tmp/clash_tun.gz >/dev/null 2>&1
rm -rf /etc/openclash/core/clash_tun >/dev/null 2>&1
rm -rf "$tun_core_path" >/dev/null 2>&1
chmod 4755 /tmp/clash_tun >/dev/null 2>&1
chown root:root /tmp/clash_tun >/dev/null 2>&1
}
@@ -97,18 +110,22 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
tar zxvf /tmp/clash_game.tar.gz -C /tmp >/dev/null 2>&1
mv /tmp/clash /tmp/clash_game >/dev/null 2>&1
rm -rf /tmp/clash_game.tar.gz >/dev/null 2>&1
rm -rf /etc/openclash/core/clash_game >/dev/null 2>&1
rm -rf "$game_core_path" >/dev/null 2>&1
chmod 4755 /tmp/clash_game >/dev/null 2>&1
chown root:root /tmp/clash_game >/dev/null 2>&1
}
;;
*)
[ -s "/tmp/clash.tar.gz" ] && {
rm -rf /etc/openclash/core/clash >/dev/null 2>&1
tar zxvf /tmp/clash.tar.gz -C /etc/openclash/core
rm -rf "$dev_core_path" >/dev/null 2>&1
if [ "$small_flash_memory" != "1" ]; then
tar zxvf /tmp/clash.tar.gz -C /etc/openclash/core
else
tar zxvf /tmp/clash.tar.gz -C /tmp/etc/openclash/core
fi
rm -rf /tmp/clash.tar.gz >/dev/null 2>&1
chmod 4755 /etc/openclash/core/clash >/dev/null 2>&1
chown root:root /etc/openclash/core/clash >/dev/null 2>&1
chmod 4755 "$dev_core_path" >/dev/null 2>&1
chown root:root "$dev_core_path" >/dev/null 2>&1
}
esac
@@ -138,10 +155,10 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
case $CORE_TYPE in
"Tun")
mv /tmp/clash_tun /etc/openclash/core/clash_tun >/dev/null 2>&1
mv /tmp/clash_tun "$tun_core_path" >/dev/null 2>&1
;;
"Game")
mv /tmp/clash_game /etc/openclash/core/clash_game >/dev/null 2>&1
mv /tmp/clash_game "$game_core_path" >/dev/null 2>&1
;;
*)
esac

View File

@@ -62,6 +62,8 @@ cat >> "$DEBUG_LOG" <<-EOF
生成时间: $LOGTIME
插件版本: $op_version
\`\`\`
EOF
cat >> "$DEBUG_LOG" <<-EOF
@@ -278,6 +280,7 @@ else
rm -rf /tmp/yaml_general 2>/dev/null
cat "$CHANGE_FILE" "$DNS_FILE" >> "$DEBUG_LOG"
fi
sed -i '/^ \{0,\}secret:/d' "$DEBUG_LOG" 2>/dev/null
#firewall
cat >> "$DEBUG_LOG" <<-EOF
@@ -371,4 +374,9 @@ cat >> "$DEBUG_LOG" <<-EOF
#===================== 最近运行日志 =====================#
EOF
tail -n 30 "/tmp/openclash.log" >> "$DEBUG_LOG" 2>/dev/null
tail -n 50 "/tmp/openclash.log" >> "$DEBUG_LOG" 2>/dev/null
cat >> "$DEBUG_LOG" <<-EOF
\`\`\`
EOF

View File

@@ -7,11 +7,19 @@
START_LOG="/tmp/openclash_start.log"
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
LOG_FILE="/tmp/openclash.log"
small_flash_memory=$(uci get openclash.config.small_flash_memory 2>/dev/null)
HTTP_PORT=$(uci get openclash.config.http_port 2>/dev/null)
PROXY_ADDR=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null)
if [ -s "/tmp/openclash.auth" ]; then
PROXY_AUTH=$(cat /tmp/openclash.auth |awk -F '- ' '{print $2}' |sed -n '1p' 2>/dev/null)
fi
if [ "$small_flash_memory" != "1" ]; then
geoip_path="/etc/openclash/Country.mmdb"
mkdir -p /etc/openclash
else
geoip_path="/tmp/etc/openclash/Country.mmdb"
mkdir -p /tmp/etc/openclash
fi
echo "开始下载 GEOIP 数据库..." >$START_LOG
if pidof clash >/dev/null; then
curl -sL --connect-timeout 10 --retry 2 -x http://$PROXY_ADDR:$HTTP_PORT -U "$PROXY_AUTH" https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/Country.mmdb -o /tmp/Country.mmdb >/dev/null 2>&1
@@ -20,7 +28,7 @@
fi
if [ "$?" -eq "0" ] && [ -s "/tmp/Country.mmdb" ]; then
echo "GEOIP 数据库下载成功,检查数据库版本是否更新..." >$START_LOG
cmp -s /tmp/Country.mmdb /etc/openclash/Country.mmdb
cmp -s /tmp/Country.mmdb "$geoip_path"
if [ "$?" -ne "0" ]; then
status=$(unify_ps_prevent)
while ( [ "$status" -gt 1 ] )
@@ -29,13 +37,13 @@
status=$(unify_ps_prevent)
done
echo "数据库版本有更新,开始替换数据库版本..." >$START_LOG
mv /tmp/Country.mmdb /etc/openclash/Country.mmdb >/dev/null 2>&1
/etc/init.d/openclash restart
mv /tmp/Country.mmdb "$geoip_path" >/dev/null 2>&1
echo "删除下载缓存..." >$START_LOG
rm -rf /tmp/Country.mmdb >/dev/null 2>&1
echo "GEOIP 数据库更新成功!" >$START_LOG
echo "${LOGTIME} GEOIP Database Update Successful" >>$LOG_FILE
sleep 10
sleep 5
/etc/init.d/openclash restart
echo "" >$START_LOG
else
echo "数据库版本没有更新,停止继续操作..." >$START_LOG

View File

@@ -30,6 +30,14 @@ do
enable=$(uci get openclash.config.enable)
if [ "$enable" -eq 1 ]; then
clash_pids=$(pidof clash |sed 's/$//g' |wc -l)
if [ "$clash_pids" -gt 1 ]; then
echo "${LOGTIME} Watchdog: Multiple Clash Processes, Kill All..." >> $LOG_FILE
for clash_pid in $clash_pids; do
kill -9 "$clash_pid" 2>/dev/null
done >/dev/null 2>&1
sleep 1
fi 2>/dev/null
if ! pidof clash >/dev/null; then
CRASH_NUM=$(expr "$CRASH_NUM" + 1)
if [ "$CRASH_NUM" -le 3 ]; then

File diff suppressed because one or more lines are too long

View File

@@ -173,7 +173,7 @@ yml_groups_set()
fi
#游戏策略组存在时判断节点是否存在
if [ ! -z "$if_game_group" ] && [ ! -z "$(grep "^ \{0,\}- name: $if_game_group" "$CONFIG_GROUP_FILE")" ]; then
if [ -n "$if_game_group" ] && [ -n "$(grep "^$if_game_group$" /tmp/Proxy_Group)" ]; then
config_foreach yml_servers_add "servers" "$name" "$type" "check" #加入服务器节点
config_foreach set_proxy_provider "proxy-provider" "$group_name" "check" #加入代理集
return

View File

@@ -39,6 +39,7 @@ speedtype:depends("apptype", "go")
cloudserver = s:option(Value, "cloudserver", translate("服务器位置"))
cloudserver:value("cdn-shanghai.service.project-openwrt.eu.org:30000:30001", translate("[CTCGFW] 腾讯云上海(高音质)"))
cloudserver:value("uc-gz.service.project-openwrt.eu.org:30000:30001", translate("[CTCGFW] UCloud广州高音质"))
cloudserver.description = translate("自定义服务器格式为 IP[域名]:HTTP端口:HTTPS端口<br />如果服务器为LAN内网IP需要将这个服务器IP放入例外客户端 (不代理HTTP和HTTPS)")
cloudserver.default = "cdn-shanghai.service.project-openwrt.eu.org:30000:30001"
cloudserver.rmempty = true

View File

@@ -316,7 +316,7 @@
list_for_each_entry(p, head, list) {
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -449,7 +449,7 @@ static struct neighbour *ipv4_neigh_look
@@ -450,7 +450,7 @@ static struct neighbour *ipv4_neigh_look
else if (skb)
pkey = &ip_hdr(skb)->daddr;

View File

@@ -49,7 +49,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
return UBI_IO_BAD_HDR_EBADMSG;
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -833,6 +833,7 @@ extern struct mutex ubi_devices_mutex;
@@ -835,6 +835,7 @@ extern struct mutex ubi_devices_mutex;
extern struct blocking_notifier_head ubi_notifiers;
/* attach.c */

View File

@@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#include "translation-table.h"
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -49,6 +49,7 @@
@@ -50,6 +50,7 @@
#include <net/genetlink.h>
#include <net/netlink.h>
#include <net/sock.h>
@@ -105,7 +105,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#include <uapi/linux/batman_adv.h>
#include "hard-interface.h"
@@ -56,7 +57,6 @@
@@ -57,7 +58,6 @@
#include "log.h"
#include "netlink.h"
#include "originator.h"

View File

@@ -15,7 +15,7 @@
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1466,6 +1466,9 @@ int genphy_update_link(struct phy_device
@@ -1467,6 +1467,9 @@ int genphy_update_link(struct phy_device
{
int status;

View File

@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
*/
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2551,6 +2551,10 @@ static inline int pskb_trim(struct sk_bu
@@ -2563,6 +2563,10 @@ static inline int pskb_trim(struct sk_bu
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
}
@@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/**
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
* @skb: buffer to alter
@@ -2682,16 +2686,6 @@ static inline struct sk_buff *dev_alloc_
@@ -2694,16 +2698,6 @@ static inline struct sk_buff *dev_alloc_
}

View File

@@ -393,7 +393,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -426,6 +426,9 @@ static struct pernet_operations ip_rt_pr
@@ -427,6 +427,9 @@ static struct pernet_operations ip_rt_pr
static int __init ip_rt_proc_init(void)
{

View File

@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
*/
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2566,6 +2566,10 @@ static inline int pskb_trim(struct sk_bu
@@ -2578,6 +2578,10 @@ static inline int pskb_trim(struct sk_bu
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
}
@@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/**
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
* @skb: buffer to alter
@@ -2697,16 +2701,6 @@ static inline struct sk_buff *dev_alloc_
@@ -2709,16 +2713,6 @@ static inline struct sk_buff *dev_alloc_
}

View File

@@ -393,7 +393,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -411,6 +411,9 @@ static struct pernet_operations ip_rt_pr
@@ -412,6 +412,9 @@ static struct pernet_operations ip_rt_pr
static int __init ip_rt_proc_init(void)
{

View File

@@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -811,7 +811,7 @@ static int get_chip(struct map_info *map
@@ -810,7 +810,7 @@ static int get_chip(struct map_info *map
return 0;
case FL_ERASING:

View File

@@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
1 file changed, 1 insertion(+)
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1839,6 +1839,7 @@ static int __xipram do_write_buffer(stru
@@ -1838,6 +1838,7 @@ static int __xipram do_write_buffer(stru
/* Write Buffer Load */
map_write(map, CMD(0x25), cmd_adr);

View File

@@ -1569,7 +1569,7 @@
extern struct kmem_cache *skbuff_head_cache;
void kfree_skb_partial(struct sk_buff *skb, bool head_stolen);
@@ -3847,8 +3866,12 @@ static inline void __nf_copy(struct sk_b
@@ -3860,8 +3879,12 @@ static inline void __nf_copy(struct sk_b
dst->_nfct = src->_nfct;
nf_conntrack_get(skb_nfct(src));
#endif

View File

@@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2515,7 +2515,7 @@ static inline int pskb_network_may_pull(
@@ -2527,7 +2527,7 @@ static inline int pskb_network_may_pull(
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
*/
#ifndef NET_SKB_PAD

View File

@@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
/**
* ata_build_rw_tf - Build ATA taskfile for given read/write request
* @tf: Target ATA taskfile
@@ -5122,6 +5135,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
@@ -5125,6 +5138,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
if (tag < 0)
return NULL;
}
@@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
qc = __ata_qc_from_tag(ap, tag);
qc->tag = tag;
@@ -6023,6 +6039,9 @@ struct ata_port *ata_port_alloc(struct a
@@ -6028,6 +6044,9 @@ struct ata_port *ata_port_alloc(struct a
ap->stats.unhandled_irq = 1;
ap->stats.idle_irq = 1;
#endif
@@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
ata_sff_port_init(ap);
return ap;
@@ -6044,6 +6063,12 @@ static void ata_host_release(struct devi
@@ -6049,6 +6068,12 @@ static void ata_host_release(struct devi
kfree(ap->pmp_link);
kfree(ap->slave_link);
@@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
kfree(ap);
host->ports[i] = NULL;
}
@@ -6490,7 +6515,23 @@ int ata_host_register(struct ata_host *h
@@ -6495,7 +6520,23 @@ int ata_host_register(struct ata_host *h
host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
host->ports[i]->local_port_no = i + 1;
}
@@ -134,7 +134,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
/*
* Define if arch has non-standard setup. This is a _PCI_ standard
@@ -894,6 +897,12 @@ struct ata_port {
@@ -895,6 +898,12 @@ struct ata_port {
#ifdef CONFIG_ATA_ACPI
struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */
#endif

View File

@@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -812,7 +812,7 @@ static int get_chip(struct map_info *map
@@ -811,7 +811,7 @@ static int get_chip(struct map_info *map
return 0;
case FL_ERASING:

View File

@@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
1 file changed, 1 insertion(+)
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1838,6 +1838,7 @@ static int __xipram do_write_buffer(stru
@@ -1837,6 +1837,7 @@ static int __xipram do_write_buffer(stru
/* Write Buffer Load */
map_write(map, CMD(0x25), cmd_adr);

View File

@@ -50,7 +50,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
break;
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -789,6 +789,7 @@ struct ubi_attach_info {
@@ -793,6 +793,7 @@ struct ubi_attach_info {
int mean_ec;
uint64_t ec_sum;
int ec_count;

View File

@@ -1264,7 +1264,7 @@
extern struct kmem_cache *skbuff_head_cache;
void kfree_skb_partial(struct sk_buff *skb, bool head_stolen);
@@ -3923,8 +3942,12 @@ static inline void __nf_copy(struct sk_b
@@ -3935,8 +3954,12 @@ static inline void __nf_copy(struct sk_b
dst->_nfct = src->_nfct;
nf_conntrack_get(skb_nfct(src));
#endif

View File

@@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2530,7 +2530,7 @@ static inline int pskb_network_may_pull(
@@ -2542,7 +2542,7 @@ static inline int pskb_network_may_pull(
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
*/
#ifndef NET_SKB_PAD

View File

@@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
/**
* ata_build_rw_tf - Build ATA taskfile for given read/write request
* @tf: Target ATA taskfile
@@ -5132,6 +5145,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
@@ -5135,6 +5148,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
if (tag < 0)
return NULL;
}
@@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
qc = __ata_qc_from_tag(ap, tag);
qc->tag = qc->hw_tag = tag;
@@ -6066,6 +6082,9 @@ struct ata_port *ata_port_alloc(struct a
@@ -6071,6 +6087,9 @@ struct ata_port *ata_port_alloc(struct a
ap->stats.unhandled_irq = 1;
ap->stats.idle_irq = 1;
#endif
@@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
ata_sff_port_init(ap);
return ap;
@@ -6101,6 +6120,12 @@ static void ata_host_release(struct kref
@@ -6106,6 +6125,12 @@ static void ata_host_release(struct kref
kfree(ap->pmp_link);
kfree(ap->slave_link);
@@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
kfree(ap);
host->ports[i] = NULL;
}
@@ -6564,7 +6589,23 @@ int ata_host_register(struct ata_host *h
@@ -6569,7 +6594,23 @@ int ata_host_register(struct ata_host *h
host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
host->ports[i]->local_port_no = i + 1;
}
@@ -134,7 +134,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
/*
* Define if arch has non-standard setup. This is a _PCI_ standard
@@ -897,6 +900,12 @@ struct ata_port {
@@ -898,6 +901,12 @@ struct ata_port {
#ifdef CONFIG_ATA_ACPI
struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */
#endif

View File

@@ -2149,7 +2149,6 @@
+module_platform_driver(ar40xx_drv);
+
+MODULE_DESCRIPTION("IPQ40XX ESS driver");
+MODULE_LICENSE("Dual BSD/GPL");
--- /dev/null
+++ b/drivers/net/phy/ar40xx.h
@@ -0,0 +1,337 @@

View File

@@ -5494,7 +5494,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
(transaction layer end-to-end CRC checking).
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1328,6 +1328,8 @@ void pci_walk_bus(struct pci_bus *top, i
@@ -1327,6 +1327,8 @@ void pci_walk_bus(struct pci_bus *top, i
void *userdata);
int pci_cfg_space_size(struct pci_dev *dev);
unsigned char pci_bus_max_busnr(struct pci_bus *bus);

View File

@@ -19,7 +19,7 @@
},
[PORT_NPCM] = {
.name = "Nuvoton 16550",
@@ -2653,6 +2653,11 @@ serial8250_do_set_termios(struct uart_po
@@ -2667,6 +2667,11 @@ serial8250_do_set_termios(struct uart_po
unsigned long flags;
unsigned int baud, quot, frac = 0;

View File

@@ -15,7 +15,7 @@
/* initialize internal qc */
/* XXX: Tag 0 is used for drivers with legacy EH as some
@@ -5129,6 +5137,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
@@ -5132,6 +5140,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
return NULL;
@@ -25,7 +25,7 @@
/* libsas case */
if (ap->flags & ATA_FLAG_SAS_HOST) {
tag = ata_sas_allocate_tag(ap);
@@ -5174,6 +5185,8 @@ void ata_qc_free(struct ata_queued_cmd *
@@ -5177,6 +5188,8 @@ void ata_qc_free(struct ata_queued_cmd *
qc->tag = ATA_TAG_POISON;
if (ap->flags & ATA_FLAG_SAS_HOST)
ata_sas_free_tag(tag, ap);
@@ -36,8 +36,8 @@
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -923,6 +923,8 @@ struct ata_port_operations {
void (*qc_prep)(struct ata_queued_cmd *qc);
@@ -924,6 +924,8 @@ struct ata_port_operations {
enum ata_completion_errors (*qc_prep)(struct ata_queued_cmd *qc);
unsigned int (*qc_issue)(struct ata_queued_cmd *qc);
bool (*qc_fill_rtf)(struct ata_queued_cmd *qc);
+ int (*qc_new)(struct ata_port *ap);
@@ -45,7 +45,7 @@
/*
* Configuration and exception handling
@@ -1013,6 +1015,9 @@ struct ata_port_operations {
@@ -1014,6 +1016,9 @@ struct ata_port_operations {
void (*phy_reset)(struct ata_port *ap);
void (*eng_timeout)(struct ata_port *ap);

View File

@@ -44,7 +44,7 @@ Subject: [PATCH 37/53] mtd: cfi cmdset 0002 force word write
/* Atmel chips don't use the same PRI format as AMD chips */
static void fixup_convert_atmel_pri(struct mtd_info *mtd)
@@ -1798,6 +1802,7 @@ static int cfi_amdstd_write_words(struct
@@ -1797,6 +1801,7 @@ static int cfi_amdstd_write_words(struct
/*
* FIXME: interleaved mode not tested, and probably not supported!
*/
@@ -52,7 +52,7 @@ Subject: [PATCH 37/53] mtd: cfi cmdset 0002 force word write
static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const u_char *buf,
int len)
@@ -1930,7 +1935,6 @@ static int __xipram do_write_buffer(stru
@@ -1929,7 +1934,6 @@ static int __xipram do_write_buffer(stru
return ret;
}
@@ -60,7 +60,7 @@ Subject: [PATCH 37/53] mtd: cfi cmdset 0002 force word write
static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
@@ -2005,6 +2009,7 @@ static int cfi_amdstd_write_buffers(stru
@@ -2004,6 +2008,7 @@ static int cfi_amdstd_write_buffers(stru
return 0;
}