3

In a bitbake recipe, I'm trying to install a service. To me it looks like Yocto is not picking it up. The following is what I have in the recipe:


SRC_URI = "file://dispatcherd.service \
           file://llc-check.sh \
           file://dispatcherd \
    "

<snip>

do_install(){
    # Install startup script
        install -d ${D}${systemd_system_unitdir}
        install -m 0644 ${WORKDIR}/dispatcherd.service ${D}${systemd_system_unitdir}
}

INITSCRIPT_NAME = "dispatcherd"
#INITSCRIPT_PARAMS = "defaults 90 10"

SYSTEMD_SERVICE_${PN} = "dispatcherd.service"
SYSTEMD_AUTO_ENABLE_${PN} = "disable"

inherit update-rc.d systemd

INSANE_SKIP_${PN} = "ldflags"

FILES_${PN} = "${libdir}/*  \
               ${bindir}/*  \
               ${sysconfdir}/init.d/dispatcherd \
              "

When trying to compile an image I get:

ERROR: Function failed: SYSTEMD_SERVICE_ecdsa value dispatcherd.service does not exist

When I do a file search, the service file appears here:

devon@VM ~/app/build/tmp-glibc $ find . -name "dispatcherd*.service"
./work/cortexa9hf-vfp-neon-phytec-linux-gnueabi/ecdsa/1.0.0-r0/dispatcherd.service
./work/cortexa9hf-vfp-neon-phytec-linux-gnueabi/ecdsa/1.0.0-r0/package/dispatcherd.service
./work/cortexa9hf-vfp-neon-phytec-linux-gnueabi/ecdsa/1.0.0-r0/image/dispatcherd.service

I've tried googling around for a solution but no luck so far. Any hints on what might be wrong or why Yocto can't seem to find the file?

Devon
  • 393
  • 2
  • 5
  • 17

1 Answers1

3

It appears that I am using an older version of yocto in my environment, had to use

install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/dispatcherd.service ${D}${systemd_unitdir}/system

As was suggested in Enable systemd services using yocto

Only reason I found that out was comparing the systemd.bbclass file in my repo to the most recent one in the yocto repo. Mine lacked the searchpath systemd_system_unitdir entry.

Devon
  • 393
  • 2
  • 5
  • 17