From 8d5e5226c4beb7b9e1caa145157c23d45bddd8e8 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 30 Mar 2023 23:13:16 +0800 Subject: [PATCH] autocore: add Intel 12/13th Hydrid P cores and E cores --- package/lean/autocore/files/x86/autocore | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/package/lean/autocore/files/x86/autocore b/package/lean/autocore/files/x86/autocore index 2ad0a2ea8..77955ceaa 100755 --- a/package/lean/autocore/files/x86/autocore +++ b/package/lean/autocore/files/x86/autocore @@ -25,11 +25,21 @@ start() a=$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq) b=$(echo -n ' : ') c=$(cat /proc/cpuinfo | grep 'core id' | sort -u | wc -l) - d=$(echo -n ' Core ') + d=$(echo -n 'C') e=$(cat /proc/cpuinfo | grep 'processor' | wc -l) - f=$(echo -n ' Thread ') - g=$(cat /tmp/sysinfo/model) - h=${g}' - '${a}${b}${c}${d}${e}${f} + f=$(echo -n 'T ') + g=$(dmesg | grep 'DMI:' | awk -F ',' '{print $1 }' | awk -F ':' '{print $2 }') + + if [ -d /sys/devices/cpu_atom/ ]; then + pcore=$(cat /sys/devices/cpu_core/cpus | awk -F- '{print $2}') + pc=$(echo "$pcore+1" | bc) + ecore1=$(cat /sys/devices/cpu_atom/cpus | awk -F- '{print $1}') + ecore2=$(cat /sys/devices/cpu_atom/cpus | awk -F- '{print $2}') + ec=$(echo "$ecore2-$ecore1+1" | bc) + hydrid='('${pc}'P+'${ec}'E)' + fi + + h=${g}' - '${a}${b}${c}${d}${e}${f}${hydrid} mkdir -p /tmp/sysinfo echo $h > /tmp/sysinfo/model @@ -50,4 +60,4 @@ start() done [ -f /etc/index.htm ] && mv /etc/index.htm /usr/lib/lua/luci/view/admin_status/index.htm -} +} \ No newline at end of file