schemas: Add Inventory.Item.NetworkInterface
For phosphor-networkd's sync-mac feature [1] to work,
phosphor-networkd must be able to find an object with
xyz.openbmc_project.Inventory.Item.NetworkInterface interface.
This commit adds the property `MACAddress` under the interface
`xyz.openbmc_project.Inventory.Item.NetworkInterface` to the
openbmc-dbus.json schema, and adds the interface to under
"EMConfig"/"properties" in global.json to expose the Board's MAC
Address to D-Bus.
Tested:
Add below config to Mt.Mitchell BMC board's EM configuration:
"xyz.openbmc_project.Inventory.Item.NetworkInterface": {
"MACAddress": "$BOARD_INFO_AM1"
}
=> Successfully pass CI build
$ busctl get-property xyz.openbmc_project.EntityManager \
/xyz/openbmc_project/inventory/system/board/Mt_Mitchell_BMC \
xyz.openbmc_project.Inventory.Item.NetworkInterface MACAddress
s "xx:xx:xx:xx:xx:xx"
=> phosphor-network-manager manages to get MAC address from inventory on
first boot, or when FORCE_SYNC_MAC_FROM_INVENTORY is set
$ journalctl | grep -i network
...
phosphor-network-manager: Check VPD for MAC: Force sync enabled
phosphor-network-manager: Registering the Inventory Signals Matcher
phosphor-network-manager: Setting MAC xx:xx:xx:xx:xx:xx on interface
eth0
...
$ busctl get-property xyz.openbmc_project.Network \
/xyz/openbmc_project/network/eth0 \
xyz.openbmc_project.Network.MACAddress MACAddress
s "xx:xx:xx:xx:xx:xx"
[1]: https://github.com/openbmc/phosphor-networkd/commit/cc099a855ab517deb563ceb6821a8a414362132e
Signed-off-by: Chau Ly <chaul@amperecomputing.com>
Change-Id: I2b9ea2a250e3b98d811154955e09130a00682baf
diff --git a/schemas/openbmc-dbus.json b/schemas/openbmc-dbus.json
index 2819a8f..aa586a7 100644
--- a/schemas/openbmc-dbus.json
+++ b/schemas/openbmc-dbus.json
@@ -104,6 +104,16 @@
"additionalProperties": false,
"type": "object"
},
+ "NetworkInterface": {
+ "additionalProperties": false,
+ "properties": {
+ "MACAddress": {
+ "type": "string"
+ }
+ },
+ "required": ["MACAddress"],
+ "type": "object"
+ },
"Panel": {
"additionalProperties": false,
"type": "object"