diff options
Diffstat (limited to 'meta-yadro/meta-nicole/recipes-phosphor')
4 files changed, 46 insertions, 0 deletions
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend new file mode 100644 index 0000000000..466f42f0bd --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend @@ -0,0 +1,21 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +inherit systemd + +RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_base-utils}" +SYSTEMD_SERVICE_${PN} = "${BPN}.service" +SRC_URI_append = " \ + file://${BPN}-set-device-id.sh \ + file://${BPN}.service \ +" + +S = "${WORKDIR}" +do_install_append() { + install -d ${D}${bindir} ${D}${systemd_system_unitdir} + install ${BPN}-set-device-id.sh ${D}${bindir}/ + install -m 0644 ${BPN}.service ${D}${systemd_system_unitdir}/ +} + +FILES_${PN}_append = " \ + ${bindir}/${BPN}-set-device-id.sh \ +" diff --git a/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json b/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json new file mode 100644 index 0000000000..fe51aa61b0 --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json @@ -0,0 +1,8 @@ +{ + "id": 0, + "revision": 1, + "addn_dev_support": 0, + "manuf_id": 49769, + "prod_id": 1, + "aux": 0 +} diff --git a/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/phosphor-ipmi-config-set-device-id.sh b/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/phosphor-ipmi-config-set-device-id.sh new file mode 100755 index 0000000000..6600ced4a4 --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/phosphor-ipmi-config-set-device-id.sh @@ -0,0 +1,5 @@ +#!/bin/sh -eu + +BMCPOS=$(awk -v RS=" " '/^bmcposition=/{print substr($0,13)}' /proc/cmdline) +sed -r "s/\"id\"\s*:\s*[0-9]+\s*,/\"id\": ${BMCPOS:-0},/" -i \ + /usr/share/ipmi-providers/dev_id.json diff --git a/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/phosphor-ipmi-config.service b/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/phosphor-ipmi-config.service new file mode 100644 index 0000000000..6471380549 --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/ipmi/phosphor-ipmi-config/phosphor-ipmi-config.service @@ -0,0 +1,12 @@ +[Unit] +Description=Set DeviceID for ipmi-host +Before=phosphor-ipmi-host.service + +[Service] +Type=oneshot +TimeoutSec=0 +RemainAfterExit=yes +ExecStart=/usr/bin/env phosphor-ipmi-config-set-device-id.sh + +[Install] +RequiredBy=phosphor-ipmi-host.service |