AmadeusGhost 2020-06-06 18:35:30 +08:00
parent b1e145b4cc
commit 14f1629629
8 changed files with 22 additions and 30 deletions

View File

@ -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))

View File

@ -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})"

View File

@ -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})"

View File

@ -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

View File

@ -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

View File

@ -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