diff options
author | Andrew Geissler <geissonator@yahoo.com> | 2023-06-27 20:53:38 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2023-07-05 18:39:43 +0300 |
commit | 0bfc05be2d1fe89d2967b8939c2ff50d399236fe (patch) | |
tree | fd8b1647776c139f406594e61a4e59bc51266d20 /meta-phosphor/recipes-x86 | |
parent | 82f989c067b016646a5d7feecf6bc4b145344548 (diff) | |
download | openbmc-0bfc05be2d1fe89d2967b8939c2ff50d399236fe.tar.xz |
x86-power-control: install templated service correctly
The latest yocto update is flagging an error on machines using this
recipe. The reason appears to be because the templated services are
added to the SYSTEMD_SERVICE variable but they are not properly
installed into the filesystem.
Install the templated service file utilizing a more direct and tested
method.
Tested:
- Confirmed service file installed in rootfs as expected
```
/rootfs/usr/lib/systemd/system/sysinit.target.wants/xyz.openbmc_project.Chassis.Control.Power@0.service
```
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Ic0b375f31a0b92314618f978871c971caab041b4
Diffstat (limited to 'meta-phosphor/recipes-x86')
-rwxr-xr-x | meta-phosphor/recipes-x86/chassis/x86-power-control_git.bb | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/meta-phosphor/recipes-x86/chassis/x86-power-control_git.bb b/meta-phosphor/recipes-x86/chassis/x86-power-control_git.bb index 897c3a72f5..553a96b2d4 100755 --- a/meta-phosphor/recipes-x86/chassis/x86-power-control_git.bb +++ b/meta-phosphor/recipes-x86/chassis/x86-power-control_git.bb @@ -12,12 +12,6 @@ S = "${WORKDIR}/git" inherit meson systemd pkgconfig inherit obmc-phosphor-dbus-service -def get_service(d): - if(d.getVar('OBMC_HOST_INSTANCES') == '0'): - return "xyz.openbmc_project.Chassis.Control.Power@0.service" - else: - return " ".join(["xyz.openbmc_project.Chassis.Control.Power@{}.service".format(x) for x in d.getVar('OBMC_HOST_INSTANCES').split()]) -SYSTEMD_SERVICE:${PN} = "${@get_service(d)}" SYSTEMD_SERVICE:${PN} += "chassis-system-reset.service \ chassis-system-reset.target" DEPENDS += " \ @@ -29,3 +23,21 @@ DEPENDS += " \ phosphor-logging \ " FILES:${PN} += "${systemd_system_unitdir}/xyz.openbmc_project.Chassis.Control.Power@.service" + +pkg_postinst:${PN}:append() { + mkdir -p $D$systemd_system_unitdir/sysinit.target.wants + for i in ${OBMC_HOST_INSTANCES}; + do + LINK="$D$systemd_system_unitdir/sysinit.target.wants/xyz.openbmc_project.Chassis.Control.Power@${i}.service" + TARGET="../xyz.openbmc_project.Chassis.Control.Power@.service" + ln -s $TARGET $LINK + done +} + +pkg_prerm:${PN}:append() { + for i in ${OBMC_HOST_INSTANCES}; + do + LINK="$D$systemd_system_unitdir/sysinit.target.requires/xyz.openbmc_project.Chassis.Control.Power@${i}.service" + rm $LINK + done +} |