From 176c77d7eef5c45ca354a2fe60ba514cba15aeca Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Tue, 13 Sep 2022 23:40:21 +0800 Subject: [PATCH] autocore-arm: add filogic subtarget support --- package/lean/autocore/Makefile | 10 +++++----- package/lean/autocore/files/arm/sbin/cpuinfo | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index e3647c2d0..c7eea0045 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -8,16 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=autocore -PKG_VERSION:=1 -PKG_RELEASE:=43 +PKG_RELEASE:=$(COMMITCOUNT) include $(INCLUDE_DIR)/package.mk define Package/autocore-arm TITLE:=Arm auto core loadbalance script. MAINTAINER:=CN_SZTL - DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_ipq40xx||TARGET_ipq806x||TARGET_ipq807x||TARGET_mvebu||TARGET_rockchip) \ - +TARGET_bcm27xx:bcm27xx-userland +TARGET_bcm53xx:nvram +ethtool + DEPENDS:=@(arm||aarch64) \ + +TARGET_bcm27xx:bcm27xx-userland \ + +TARGET_bcm53xx:nvram +ethtool VARIANT:=arm endef @@ -43,7 +43,7 @@ define Package/autocore-arm/install $(INSTALL_DIR) $(1)/etc $(INSTALL_DATA) ./files/arm/index.htm $(1)/etc/index.htm $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./files/arm/090-cover-index_htm $(1)/etc/uci-defaults/090-cover-index_htm + $(INSTALL_BIN) ./files/arm/090-cover-index_htm $(1)/etc/uci-defaults/ $(INSTALL_DIR) $(1)/sbin $(INSTALL_BIN) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo $(INSTALL_BIN) ./files/arm/sbin/ethinfo $(1)/sbin/ethinfo diff --git a/package/lean/autocore/files/arm/sbin/cpuinfo b/package/lean/autocore/files/arm/sbin/cpuinfo index b582abee1..a5ab6afcb 100755 --- a/package/lean/autocore/files/arm/sbin/cpuinfo +++ b/package/lean/autocore/files/arm/sbin/cpuinfo @@ -10,13 +10,15 @@ elif grep -q "bcm53xx" "/etc/openwrt_release"; then cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz" elif grep -q "mvebu" "/etc/openwrt_release"; then cpu_freq="$(cat "/proc/cpuinfo" | grep "BogoMIPS" | sed -n "1p" | awk -F ': ' '{print $2}')MHz" -else +elif ! grep -q "filogic" "/etc/openwrt_release"; then cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz" big_cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy4/cpuinfo_cur_freq 2>"/dev/null") / 1000 2>"/dev/null")" [ -n "${big_cpu_freq}" ] && big_cpu_freq="${big_cpu_freq}MHz " fi -if grep -q "ipq" "/etc/openwrt_release"; then +if grep -q "filogic" "/etc/openwrt_release"; then + echo -n "${cpu_arch} x ${cpu_cores}" +elif grep -q "ipq" "/etc/openwrt_release"; then if grep -q "ipq40xx" "/etc/openwrt_release"; then sys_temp="$(awk '{ printf("%.1f°C ", $0 / 1000) }' /sys/class/ieee80211/phy*/device/hwmon/hwmon*/temp1_input)" else