I am new to yocto and I am using systemd as the init manager. I'd like to start
a service (initializing CAN interface) at boot time. The service is a template
and its name is [email protected]:
[Unit]
Description=CAN Interface %I
Before=multi-user.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/sbin/ip link set %I type can bitrate 250000
ExecStart=/sbin/ip link set %I up
ExecStop=/sbin/ip link set %I down
[Install]
WantedBy=multi-user.target
I wrote a recipe can-systemd.bb in order to install the service mentioned above:
SUMMARY = "Configuration file to set up CAN interface"
DESCRIPTION = "Used to setup the CAN interface"
LICENSE = "MIT"
LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit systemd
SYSTEMD_SERVICE_${PN} = " \
[email protected] \
"
SRC_URI_append = " \
file://[email protected] \
"
FILES_${PN} += " \
${sysconfdir}/systemd/system/[email protected] \
"
do_install_append() {
install -d ${D}${sysconfdir}/systemd/system
install -m 0644 ${WORKDIR}/[email protected] ${D}${sysconfdir}/systemd/system
}
When I run bitbake to create the image, I would expect that a symlink
([email protected] -> /etc/systemd/system/[email protected]) in the folder
/etc/systemd/system/multi-user.target.wants should be generated. But this is
not the case.
I think, the SYSTEMD_SERVICE_${PN}... assignment should create that link. Is
this correct, or does anyone could show me how to start an instance of the
template of this service.
Thanks for your support.
Rob
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to which they are addressed. If
you have received this email in error please notify the system manager. This
message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#49659): https://lists.yoctoproject.org/g/yocto/message/49659
Mute This Topic: https://lists.yoctoproject.org/mt/74933670/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-