diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index 49a7444df4..450a20356d 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -9,15 +9,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=autocore PKG_VERSION:=1 -PKG_RELEASE:=32 - +PKG_RELEASE:=33 include $(INCLUDE_DIR)/package.mk -define Package/autocore-raspberrypi - TITLE:=RaspberryPi auto core loadbalance script. +define Package/autocore-arm + TITLE:=Arm auto core loadbalance script. MAINTAINER:=CN_SZTL - DEPENDS:=@TARGET_bcm27xx +bcm27xx-userland + DEPENDS:=@(TARGET_bcm27xx||TARGET_ipq806x) endef define Package/autocore-x86 @@ -26,23 +25,24 @@ define Package/autocore-x86 DEPENDS:=@TARGET_x86 +bc +lm-sensors +ethtool endef -define Package/autocore/description - A usb autoconfig hotplug script. +define Package/autocore-arm/description + A luci autoconfig hotplug script. endef -Package/autocore-x86/description = $(call Package/autocore/description) -Package/autocore-raspberrypi/description = $(call Package/autocore/description) +define Package/autocore-x86/description + A usb autoconfig hotplug script. +endef define Build/Compile endef -define Package/autocore-raspberrypi/install +define Package/autocore-arm/install $(INSTALL_DIR) $(1)/etc - $(INSTALL_DATA) ./files/raspberrypi/index.htm $(1)/etc/index.htm + $(INSTALL_DATA) ./files/arm/index.htm $(1)/etc/index.htm $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./files/raspberrypi/090-cover-index_htm $(1)/etc/uci-defaults/090-cover-index_htm + $(INSTALL_BIN) ./files/arm/090-cover-index_htm $(1)/etc/uci-defaults/090-cover-index_htm $(INSTALL_DIR) $(1)/sbin - $(CP) ./files/raspberrypi/sbin/* $(1)/sbin + $(CP) ./files/arm/sbin/* $(1)/sbin endef define Package/autocore-x86/install @@ -54,5 +54,5 @@ define Package/autocore-x86/install $(CP) ./files/x86/sbin/* $(1)/sbin endef -$(eval $(call BuildPackage,autocore-raspberrypi)) +$(eval $(call BuildPackage,autocore-arm)) $(eval $(call BuildPackage,autocore-x86)) diff --git a/package/lean/autocore/files/raspberrypi/090-cover-index_htm b/package/lean/autocore/files/arm/090-cover-index_htm similarity index 100% rename from package/lean/autocore/files/raspberrypi/090-cover-index_htm rename to package/lean/autocore/files/arm/090-cover-index_htm diff --git a/package/lean/autocore/files/raspberrypi/index.htm b/package/lean/autocore/files/arm/index.htm similarity index 100% rename from package/lean/autocore/files/raspberrypi/index.htm rename to package/lean/autocore/files/arm/index.htm diff --git a/package/lean/autocore/files/arm/sbin/cpuinfo b/package/lean/autocore/files/arm/sbin/cpuinfo new file mode 100755 index 0000000000..0c89118b58 --- /dev/null +++ b/package/lean/autocore/files/arm/sbin/cpuinfo @@ -0,0 +1,6 @@ +#!/bin/sh + +cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq) / 1000)Mhz" +sys_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C" + +echo -n "(${cpu_freq}, ${sys_temp})" diff --git a/package/lean/autocore/files/raspberrypi/sbin/cpuinfo b/package/lean/autocore/files/raspberrypi/sbin/cpuinfo deleted file mode 100755 index c79f937869..0000000000 --- a/package/lean/autocore/files/raspberrypi/sbin/cpuinfo +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if command -v vcgencmd >/dev/null; then - cpu_freq="$(vcgencmd get_config arm_freq | awk -F '=' '{print $2}')Mhz" - sys_temp="$(vcgencmd measure_temp | grep -Eo '[0-9.]+')°C" -else - cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq) / 1000)Mhz" - sys_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C" -fi - -echo -n "(${cpu_freq}, ${sys_temp})" diff --git a/package/lean/autocore/files/x86/sbin/cpuinfo b/package/lean/autocore/files/x86/sbin/cpuinfo index 19ea5fb29d..e25602de0e 100755 --- a/package/lean/autocore/files/x86/sbin/cpuinfo +++ b/package/lean/autocore/files/x86/sbin/cpuinfo @@ -4,13 +4,10 @@ info() { MHz=`grep 'MHz' /proc/cpuinfo | cut -c11- |sed -n '1p'` #获取CPU工作频率 - sensors >/dev/null - if [ $? -eq 0 ];then a=`sensors | grep 'Core 0' | cut -c10-24` #获取CPU核心1温度 - else a="" fi diff --git a/target/linux/bcm27xx/Makefile b/target/linux/bcm27xx/Makefile index a528dd7020..32c8121421 100644 --- a/target/linux/bcm27xx/Makefile +++ b/target/linux/bcm27xx/Makefile @@ -28,7 +28,7 @@ DEFAULT_PACKAGES += \ kmod-sound-core kmod-sound-arm-bcm2835 \ kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \ partx-utils mkf2fs e2fsprogs \ - htop autocore-raspberrypi + htop autocore-arm KERNELNAME:=Image dtbs diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile index 2d6fa2cab9..e957b1b1eb 100644 --- a/target/linux/ipq806x/Makefile +++ b/target/linux/ipq806x/Makefile @@ -23,7 +23,7 @@ DEFAULT_PACKAGES += \ kmod-ata-core kmod-ata-ahci kmod-ata-ahci-platform \ kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ kmod-usb3 kmod-usb-dwc3-of-simple kmod-usb-phy-qcom-dwc3 \ - kmod-ath10k-ct wpad uboot-envtools e2fsprogs \ + kmod-ath10k-ct wpad uboot-envtools e2fsprogs autocore-arm \ automount autosamba v2ray shadowsocks-libev-ss-redir shadowsocksr-libev-server \ luci-app-ipsec-vpnd luci-app-unblockmusic luci-app-zerotier ca-certificates