From 8d82c259ef4e520823eb24e7f5278edce4ab3638 Mon Sep 17 00:00:00 2001 From: Charles Boyer Date: Wed, 20 Apr 2022 13:16:54 -0500 Subject: meta-fii: meta-kudo: Adopt multi-host support and host GPIO Use GPIO instead of IPMI for host condition. Adopt the multi-host support and syntax for phosphor-state-manager services. Signed-off-by: Charles Boyer Change-Id: I58ff4291ce3ec055579df5a2463c178e53d93625 --- .../xyz.openbmc_project.State.Chassis.service | 18 ----------- .../xyz.openbmc_project.State.Chassis@.service | 19 ++++++++++++ .../xyz.openbmc_project.State.Host.service | 16 ---------- .../xyz.openbmc_project.State.Host@.service | 19 ++++++++++++ .../state/phosphor-state-manager_%.bbappend | 35 +++++++++++++++------- 5 files changed, 62 insertions(+), 45 deletions(-) delete mode 100644 meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Chassis.service create mode 100644 meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Chassis@.service delete mode 100644 meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Host.service create mode 100644 meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Host@.service (limited to 'meta-fii') diff --git a/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Chassis.service b/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Chassis.service deleted file mode 100644 index d8df56164a..0000000000 --- a/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Chassis.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=Phosphor Chassis State Manager -Before=mapper-wait@-xyz-openbmc_project-state-chassis.service -Wants=obmc-mapper.target -After=obmc-mapper.target -After=org.openbmc.control.Power@0.service -After=host-powerctrl.service - -[Service] -ExecStartPre=/bin/sleep 5 -ExecStart=/usr/bin/phosphor-chassis-state-manager -Restart=always -Type=dbus -BusName=xyz.openbmc_project.State.Chassis - -[Install] -WantedBy=multi-user.target - diff --git a/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Chassis@.service b/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Chassis@.service new file mode 100644 index 0000000000..7868113954 --- /dev/null +++ b/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Chassis@.service @@ -0,0 +1,19 @@ +[Unit] +Description=Phosphor Chassis%i State Manager +Before=mapper-wait@-xyz-openbmc_project-state-chassis%i.service +Wants=obmc-mapper.target +After=obmc-mapper.target +After=org.openbmc.control.Power@%i.service +Wants=xyz.openbmc_project.Logging.service +After=xyz.openbmc_project.Logging.service +After=host-powerctrl.service + +[Service] +ExecStartPre=/bin/sleep 5 +ExecStart=/usr/bin/phosphor-chassis-state-manager --chassis %i +Restart=always +Type=dbus +BusName=xyz.openbmc_project.State.Chassis%i + +[Install] +WantedBy=multi-user.target diff --git a/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Host.service b/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Host.service deleted file mode 100644 index 3455aeea2e..0000000000 --- a/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Host.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Phosphor Host State Manager -Wants=mapper-wait@-xyz-openbmc_project-control-host0-auto_reboot.service -After=mapper-wait@-xyz-openbmc_project-control-host0-auto_reboot.service -Before=mapper-wait@-xyz-openbmc_project-state-host.service -Wants=obmc-mapper.target -After=obmc-mapper.target - -[Service] -ExecStart=/usr/bin/phosphor-host-state-manager -Restart=always -Type=dbus -BusName=xyz.openbmc_project.State.Host - -[Install] -WantedBy=multi-user.target diff --git a/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Host@.service b/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Host@.service new file mode 100644 index 0000000000..c1a233023e --- /dev/null +++ b/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager/xyz.openbmc_project.State.Host@.service @@ -0,0 +1,19 @@ +[Unit] +Description=Phosphor Host%i State Manager +Wants=mapper-wait@-xyz-openbmc_project-control-host%i-auto_reboot.service +After=mapper-wait@-xyz-openbmc_project-control-host%i-auto_reboot.service +Wants=mapper-wait@-xyz-openbmc_project-state-chassis%i.service +After=mapper-wait@-xyz-openbmc_project-state-chassis%i.service +Wants=obmc-mapper.target +After=obmc-mapper.target +After=phosphor-ipmi-host.service +Before=obmc-host-reset@%i.target + +[Service] +ExecStart=/usr/bin/phosphor-host-state-manager --host %i +Restart=always +Type=dbus +BusName=xyz.openbmc_project.State.Host%i + +[Install] +WantedBy=multi-user.target diff --git a/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager_%.bbappend b/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager_%.bbappend index 44f37f3e31..31727fe6ba 100644 --- a/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager_%.bbappend +++ b/meta-fii/meta-kudo/recipes-phosphor/state/phosphor-state-manager_%.bbappend @@ -1,11 +1,22 @@ FILESEXTRAPATHS:prepend:kudo := "${THISDIR}/${PN}:" +DEPENDS:append:kudo = " gpioplus" + +STATE_MGR_PACKAGES:remove:kudo = " ${PN}-host-check" +RRECOMMENDS:${PN}-host:remove:kudo = " ${PN}-host-check" +EXTRA_OEMESON:append:kudo = " -Dhost-gpios=enabled" CHASSIS_ACTION_TARGETS:append:kudo = " powercycle" -STATE_MGR_PACKAGES:remove:kudo = " ${PN}-host-check ${PN}-reset-sensor-states ${PN}-chassis-check-power-status" -SYSTEMD_PACKAGES:remove:kudo = " ${PN}-reset-sensor-states" -DBUS_SERVICE:${PN}-bmc:remove:kudo = " obmc-bmc-service-quiesce@.target" -RRECOMMENDS:${PN}-host:remove:kudo = " ${PN}-host-check ${PN}-reset-sensor-states" +FILES:${PN}:append:kudo = " ${systemd_system_unitdir}/*" +FILES:${PN}-host:append:kudo = " ${bindir}/phosphor-host-condition-gpio" +SYSTEMD_SERVICE:${PN}-host:append:kudo = " phosphor-host-condition-gpio@.service" + +pkg_postinst:${PN}-obmc-targets:prepend:kudo() { + mkdir -p $D$systemd_system_unitdir/multi-user.target.requires + LINK="$D$systemd_system_unitdir/multi-user.target.requires/phosphor-host-condition-gpio@0.service" + TARGET="../phosphor-host-condition-gpio@.service" + ln -s $TARGET $LINK +} pkg_postinst:${PN}-obmc-targets:append:kudo() { rm "$D$systemd_system_unitdir/obmc-host-shutdown@0.target.requires/obmc-chassis-poweroff@0.target" @@ -20,21 +31,23 @@ pkg_postinst:${PN}-obmc-targets:append:kudo() { rm "$D$systemd_system_unitdir/obmc-host-force-warm-reboot@0.target.requires/phosphor-reboot-host@0.service" rm "$D$systemd_system_unitdir/obmc-host-reset@0.target.requires/phosphor-reset-host-running@0.service" - rm "$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/phosphor-reset-sensor-states@0.service" - rm "$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/phosphor-reset-sensor-states@0.service" +} + +pkg_prerm:${PN}-obmc-targets:prepend:kudo() { + LINK="$D$systemd_system_unitdir/multi-user.target.requires/phosphor-host-condition-gpio@0.service" + rm $LINK } SRC_URI:append:kudo = " \ - file://xyz.openbmc_project.State.Chassis.service \ - file://xyz.openbmc_project.State.Host.service \ + file://xyz.openbmc_project.State.Chassis@.service \ + file://xyz.openbmc_project.State.Host@.service \ " do_install:append:kudo() { install -d ${D}${systemd_system_unitdir} - install -m 0644 ${WORKDIR}/xyz.openbmc_project.State.Chassis.service ${D}${systemd_system_unitdir}/xyz.openbmc_project.State.Chassis.service - install -m 0644 ${WORKDIR}/xyz.openbmc_project.State.Host.service ${D}${systemd_system_unitdir}/xyz.openbmc_project.State.Host.service + install -m 0644 ${WORKDIR}/xyz.openbmc_project.State.Chassis@.service ${D}${systemd_system_unitdir}/xyz.openbmc_project.State.Chassis@.service + install -m 0644 ${WORKDIR}/xyz.openbmc_project.State.Host@.service ${D}${systemd_system_unitdir}/xyz.openbmc_project.State.Host@.service rm -f ${D}${systemd_system_unitdir}/phosphor-reset-host-check@.service - rm -f ${D}${systemd_system_unitdir}/phosphor-reset-sensor-states@.service rm -f ${D}${systemd_system_unitdir}/phosphor-reset-host-running@.service } -- cgit v1.2.3