meta-openpower: Set unique BMC hostname
To prevent hostnames conflicts this service appends to the default
hostname a Serial Number retrieved from Inventory Manager.
This operation is executed only at the first boot or after a factory reset.
This will be skipped if hostname is manually configured to a non default
value.
Change-Id: I92d4c949255629cb46527d07b9f05b1d14a39714
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
diff --git a/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.service b/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.service
new file mode 100644
index 0000000..ce59b33
--- /dev/null
+++ b/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Init BMC Hostname
+Wants=mapper-wait@-xyz-openbmc_project-inventory.service
+After=mapper-wait@-xyz-openbmc_project-inventory.service
+
+[Service]
+ExecStart=/usr/bin/first-boot-set-hostname.sh
+Type=oneshot
+RemainAfterExit=Yes
+
+[Install]
+WantedBy=multi-user.target
+