diff --git a/package/emortal/autocore/Makefile b/package/emortal/autocore/Makefile index d2c493d1bc..4d60d5a850 100644 --- a/package/emortal/autocore/Makefile +++ b/package/emortal/autocore/Makefile @@ -11,7 +11,8 @@ PKG_RELEASE:=$(COMMITCOUNT) PKG_CONFIG_DEPENDS:= \ CONFIG_TARGET_bcm27xx \ - CONFIG_TARGET_bcm53xx + CONFIG_TARGET_bcm53xx \ + CONFIG_TARGET_mvebu include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/target.mk @@ -21,7 +22,8 @@ define Package/autocore-arm MAINTAINER:=CN_SZTL DEPENDS:=@(arm||aarch64) \ +TARGET_bcm27xx:bcm27xx-userland \ - +TARGET_bcm53xx:nvram + +TARGET_bcm53xx:nvram \ + +TARGET_mvebu:mhz VARIANT:=arm endef diff --git a/package/emortal/autocore/files/generic/cpuinfo b/package/emortal/autocore/files/generic/cpuinfo index e92c0afc41..2d1acf702a 100755 --- a/package/emortal/autocore/files/generic/cpuinfo +++ b/package/emortal/autocore/files/generic/cpuinfo @@ -22,15 +22,17 @@ case "$DISTRIB_TARGET" in "bcm53xx"/*) cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz" ;; "mvebu"/*) - cpu_freq="$(awk -F ': ' '/BogoMIPS/ {print $2}' "$CPUINFO_PATH" | head -n1)MHz" ;; -"x86"/*) - cpu_freq="$(awk -F ': ' '/MHz/ {print $2}' "$CPUINFO_PATH" | head -n1)MHz" + cpu_freq="$(mhz | awk -F 'cpu_MHz=' '{printf("%.fMHz",$2)}')" ;; +"rockchip"/*) + cpu_freq="$(awk '{printf("%.fMHz", $0 / 1000)}' "$CPUFREQ_PATH/policy0/cpuinfo_cur_freq")" + [ ! -e "$CPUFREQ_PATH/policy4/cpuinfo_cur_freq" ] || \ + big_cpu_freq="$(awk '{printf("%.fMHz ", $0 / 1000)}' "$CPUFREQ_PATH/policy4/cpuinfo_cur_freq")" ;; +"x86"/*) + cpu_freq="$(awk -F ': ' '/MHz/ {print $2}' "$CPUINFO_PATH" | head -n1)MHz" ;; *) [ ! -e "$CPUFREQ_PATH/policy0/cpuinfo_cur_freq" ] || \ cpu_freq="$(awk '{printf("%.fMHz", $0 / 1000)}' "$CPUFREQ_PATH/policy0/cpuinfo_cur_freq")" - [ ! -e "$CPUFREQ_PATH/policy4/cpuinfo_cur_freq" ] || \ - big_cpu_freq="$(awk '{printf("%.fMHz ", $0 / 1000)}' "$CPUFREQ_PATH/policy4/cpuinfo_cur_freq")" ;; esac @@ -38,10 +40,11 @@ case "$DISTRIB_TARGET" in "bcm27xx"/*) cpu_temp="$(vcgencmd measure_temp | awk -F '=' '{print $2}' | awk -F "'" '{print $1}')°C" ;; "x86"/*) - # Intel - cpu_temp="$(sensors "coretemp-*" 2>"/dev/null" | grep -E "(Package id |Core )" | grep -Eo "\+[0-9.]*°C" | head -n1 | tr -d "+")" - # AMD - [ -n "${cpu_temp}" ] || cpu_temp="$(sensors "k*temp-*" 2>"/dev/null" | awk '/Tdie/ {print $2}' | head -n1 | tr -d "+")" + if grep -q "GenuineIntel" "/proc/cpuinfo"; then + cpu_temp="$(sensors "coretemp-*" 2>"/dev/null" | grep -E "(Package id |Core )" | grep -Eo "\+[0-9.]*°C" | head -n1 | tr -d "+")" + else grep -q "AuthenticAMD" "/proc/cpuinfo"; then + cpu_temp="$(sensors "k*temp-*" 2>"/dev/null" | awk '/Tdie/ {print $2}' | head -n1 | tr -d "+")" + fi ;; *) [ ! -e "$THERMAL_PATH/thermal_zone0/temp" ] || \