Avahi: Adding Asset interface in the script to generate unique hostname
xyz.openbmc_project.Inventory.Item.Bmc is a null
interface where the SerialNumber is not present.
xyz.openbmc_project.Inventory.Decorator.Asset
interface contains the SerialNumber and is replaced
in place of the former interface.
Tested by:
1. Finding SerialNumber in Inventory interface
- busctl introspect xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc
output:
[[0;1;39mxyz.openbmc_project.Inventory.Decorator.Asset [[0m interface - - -
.BuildDate property s "" emits-change writable
.Manufacturer property s "IPS " emits-change writable
.Model property s "" emits-change writable
.PartNumber property s "01DH137 " emits-change writable
.SerialNumber property s "YL10UF76W015 " emits-change writable
2. Finding hostname
- hostname
output:
witherspoon
(From meta-openpower rev: cb0591457e1af5e79e8ac63770897ec1f25a1d51)
Signed-off-by: asmithakarun <asmithkr@in.ibm.com>
Change-Id: Ia7234471503562cfcbe14630e2e1352a3a84062e
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.sh b/meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.sh
index cf67f8b..42a85b8 100644
--- a/meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.sh
+++ b/meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.sh
@@ -13,6 +13,7 @@
MAPPER_PATH='/xyz/openbmc_project/object_mapper'
INVENTORY_PATH='/xyz/openbmc_project/inventory'
BMC_ITEM_IFACE='xyz.openbmc_project.Inventory.Item.Bmc'
+ INV_ASSET_IFACE='xyz.openbmc_project.Inventory.Decorator.Asset'
BMC_ITEM_PATH=$(busctl --no-pager --verbose call \
${MAPPER_IFACE} \
@@ -36,7 +37,7 @@
BMC_SN=$(busctl get-property ${BMC_ITEM_SERVICE} \
${BMC_ITEM_PATH} \
- ${BMC_ITEM_IFACE} SerialNumber)
+ ${INV_ASSET_IFACE} SerialNumber)
# 's "002B0DH1000"'
BMC_SN=${BMC_SN#*\"}
BMC_SN=${BMC_SN%\"*}