Implement audit enrichments, TUI workflows, and production ISO scaffold
This commit is contained in:
@@ -37,12 +37,44 @@ func parseLspci(output string) []schema.HardwarePCIeDevice {
|
||||
val := strings.TrimSpace(line[idx+2:])
|
||||
fields[key] = val
|
||||
}
|
||||
if !shouldIncludePCIeDevice(fields["Class"]) {
|
||||
continue
|
||||
}
|
||||
dev := parseLspciDevice(fields)
|
||||
devs = append(devs, dev)
|
||||
}
|
||||
return devs
|
||||
}
|
||||
|
||||
func shouldIncludePCIeDevice(class string) bool {
|
||||
c := strings.ToLower(strings.TrimSpace(class))
|
||||
if c == "" {
|
||||
return true
|
||||
}
|
||||
|
||||
// Keep inventory focused on useful replaceable components, not chipset/virtual noise.
|
||||
excluded := []string{
|
||||
"host bridge",
|
||||
"isa bridge",
|
||||
"pci bridge",
|
||||
"ram memory",
|
||||
"system peripheral",
|
||||
"communication controller",
|
||||
"signal processing controller",
|
||||
"usb controller",
|
||||
"smbus",
|
||||
"audio device",
|
||||
"serial bus controller",
|
||||
"unassigned class",
|
||||
}
|
||||
for _, bad := range excluded {
|
||||
if strings.Contains(c, bad) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func parseLspciDevice(fields map[string]string) schema.HardwarePCIeDevice {
|
||||
dev := schema.HardwarePCIeDevice{}
|
||||
present := true
|
||||
|
||||
Reference in New Issue
Block a user