From ac394d4d1d0bf5beedbd719ca6711d829e46495b Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Tue, 28 Jul 2020 03:00:36 +0800 Subject: [PATCH] autocore-arm: add ipq40xx support --- package/lean/autocore/Makefile | 6 +++++- package/lean/autocore/files/arm/cpuinfo-ipq40xx | 9 +++++++++ target/linux/ipq40xx/Makefile | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100755 package/lean/autocore/files/arm/cpuinfo-ipq40xx diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index 33fc8cf0f1..52176f5a9d 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/package.mk define Package/autocore-arm TITLE:=ARM auto core script. MAINTAINER:=CN_SZTL - DEPENDS:=@(TARGET_bcm27xx||TARGET_ipq806x||TARGET_rockchip) + DEPENDS:=@(TARGET_bcm27xx||TARGET_ipq40xx||TARGET_ipq806x||TARGET_rockchip) +TARGET_ipq40xx:lm-sensors VARIANT:=arm endef @@ -46,7 +46,11 @@ define Package/autocore-arm/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) ./files/arm/090-cover-index_files $(1)/etc/uci-defaults/090-cover-index_files $(INSTALL_DIR) $(1)/sbin +ifneq ($(BOARD),ipq40xx) $(INSTALL_BIN) ./files/arm/cpuinfo $(1)/sbin/cpuinfo +else + $(INSTALL_BIN) ./files/arm/cpuinfo-ipq40xx $(1)/sbin/cpuinfo +endif endef define Package/autocore-x86/install diff --git a/package/lean/autocore/files/arm/cpuinfo-ipq40xx b/package/lean/autocore/files/arm/cpuinfo-ipq40xx new file mode 100755 index 0000000000..329675b81c --- /dev/null +++ b/package/lean/autocore/files/arm/cpuinfo-ipq40xx @@ -0,0 +1,9 @@ +#!/bin/sh + +cpu_arch="$(cat "/proc/cpuinfo" | grep "model name" | sed -n "1p" | awk -F ': ' '{print $2}')" +cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)" + +cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz" +sys_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')" + +echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq}, ${sys_temp})" diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile index 160ce7fdcd..27cb814625 100644 --- a/target/linux/ipq40xx/Makefile +++ b/target/linux/ipq40xx/Makefile @@ -19,7 +19,7 @@ DEFAULT_PACKAGES += \ kmod-leds-gpio kmod-gpio-button-hotplug swconfig \ kmod-ath10k-ct wpad-openssl \ kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \ - automount \ - ca-certificates htop fdisk e2fsprogs + autocore-arm automount luci-app-cpufreq \ + ca-certificates htop fdisk e2fsprogs ethtool $(eval $(call BuildTarget))