board/aarch64: use %m modifier in default xPi hostnames

The xPi's usually don't have a VPD so the chassis mac-address probed at
boot is usually null in /run/system.json.  This commit adds a fallbkack
mechanism to populate this field so it can be used for unique hostnames
even on these boards.

Ths ietf-hardware.yang model does not have a notion of physical address,
so we augment one tht is generic enought to be used for other hardware
components than Ethernet, similar to what ietf-interfaces.yang use.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-10-31 13:26:08 +01:00
parent c66c0b46b5
commit 4b55e38741
10 changed files with 67 additions and 11 deletions
@@ -1703,6 +1703,8 @@ def show_hardware(json):
print(f"Manufacturer : {board['mfg-name']}")
if board.get("serial-num"):
print(f"Serial Number : {board['serial-num']}")
if board.get("infix-hardware:phys-address"):
print(f"Base MAC Address : {board['infix-hardware:phys-address']}")
if board.get("hardware-rev"):
print(f"Hardware Revision : {board['hardware-rev']}")
+4
View File
@@ -99,6 +99,10 @@ def motherboard_component(systemjson):
if systemjson.get("part-number"):
component["hardware-rev"] = systemjson["part-number"]
# Add chassis physical address (MAC) if available (from VPD or interface fallback)
if systemjson.get("mac-address"):
component["infix-hardware:phys-address"] = systemjson["mac-address"]
# Set state - admin-state is "unknown" since chassis cannot be
# administratively controlled (locked/unlocked)
component["state"] = {