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
* Initial release

17
main.go
View File

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

View File

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