Fix IPMI FRU editable field detection for abbreviated ipmitool names

ipmitool fru print on some BMC implementations returns short names
("Chassis Serial", "Board Mfg", "Board Product", "Board Serial",
"Product Serial") instead of the full names in the vendor doc.
Add both variants to fruEditableFields so all fields are editable
regardless of which naming convention the BMC uses.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-06-19 09:24:15 +03:00
parent 892ef6fb7d
commit 13e6324853
+14 -6
View File
@@ -33,18 +33,26 @@ var fruEditableFields = map[string]struct {
Area string Area string
Index int Index int
}{ }{
"Chassis Part Number": {"c", 0}, // Chassis — vendor doc names and ipmitool abbreviated names
"Chassis Part Number": {"c", 0},
"Chassis Serial Number": {"c", 1}, "Chassis Serial Number": {"c", 1},
"Chassis Extra": {"c", 2}, "Chassis Serial": {"c", 1},
"Board Manufacturer": {"b", 0}, "Chassis Extra": {"c", 2},
"Board Product Name": {"b", 1}, // Board — vendor doc names and ipmitool abbreviated names
"Board Serial Number": {"b", 2}, "Board Manufacturer": {"b", 0},
"Board Part Number": {"b", 3}, "Board Mfg": {"b", 0},
"Board Product Name": {"b", 1},
"Board Product": {"b", 1},
"Board Serial Number": {"b", 2},
"Board Serial": {"b", 2},
"Board Part Number": {"b", 3},
// Product — vendor doc names and ipmitool abbreviated names
"Product Manufacturer": {"p", 0}, "Product Manufacturer": {"p", 0},
"Product Name": {"p", 1}, "Product Name": {"p", 1},
"Product Part Number": {"p", 2}, "Product Part Number": {"p", 2},
"Product Version": {"p", 3}, "Product Version": {"p", 3},
"Product Serial Number": {"p", 4}, "Product Serial Number": {"p", 4},
"Product Serial": {"p", 4},
} }
func parseFRUOutput(output string) []fruField { func parseFRUOutput(output string) []fruField {