From 4dded25eca534bba8a0706d95f4e97cccd00a1a3 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 19 Jul 2020 12:36:55 +0800 Subject: [PATCH] luci-app-turboacc: do not display hw nat option for non-mt7621 devices --- package/lean/luci-app-cpufreq/Makefile | 2 +- package/lean/luci-app-turboacc/luasrc/model/cbi/turboacc.lua | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package/lean/luci-app-cpufreq/Makefile b/package/lean/luci-app-cpufreq/Makefile index b2851b27b0..5fd5d6be1f 100644 --- a/package/lean/luci-app-cpufreq/Makefile +++ b/package/lean/luci-app-cpufreq/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI for CPU Freq Setting -LUCI_DEPENDS:=@arm +LUCI_DEPENDS:=@arm @arm64 PKG_NAME:=luci-app-cpufreq PKG_VERSION:=1 PKG_RELEASE:=5 diff --git a/package/lean/luci-app-turboacc/luasrc/model/cbi/turboacc.lua b/package/lean/luci-app-turboacc/luasrc/model/cbi/turboacc.lua index cd3ddf5c87..62797304ce 100644 --- a/package/lean/luci-app-turboacc/luasrc/model/cbi/turboacc.lua +++ b/package/lean/luci-app-turboacc/luasrc/model/cbi/turboacc.lua @@ -19,10 +19,12 @@ sw_flow.description = translate("Software based offloading for routing/NAT") sw_flow:depends("sfe_flow", 0) end +if luci.sys.call("cat /proc/cpuinfo | grep -q MT7621") == 0 then hw_flow = s:option(Flag, "hw_flow", translate("Hardware flow offloading")) hw_flow.default = 0 hw_flow.description = translate("Requires hardware NAT support. Implemented at least for mt7621") hw_flow:depends("sw_flow", 1) +end if nixio.fs.access("/lib/modules/" .. kernel_version .. "/fast-classifier.ko") then sfe_flow = s:option(Flag, "sfe_flow", translate("Shortcut-FE flow offloading"))