Fix intel
All checks were successful
PikaOS Package Build & Release (amd64-v3) / build (push) Successful in 28s

This commit is contained in:
ferreo 2024-09-02 22:38:01 +01:00
parent 861de368d7
commit ed2c2eb112
4 changed files with 26 additions and 11 deletions

View File

@ -1 +1 @@
1 2

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
falcon (1.0.2-101pika1) pika; urgency=low
* Fix Intel
-- Ward Nakchbandi <hotrod.master@hotmail.com> Sat, 10 Dec 2022 13:48:00 +0300
falcon (1.0.1-101pika1) pika; urgency=low falcon (1.0.1-101pika1) pika; urgency=low
* Initial release * Initial release

27
main.go
View File

@ -204,16 +204,25 @@ func GetPPStatusAndHighestCores() (bool, []CoreFreq, bool, []int, error) {
return fmt.Errorf("failed to unmarshal lscpu output: %w", err) return fmt.Errorf("failed to unmarshal lscpu output: %w", err)
} }
var maxMHz float64 sort.Slice(lscpuOutput.CPUs, func(i, j int) bool {
for _, cpu := range lscpuOutput.CPUs { return lscpuOutput.CPUs[i].MaxMHz > lscpuOutput.CPUs[j].MaxMHz
if cpu.MaxMHz > maxMHz { })
maxMHz = cpu.MaxMHz
}
}
for _, cpu := range lscpuOutput.CPUs { if len(lscpuOutput.CPUs) > 0 {
if cpu.MaxMHz == maxMHz { topMHz := lscpuOutput.CPUs[0].MaxMHz
highestCores = append(highestCores, cpu.CPU) secondMHz := topMHz
for _, cpu := range lscpuOutput.CPUs {
if cpu.MaxMHz < topMHz {
secondMHz = cpu.MaxMHz
break
}
}
for _, cpu := range lscpuOutput.CPUs {
if cpu.MaxMHz == topMHz || cpu.MaxMHz == secondMHz {
highestCores = append(highestCores, cpu.CPU)
}
} }
} }

View File

@ -2,7 +2,7 @@
set -e set -e
VERSION="1.0.1" VERSION="1.0.2"
source ./pika-build-config.sh source ./pika-build-config.sh