autocore: add Intel 12/13th Hydrid P cores and E cores

This commit is contained in:
coolsnowwolf 2023-03-30 23:13:16 +08:00
parent 0747f72a7f
commit 8d5e5226c4

View File

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