meta-openpower: avahi: Append MAC address to the hostname

The idea of this commit is to handle situations where the
serial number is not written into bmc-vpd. In such cases,
the MAC address will be appended with the hostname to make
the hostname unique.

Tested By:

1. When BMC Serial Number is present:

Output:
root@witherspoon-YL10UF78A0H4:~# hostname
witherspoon-YL10UF78A0H4

2. In the absence of BMC Serial Number, MAC Address is appended:

Output:
root@witherspoon:/# hostname
witherspoon

After enabling first-boot-set-hostname.service and reboot,
root@witherspoon-70e284143365:/# hostname
witherspoon-70e284143365

3. When Inventory interface is not found:

Output:
Exits with error: "No Ethernet interface found in the Inventory. Unique hostname not set!"
Hostname will not be set. It remains the same.

Signed-off-by: asmithakarun <asmithkr@in.ibm.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I821c5b1e7943cc17001dc1e613cca9b48c58375f
1 file changed
tree: 1028fe5c21c69dce6e7e20dd248bd387ec381ac7
  1. classes/
  2. conf/
  3. recipes-bsp/
  4. recipes-devtools/
  5. recipes-phosphor/
  6. COPYING.apache-2.0
  7. COPYING.MIT
  8. LICENSE
  9. MAINTAINERS
  10. README.md
README.md

OpenPOWER

meta-openpower is the OpenPOWER layer and should be included in all OpenPOWER systems' bblayers.conf. More information on OpenPOWER can be found here.