fix(inspur): show microcode version for every CPU, not just the first

Dedup by version caused CPU1 Microcode to be omitted when both CPUs run
the same version, leaving the firmware column blank for the second socket.
Each CPU gets its own firmware entry keyed by index.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail ChusavitinandClaude Sonnet 4.6 committed 2026-05-21 14:15:28 +03:00
1 parent f2c04cf0e8
commit 9505303d1d
2 files changed
+2 -7

No files matched your search

+1 -3
View File
@@ -102,7 +102,6 @@ func parseCPUInfo(text string, hw *models.HardwareConfig) {
return
}
seenMicrocode := make(map[string]bool)
for _, proc := range cpuInfo.Processors {
if proc.ProcStatus != 1 && proc.ConfigStatus != 1 {
continue
@@ -120,12 +119,11 @@ func parseCPUInfo(text string, hw *models.HardwareConfig) {
TDP: proc.TDP,
PPIN: proc.PPIN,
})
if proc.MicroCode != "" && !seenMicrocode[proc.MicroCode] {
if proc.MicroCode != "" {
hw.Firmware = append(hw.Firmware, models.FirmwareInfo{
DeviceName: fmt.Sprintf("CPU%d Microcode", proc.ProcID),
Version: proc.MicroCode,
})
seenMicrocode[proc.MicroCode] = true
}
}
}