mirror of
https://github.com/Heleguo/lede.git
synced 2025-12-16 02:50:04 +00:00
autocore: add loongarch64 target support
This commit is contained in:
parent
3c3f691df9
commit
96e8d60f7f
@ -321,15 +321,14 @@ menu "Target Images"
|
||||
depends on USES_BOOT_PART
|
||||
default 8 if TARGET_apm821xx_sata
|
||||
default 128 if TARGET_armsr
|
||||
default 64 if TARGET_bcm27xx
|
||||
default 64 if TARGET_bcm27xx || TARGET_x86 || TARGET_loongarch64
|
||||
default 32 if TARGET_rockchip
|
||||
default 16
|
||||
|
||||
config TARGET_ROOTFS_PARTSIZE
|
||||
int "Root filesystem partition size (in MiB)"
|
||||
depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS
|
||||
default 232 if TARGET_loongarch64
|
||||
default 448 if TARGET_mediatek || TARGET_x86
|
||||
default 448 if TARGET_mediatek || TARGET_x86 || TARGET_loongarch64
|
||||
default 160
|
||||
help
|
||||
Select the root filesystem partition size.
|
||||
|
||||
@ -22,6 +22,13 @@ define Package/autocore-arm
|
||||
VARIANT:=arm
|
||||
endef
|
||||
|
||||
define Package/autocore-loongarch64
|
||||
TITLE:=Loongarch64 auto core loadbalance script.
|
||||
MAINTAINER:=LEAN
|
||||
DEPENDS:=@loongarch64 +bc +ethtool +pciutils
|
||||
VARIANT:=loongarch64
|
||||
endef
|
||||
|
||||
define Package/autocore-x86
|
||||
TITLE:=x86/x64 auto core loadbalance script.
|
||||
MAINTAINER:=Lean
|
||||
@ -33,6 +40,10 @@ define Package/autocore-arm/description
|
||||
A luci autoconfig hotplug script.
|
||||
endef
|
||||
|
||||
define Package/autocore-loongarch64/description
|
||||
A luci autoconfig hotplug script.
|
||||
endef
|
||||
|
||||
define Package/autocore-x86/description
|
||||
A usb autoconfig hotplug script.
|
||||
endef
|
||||
@ -57,6 +68,17 @@ endif
|
||||
$(CP) ./files/luci-mod-status-autocore.json $(1)/usr/share/rpcd/acl.d/
|
||||
endef
|
||||
|
||||
define Package/autocore-autocore-loongarch64/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/60-autocore-reload-rpcd $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo
|
||||
$(INSTALL_BIN) ./files/arm/sbin/tempinfo $(1)/sbin/tempinfo
|
||||
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
|
||||
$(CP) ./files/luci-mod-status-autocore.json $(1)/usr/share/rpcd/acl.d/
|
||||
endef
|
||||
|
||||
define Package/autocore-x86/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/x86/autocore $(1)/etc/init.d/autocore
|
||||
@ -71,4 +93,5 @@ define Package/autocore-x86/install
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,autocore-arm))
|
||||
$(eval $(call BuildPackage,autocore-loongarch64))
|
||||
$(eval $(call BuildPackage,autocore-x86))
|
||||
|
||||
20
package/lean/autocore/files/loongarch64/autocore
Executable file
20
package/lean/autocore/files/loongarch64/autocore
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2025 lean <coolsnowwolf@gmail.com>
|
||||
|
||||
START=99
|
||||
|
||||
start()
|
||||
{
|
||||
a=$(cat /proc/cpuinfo | grep 'Model Name' | cut -f2 -d: | head -n 1)
|
||||
b=$(echo -n ' : ')
|
||||
c=$(cat /proc/cpuinfo | grep 'core' | sort -u | wc -l)
|
||||
d=$(echo -n 'C')
|
||||
e=$(cat /proc/cpuinfo | grep 'global_id' | sort -u | wc -l)
|
||||
f=$(echo -n 'T ')
|
||||
g=$(cat /proc/cpuinfo | grep 'CPU Family' | cut -f2 -d: | head -n 1)
|
||||
|
||||
h=${g}' - '${a}${b}${c}${d}${e}${f}
|
||||
|
||||
mkdir -p /tmp/sysinfo
|
||||
echo $h > /tmp/sysinfo/model
|
||||
}
|
||||
7
package/lean/autocore/files/loongarch64/sbin/cpuinfo
Executable file
7
package/lean/autocore/files/loongarch64/sbin/cpuinfo
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
MHz=`grep 'MHz' /proc/cpuinfo | cut -c13- |sed -n '1p'`
|
||||
|
||||
TEMP=`awk '{printf("%.1f¡ãC", $0 / 1000)}' "/sys/class/thermal/thermal_zone0/temp" 2>"/dev/null"`
|
||||
|
||||
echo "$MHz MHz $TEMP "
|
||||
5
package/lean/autocore/files/loongarch64/sbin/tempinfo
Executable file
5
package/lean/autocore/files/loongarch64/sbin/tempinfo
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
TEMP=`awk '{printf("%.1f¡ãC", $0 / 1000)}' "/sys/class/thermal/thermal_zone0/temp" 2>"/dev/null"`
|
||||
|
||||
echo "$TEMP "
|
||||
@ -18,6 +18,7 @@ KERNELNAME:=vmlinuz.efi dtbs
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
DEFAULT_PACKAGES += \
|
||||
partx-utils blkid e2fsprogs grub2-efi-loongarch64 kmod-yt6801
|
||||
partx-utils blkid e2fsprogs grub2-efi-loongarch64 kmod-yt6801 \
|
||||
kmod-fs-ext4 kmod-fs-f2fs losetup mkf2fs f2fsck e2fsprogs autocore-loongarch64
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user