mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-05 23:23:02 +02:00
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:
@@ -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']}")
|
||||
|
||||
|
||||
@@ -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"] = {
|
||||
|
||||
Reference in New Issue
Block a user