All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sean McKay" <sean.mckay@hpe.com>
To: Paul Wicks <pwicks86@gmail.com>,
	"yocto@lists.yoctoproject.org" <yocto@lists.yoctoproject.org>
Subject: Re: [yocto] Install systemd unit file into image from source?
Date: Tue, 9 Feb 2021 04:27:20 +0000	[thread overview]
Message-ID: <TU4PR8401MB115129566A42CFB31AAA2700828E9@TU4PR8401MB1151.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAOC70tueSmmwFXr6p3Y4oqqNUH7cDMHWj0QiHdjbPqhpOcK3LA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1795 bytes --]

SYSTEMD_SERVICE_${PN} should just be set to the service name, not the full path. So…
SYSTEMD_SERVICE_${PN} = "testapp-extra@.service"

Also, consider using ${systemd_system_unitdir} instead of ${systemd_unitdir}/system

Cheers!
-Sean McKay

From: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org> On Behalf Of Paul Wicks
Sent: Monday, February 8, 2021 5:44 PM
To: yocto@lists.yoctoproject.org
Subject: [yocto] Install systemd unit file into image from source?

I've got an application that I'd like to install into my custom image and that application has a couple of associated systemd unit files that should be installed as well. The application itself is a very simple cmake project. The relevant bits of the recipe file look something like this:
```
<standard variables go here>

SRC_URI = "<git address goes here>"

S = "${WORKDIR}/git"

inherit systemd
SYSTEMD_AUTO_ENABLE = "enable"
# the service files are stored in the git repository in the misc folder
SYSTEMD_SERVICE_${PN} = "${S}/misc/testapp@.service ${S}/misc/testapp-extra@.service<mailto:$%7bS%7d/misc/testapp@.service%20$%7bS%7d/misc/testapp-extra@.service>"

do_install_append() {
    install -d ${D}${systemd_unitdir}/system
    install -m 0644 ${S}/misc/testapp@.service<mailto:$%7bS%7d/misc/testapp@.service> ${D}${systemd_unitdir}/system/
    install -m 0644 ${S}/misc/testapp-extra@.service<mailto:$%7bS%7d/misc/testapp-extra@.service> ${D}${systemd_unitdir}/system/
}

inherit cmake
```

When i try to do do `bitbake testapp` to try out the recipe, I get an error telling me that: SYSTEMD_SERVICE_testapp value /projects/poky/build/tmp/work/core2-64-poky-linux/testapp/0.1-r0/git/misc/testapp@.service does not exist.

I'm using yocto 3.2.1 if that matters.
-Paul Wicks

[-- Attachment #2: Type: text/html, Size: 4404 bytes --]

      reply	other threads:[~2021-02-09  4:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09  1:44 Install systemd unit file into image from source? pwicks86
2021-02-09  4:27 ` Sean McKay [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=TU4PR8401MB115129566A42CFB31AAA2700828E9@TU4PR8401MB1151.NAMPRD84.PROD.OUTLOOK.COM \
    --to=sean.mckay@hpe.com \
    --cc=pwicks86@gmail.com \
    --cc=yocto@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.