diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index 2d1ce8f146..c9307eaa87 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -12,14 +12,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=autocore PKG_VERSION:=1 -PKG_RELEASE:=29 +PKG_RELEASE:=$(AUTORELEASE) include $(INCLUDE_DIR)/package.mk define Package/autocore-arm TITLE:=ARM auto core script. MAINTAINER:=CN_SZTL - DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_mvebu||TARGET_ipq40xx||TARGET_ipq806x||TARGET_rockchip) \ + DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_ipq40xx||TARGET_ipq806x||TARGET_mvebu||TARGET_sunxi||TARGET_rockchip) \ +TARGET_bcm27xx:bcm27xx-userland \ +TARGET_bcm53xx:nvram \ +TARGET_ipq40xx:lm-sensors diff --git a/package/lean/autocore/files/arm/cpuinfo b/package/lean/autocore/files/arm/cpuinfo index da021f2b71..39fae565d1 100755 --- a/package/lean/autocore/files/arm/cpuinfo +++ b/package/lean/autocore/files/arm/cpuinfo @@ -10,18 +10,27 @@ 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 - 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 " +elif [ -e "/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq" ]; then + cpu_freq="$(expr $(cat "/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq") / 1000)MHz" +elif [ -e "/sys/devices/system/cpu/cpufreq/policy4/cpuinfo_cur_freq" ]; then + big_cpu_freq="$(expr $(cat "/sys/devices/system/cpu/cpufreq/policy4/cpuinfo_cur_freq") / 1000)MHz " fi if grep -q "bcm27xx" "/etc/openwrt_release"; then - cpu_temp="$(vcgencmd measure_temp | awk -F '=' '{print $2}' | awk -F "'" '{print $1}')°C" + cpu_temp="$(vcgencmd measure_temp | awk -F '=' '{print $2}' | awk -F "'" '{print $1}')°C" elif grep -q "ipq40xx" "/etc/openwrt_release"; then cpu_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')" else - cpu_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C" + [ -e "/sys/class/thermal/thermal_zone0/temp" ] && \ + cpu_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat "/sys/class/thermal/thermal_zone0/temp")/1000)}")°C" fi -echo -n "${cpu_arch} x ${cpu_cores} (${big_cpu_freq}${cpu_freq}, ${cpu_temp})" +if [ -z "${cpu_freq}" ] && [ -z "${cpu_temp}" ]; then + echo -n "${cpu_arch} x ${cpu_cores}" +elif [ -z "${cpu_temp}" ]; then + echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq})" +elif [ -z "${cpu_freq}" ]; then + echo -n "${cpu_arch} x ${cpu_cores} (${cpu_temp})" +else + echo -n "${cpu_arch} x ${cpu_cores} (${big_cpu_freq}${cpu_freq}, ${cpu_temp})" +fi diff --git a/target/linux/sunxi/Makefile b/target/linux/sunxi/Makefile index 1b1c30628f..78789695ef 100644 --- a/target/linux/sunxi/Makefile +++ b/target/linux/sunxi/Makefile @@ -27,7 +27,7 @@ KERNELNAME:=zImage dtbs include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += uboot-envtools +DEFAULT_PACKAGES += autocore-arm uboot-envtools DEFAULT_PACKAGES += partx-utils mkf2fs e2fsprogs $(eval $(call BuildTarget))