diff options
author | asmithakarun <asmithkr@in.ibm.com> | 2019-06-26 10:31:07 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-06-26 23:57:51 +0300 |
commit | 57f0a3e75b5f31b978a253ba486fa73d77245b38 (patch) | |
tree | 9fd362439ea43108966bf7a55f5de0916eebfe62 | |
parent | 4ea41bccaa5e0ca6ecaf229678e5da5fa66ef6dd (diff) | |
download | openbmc-57f0a3e75b5f31b978a253ba486fa73d77245b38.tar.xz |
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>
-rw-r--r-- | meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.sh | 3 |
1 files changed, 2 insertions, 1 deletions
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 cf67f8b47..42a85b873 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 @@ sync_hostname() { 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 @@ sync_hostname() { 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%\"*} |