From 286f1d7ad7d61a7909a796d83f1326d9b3d0eee0 Mon Sep 17 00:00:00 2001 From: actions Date: Wed, 17 Jul 2024 19:00:10 +0800 Subject: [PATCH] luci-app-passwall: sync upstream last commit: https://github.com/xiaorouji/openwrt-passwall/commit/da4eecc94c3aeadc70997e7500bd7396e88c1210 --- luci-app-passwall/luasrc/passwall/api.lua | 10 +++++++++- luci-app-passwall/luasrc/passwall/com.lua | 19 ++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/luci-app-passwall/luasrc/passwall/api.lua b/luci-app-passwall/luasrc/passwall/api.lua index d0b2f857a..6c517dc71 100644 --- a/luci-app-passwall/luasrc/passwall/api.lua +++ b/luci-app-passwall/luasrc/passwall/api.lua @@ -14,6 +14,7 @@ curl_args = { "-skfL", "--connect-timeout 3", "--retry 3" } command_timeout = 300 OPENWRT_ARCH = nil DISTRIB_ARCH = nil +OPENWRT_BOARD = nil LOG_FILE = "/tmp/log/" .. appname .. ".log" CACHE_PATH = "/tmp/etc/" .. appname .. "_tmp" @@ -620,7 +621,9 @@ local function auto_get_arch() local arch = nixio.uname().machine or "" if not OPENWRT_ARCH and fs.access("/usr/lib/os-release") then OPENWRT_ARCH = sys.exec("echo -n $(grep 'OPENWRT_ARCH' /usr/lib/os-release | awk -F '[\\042\\047]' '{print $2}')") + OPENWRT_BOARD = sys.exec("echo -n $(grep 'OPENWRT_BOARD' /usr/lib/os-release | awk -F '[\\042\\047]' '{print $2}')") if OPENWRT_ARCH == "" then OPENWRT_ARCH = nil end + if OPENWRT_BOARD == "" then OPENWRT_BOARD = nil end end if not DISTRIB_ARCH and fs.access("/etc/openwrt_release") then DISTRIB_ARCH = sys.exec("echo -n $(grep 'DISTRIB_ARCH' /etc/openwrt_release | awk -F '[\\042\\047]' '{print $2}')") @@ -651,6 +654,10 @@ local function auto_get_arch() end end + if arch == "aarch64" and OPENWRT_BOARD and OPENWRT_BOARD:match("rockchip") ~= nil then + arch = "rockchip" + end + return util.trim(arch) end @@ -696,8 +703,9 @@ local default_file_tree = { x86_64 = "amd64", x86 = "386", aarch64 = "arm64", + rockchip = "arm64", mips = "mips", - mipsel = "mipsle", + mipsel = "mipsel", armv5 = "arm.*5", armv6 = "arm.*6[^4]*", armv7 = "arm.*7", diff --git a/luci-app-passwall/luasrc/passwall/com.lua b/luci-app-passwall/luasrc/passwall/com.lua index 83ac01fd9..86c065daa 100644 --- a/luci-app-passwall/luasrc/passwall/com.lua +++ b/luci-app-passwall/luasrc/passwall/com.lua @@ -62,15 +62,16 @@ _M["chinadns-ng"] = { default_path = "/usr/bin/chinadns-ng", match_fmt_str = "%s", file_tree = { - x86_64 = "x86_64@", - x86 = "i686", - mips = "mips%-.*mips32%+soft_float@", - mipsel = "mipsel.*mips32%+soft_float@", - aarch64 = "aarch64.*v8a", - armv5 = "arm.*v5te", - armv6 = "arm.*v6t2", - armv7 = "eabihf.*v7a", - armv8 = "aarch64.*v8a" + x86_64 = "wolfssl@x86_64.*x86_64@", + x86 = "wolfssl@i386.*i686", + mips = "wolfssl@mips%-.*mips32%+soft_float@", + mipsel = "wolfssl@mipsel.*mips32%+soft_float@", + aarch64 = "wolfssl_noasm@aarch64.*v8a", + rockchip = "wolfssl@aarch64.*v8a", + armv5 = "wolfssl@arm.*v5te", + armv6 = "wolfssl@arm.*v6t2", + armv7 = "wolfssl@arm.*eabihf.*v7a", + armv8 = "wolfssl_noasm@aarch64.*v8a" } }