autocore-arm: add filogic subtarget support

This commit is contained in:
AmadeusGhost 2022-09-13 23:40:21 +08:00
parent 83903ede7b
commit 176c77d7ee
2 changed files with 9 additions and 7 deletions

View File

@ -8,16 +8,16 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=autocore PKG_NAME:=autocore
PKG_VERSION:=1 PKG_RELEASE:=$(COMMITCOUNT)
PKG_RELEASE:=43
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/autocore-arm define Package/autocore-arm
TITLE:=Arm auto core loadbalance script. TITLE:=Arm auto core loadbalance script.
MAINTAINER:=CN_SZTL MAINTAINER:=CN_SZTL
DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_ipq40xx||TARGET_ipq806x||TARGET_ipq807x||TARGET_mvebu||TARGET_rockchip) \ DEPENDS:=@(arm||aarch64) \
+TARGET_bcm27xx:bcm27xx-userland +TARGET_bcm53xx:nvram +ethtool +TARGET_bcm27xx:bcm27xx-userland \
+TARGET_bcm53xx:nvram +ethtool
VARIANT:=arm VARIANT:=arm
endef endef
@ -43,7 +43,7 @@ define Package/autocore-arm/install
$(INSTALL_DIR) $(1)/etc $(INSTALL_DIR) $(1)/etc
$(INSTALL_DATA) ./files/arm/index.htm $(1)/etc/index.htm $(INSTALL_DATA) ./files/arm/index.htm $(1)/etc/index.htm
$(INSTALL_DIR) $(1)/etc/uci-defaults $(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_DIR) $(1)/sbin
$(INSTALL_BIN) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo $(INSTALL_BIN) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo
$(INSTALL_BIN) ./files/arm/sbin/ethinfo $(1)/sbin/ethinfo $(INSTALL_BIN) ./files/arm/sbin/ethinfo $(1)/sbin/ethinfo

View File

@ -10,13 +10,15 @@ elif grep -q "bcm53xx" "/etc/openwrt_release"; then
cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz" cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz"
elif grep -q "mvebu" "/etc/openwrt_release"; then elif grep -q "mvebu" "/etc/openwrt_release"; then
cpu_freq="$(cat "/proc/cpuinfo" | grep "BogoMIPS" | sed -n "1p" | awk -F ': ' '{print $2}')MHz" 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" 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")" 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 " [ -n "${big_cpu_freq}" ] && big_cpu_freq="${big_cpu_freq}MHz "
fi 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 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)" sys_temp="$(awk '{ printf("%.1f°C ", $0 / 1000) }' /sys/class/ieee80211/phy*/device/hwmon/hwmon*/temp1_input)"
else else