Hi all,

I've been struggling with this for a while now, and can't seem to find the
proper way, so I hope someone has some hints for me.

I have one package in which a parameterised systemd unit file is added.
This package does not add the actual service, only the [email protected]
file.

The recipe looks like:

SRC_URI += " \
    file://[email protected] \
 "

inherit systemd

do_install() {
    install -D -m0644 ${WORKDIR}/[email protected]
${D}${systemd_system_unitdir}/[email protected]
}

SYSTEMD_SERVICE:${PN} = "[email protected]"

FILES:${PN} += "${systemd_system_unitdir}/[email protected]"

Since this recipe does not create any actual service, I doubt the systemd
and service creation is actually needed here.

In 2 different packages I want to add an actual service using this unit
file, those recipes look like:

inherit systemd

RDEPENDS:${PN} += "myservice"
SYSTEMD_PACKAGES = "myservice"
SYSTEMD_SERVICE:${PN} = "[email protected]"

However, the [email protected] does not exist/is not created.

I am not certain if I use SYSTEMD_PACKAGES correctly here and if the
RDEPENDS is the correct way to add myservice to the dependant packages.

Using a bbappend on myservice does work, however then I end up with both
services in all images where myservice is added. Which is not what I want,
different services end up in different images.

Image A: IMAGE_INSTALL += myservice actualservice1
Image B: IMAGE_INSTALL += myservice actualservice2

I've thought about 2 workarounds:
1) Create the symbolic link myself, which does feel like a hack
2) Create a custom systemd preset file myself, which should trigger
enabling of the service during the first boot

However, reading the documentation of SYSTEMD_PACKAGES, I hoped/expected
the above recipe would actually work.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#59504): https://lists.yoctoproject.org/g/yocto/message/59504
Mute This Topic: https://lists.yoctoproject.org/mt/97819001/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to