summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-phosphor/state
diff options
context:
space:
mode:
authorAndrew Geissler <geissonator@yahoo.com>2023-06-27 19:10:18 +0300
committerPatrick Williams <patrick@stwcx.xyz>2023-07-05 18:39:43 +0300
commit82f989c067b016646a5d7feecf6bc4b145344548 (patch)
tree5905597cb0906ce0846223420a4f99bef0bfd97a /meta-phosphor/recipes-phosphor/state
parent55340ebf5586d8aeb37d02d4c99f31ecbc85749b (diff)
downloadopenbmc-82f989c067b016646a5d7feecf6bc4b145344548.tar.xz
phosphor-post-code-manager: 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/multi-user.target.wants/xyz.openbmc_project.State.Boot.PostCode@0.service ``` Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Change-Id: I3bdd15b3960a910ccc4b9bcd0e03df1613687ba1
Diffstat (limited to 'meta-phosphor/recipes-phosphor/state')
-rw-r--r--meta-phosphor/recipes-phosphor/state/phosphor-post-code-manager_git.bb23
1 files changed, 19 insertions, 4 deletions
diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-post-code-manager_git.bb b/meta-phosphor/recipes-phosphor/state/phosphor-post-code-manager_git.bb
index b0e11b461e..1ed15982aa 100644
--- a/meta-phosphor/recipes-phosphor/state/phosphor-post-code-manager_git.bb
+++ b/meta-phosphor/recipes-phosphor/state/phosphor-post-code-manager_git.bb
@@ -13,10 +13,6 @@ S = "${WORKDIR}/git"
inherit meson pkgconfig systemd
-def get_service(d):
- return " ".join(["xyz.openbmc_project.State.Boot.PostCode@{}.service".format(x) for x in d.getVar('OBMC_HOST_INSTANCES').split()])
-
-SYSTEMD_SERVICE:${PN} = "${@get_service(d)}"
DEPENDS += " \
sdbusplus \
phosphor-dbus-interfaces \
@@ -25,3 +21,22 @@ DEPENDS += " \
"
FILES:${PN} += "${systemd_system_unitdir}/xyz.openbmc_project.State.Boot.PostCode@.service"
FILES:${PN} += "${systemd_system_unitdir}/xyz.openbmc_project.State.Boot.PostCode.service"
+
+pkg_postinst:${PN}:append() {
+ mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
+ for i in ${OBMC_HOST_INSTANCES};
+ do
+ LINK="$D$systemd_system_unitdir/multi-user.target.wants/xyz.openbmc_project.State.Boot.PostCode@${i}.service"
+ TARGET="..//xyz.openbmc_project.State.Boot.PostCode@.service"
+ ln -s $TARGET $LINK
+ done
+}
+
+pkg_prerm:${PN}:append() {
+ for i in ${OBMC_HOST_INSTANCES};
+ do
+ LINK="$D$systemd_system_unitdir/multi-user.target.wants/xyz.openbmc_project.State.Boot.PostCode@${i}.service"
+ rm $LINK
+ done
+}
+