diff options
Diffstat (limited to 'meta-openpower/recipes-phosphor/network')
5 files changed, 22 insertions, 10 deletions
diff --git a/meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.service b/meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.service index ce59b3377..45e73b50c 100644 --- a/meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.service +++ b/meta-openpower/recipes-phosphor/network/first-boot-set-hostname/first-boot-set-hostname.service @@ -2,6 +2,8 @@ Description=Init BMC Hostname Wants=mapper-wait@-xyz-openbmc_project-inventory.service After=mapper-wait@-xyz-openbmc_project-inventory.service +Wants=op-vpd-parser.service +After=op-vpd-parser.service [Service] ExecStart=/usr/bin/first-boot-set-hostname.sh 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 541523760..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 @@ -1,7 +1,11 @@ #!/bin/sh -eu show_error() { - echo "$@" >&2 + if [ -n "${JOURNAL_STREAM-}" ]; then + echo "$@" | systemd-cat -t first-boot-set-hostname -p emerg + else + echo "$@" >&2 + fi } sync_hostname() { @@ -9,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} \ @@ -26,13 +31,13 @@ sync_hostname() { ${BMC_ITEM_PATH} 2>/dev/null || true) if [[ -z "${BMC_ITEM_SERVICE}" ]]; then - echo "No BMC item found in the Inventory. Is VPD EEPROM empty?" >&2 + show_error "No BMC item found in the Inventory. Is VPD EEPROM empty?" return fi 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%\"*} @@ -43,4 +48,3 @@ sync_hostname() { [ "$(hostname)" = "{MACHINE}" ] && sync_hostname systemctl disable first-boot-set-hostname.service - diff --git a/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac.sh b/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac.sh index 9f751a6c3..9668ed5f1 100755 --- a/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac.sh +++ b/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac.sh @@ -1,7 +1,11 @@ #!/bin/sh -eu show_error() { - logger -p user.error -t bmc-first-init $@ + if [ -n "${JOURNAL_STREAM-}" ]; then + echo "$@" | systemd-cat -t first-boot-set-mac -p emerg + else + echo "$@" >&2 + fi } sync_mac() { @@ -47,8 +51,8 @@ sync_mac() { fi } -if [ $# -eq 0 ] - then echo 'No Ethernet interface name is given' +if [ $# -eq 0 ]; then + show_error 'No Ethernet interface name is given' exit 1 fi diff --git a/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac@.service b/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac@.service index a7c913eb6..8986efd46 100644 --- a/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac@.service +++ b/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac@.service @@ -4,6 +4,8 @@ Wants=mapper-wait@-xyz-openbmc_project-inventory.service After=mapper-wait@-xyz-openbmc_project-inventory.service Wants=mapper-wait@-xyz-openbmc_project-network-%i.service After=mapper-wait@-xyz-openbmc_project-network-%i.service +Wants=op-vpd-parser.service +After=op-vpd-parser.service [Service] ExecStart=/usr/bin/first-boot-set-mac.sh %i diff --git a/meta-openpower/recipes-phosphor/network/first-boot-set-mac_1.0.bb b/meta-openpower/recipes-phosphor/network/first-boot-set-mac_1.0.bb index 0fd040d41..1a1ee97dc 100644 --- a/meta-openpower/recipes-phosphor/network/first-boot-set-mac_1.0.bb +++ b/meta-openpower/recipes-phosphor/network/first-boot-set-mac_1.0.bb @@ -10,11 +10,11 @@ RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_base-utils}" SYSTEMD_SERVICE_${PN} = "first-boot-set-mac@.service" -SRC_URI = "file://${PN}.sh file://${PN}@.service" +SRC_URI = "file://${BPN}.sh file://${BPN}@.service" S = "${WORKDIR}" do_install() { install -d ${D}${bindir} ${D}${systemd_system_unitdir} - install ${PN}.sh ${D}${bindir}/ - install -m 644 ${PN}@.service ${D}${systemd_system_unitdir}/ + install ${BPN}.sh ${D}${bindir}/ + install -m 644 ${BPN}@.service ${D}${systemd_system_unitdir}/ } |