Discard placeholder DMI serial numbers - #6381
Draft
eriknordmark wants to merge 2 commits into
Draft
Conversation
Firmware that never programmed its SMBIOS system serial number reports filler text instead: "To be filled by O.E.M.", "Default string", an echo of the field name such as "System Serial Number", or a counting pattern like "0123456789". Every unit of an affected model reports the same string, so a controller keying a device on it cannot tell those units apart. Only the literal "Not Specified" was recognized before, so every other placeholder was reported verbatim and sent in the register request. Placeholders are now discarded from both the SMBIOS and the CPU/SoC source, and the reported serial is empty when neither carries a device-specific value, letting a controller fall back to the soft serial. The discarded value is logged so an operator can see why. Integrator-built hardware is the common case: a complete server usually ships with all three SMBIOS serials programmed, while a bare board sold to an integrator often carries only a baseboard serial. The doc comment on the value set records where each string came from, naming eleven upstream placeholder lists by repository, path and symbol so a reviewer can check any entry against its source. A device already registered under a placeholder serial will stop matching on that string. Such a registration cannot distinguish devices anyway, but an affected device will need its soft serial registered instead. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
When SMBIOS carries no usable system serial number the device now reports the baseboard serial before giving up, and the CPU or SoC serial after that. A board sold to an integrator frequently ships with the system and chassis serials left as filler while the baseboard serial is the one real value on the unit, and some vendors write the value printed on the outside label into the baseboard field rather than the system field, telling their customers to try both. On those the serial an operator reads off the label only becomes visible to a controller once the baseboard field is consulted. The chosen source is logged, and falling back past the system serial is logged at notice level. That distinction matters operationally: no vendor discloses a baseboard serial to a purchaser, on paperwork or otherwise, so a serial sourced from it can identify a device to a controller but cannot be pre-registered from the order documentation. An operator seeing a serial that does not match the label needs the log line to tell which field the device actually used. Registration is unaffected when the reported serial is not the one on file: a controller that fails to match the hardware serial retries with the soft serial, so consulting more sources can only add matches, never remove them. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6381 +/- ##
==========================================
+ Coverage 24.65% 25.02% +0.36%
==========================================
Files 516 526 +10
Lines 94177 95928 +1751
==========================================
+ Hits 23222 24008 +786
- Misses 69090 69872 +782
- Partials 1865 2048 +183 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
EVE reads its hardware serial number from the SMBIOS system serial number, which
firmware frequently leaves unprogrammed. An unprogrammed field is not empty — it
contains filler such as
To be filled by O.E.M.,Default string, an echo ofthe field's own name (
System Serial Number), or a counting pattern(
0123456789). Every unit of an affected model reports the same string, so acontroller that identifies a device by it cannot tell those units apart.
Before this PR only the single literal
Not Specifiedwas recognized, so everyother placeholder was reported verbatim and sent in the register request.
Two commits, separable:
1.
pillar: discard placeholder DMI serial numbers— recognizes theplaceholder values, discards them from both the SMBIOS and the CPU/SoC source,
and reports an empty serial when neither carries a device-specific value. The
value set is the union of the placeholder lists maintained by eleven upstream
projects; the doc comment names each by repository, path and symbol so any entry
can be checked against its source.
2.
pillar: fall back to the baseboard serial number— consults the SMBIOSbaseboard serial when the system serial is unusable, before the CPU/SoC serial.
Two cases motivate it. A board sold to an integrator frequently ships with the
system and chassis serials left as filler while the baseboard serial is the only
real value on the unit. And some vendors write the value printed on the outside
label into the baseboard field rather than the system field, telling customers to
try both — on those, the serial an operator reads off the label only becomes
visible once the baseboard field is consulted.
The source of the reported serial is now logged, and falling back past the system
serial is logged at notice level. That distinction is operational: no vendor
discloses a baseboard serial to a purchaser, so a serial sourced from it can
identify a device to a controller but cannot be pre-registered from the order
paperwork. An operator seeing a serial that does not match the label needs the
log line to know which field the device used.
Registration cannot regress, for two independent reasons. A controller that fails
to match the hardware serial retries with the soft serial, so consulting more
sources can only add matches. And an already-onboarded device does not
re-establish its identity by serial number on an EVE update:
device-steps.shalways runs
getUuidand only addsselfRegisterwhile an onboardingcertificate is still present in
/config, and whenselfRegisterdoes not match,clientfalls through togetUuidagainst the device certificate — logging"getUUID succeeded; selfRegister no longer needed". So the changed serial affects
which devices can be onboarded from now on, not the identity of devices already
in a controller's inventory.
Related: #6346 (a cloned live image never gets a unique soft serial) covers the
other half of the same problem — this PR does not fix it.
PR dependencies
None.
How to test and validate this PR
Automated:
go test ./hardware/...inpkg/pillar.TestIsDMIPlaceholderseparates serials observed on real hardware from firmware filler;
TestFirstUsableSerialexercises the source ordering, the skipping ofplaceholders, and the empty result when the chain is exhausted.
Both tests were validated against the pre-change behavior: reverting the
detection produces 25 assertion failures while leaving the real-serial cases
green, and neutering the fallback fails 4 of its 6 cases.
On a device:
dmidecode -s system-serial-numberreturns a placeholder —0123456789is common on Supermicro boards sold to integrators — confirm thereported serial is no longer that value.
dmidecode -s baseboard-serial-numberon the same unit typically shows the real serial, and that is what should now
be reported.
GetProductSerial: falling back to baseboard-serial-number, orignoring placeholder system-serial-number "...".value is unchanged and the log records
using system-serial-number.registered, and confirm registration still succeeds via the soft serial.
Changelog notes
EVE no longer reports firmware placeholder text such as "To be filled by
O.E.M." or "0123456789" as a device serial number, and falls back to the
baseboard serial number when the system serial number is unset or is a
placeholder. The source of the reported serial is recorded in the log.
PR Backports
Checklist
Notes on the unchecked boxes:
docs/DEPLOYMENT.mddescribes the serial number as"semi-unique" but does not document the source chain. That doc update is
deliberately deferred to the onboarding design discussion, since the chain may
change.
and is unchanged in ordering, but it is now placeholder-filtered, which matters
for SoCs that report an all-zero serial.
stablelabel since nobackport is proposed.