All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Weihmann <kweihmann@outlook.com>
To: davis roman <davis.roman84@gmail.com>, yocto@lists.yoctoproject.org
Cc: song li <ghosty.lee.1984@gmail.com>
Subject: Re: [yocto] Installing specific systemd service file according to selected distro
Date: Fri, 14 Jan 2022 09:19:47 +0100	[thread overview]
Message-ID: <AM9PR09MB4642E272DD067D2848570553A8549@AM9PR09MB4642.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <CACfi_Z30SFKp0Wb7XQJn-g7=-bZstcjuBoTi9RauWadLHR26CQ@mail.gmail.com>

Fairly easy, each distro creates an OVERRIDE by default, so you could do

A:poky = "foo.service"
A:yourdistro = "bar.service"

SYSTEMD_PACKAGES = "${A}"

do_install:append() {
	install -d ${D}${systemd_system_unitdir}
	install -m 0644 ${WORKDIR}/${A} ${D}${systemd_system_unitdir}
}

you could also try to create distro-specific do_install appends like

do_install:append:<yourdistro> if you need to do further step besides 
installing

On 14.01.22 06:54, davis roman wrote:
> Hello,
> 
> I have a recipe that contains two service files( A and B) and I build
> for two distros where each include the foo recipe.
> 
> When I build for distro A, I need to use foo's service file A but when
> I build distro B, I need to use foo's service file B.
> 
> I could add some logic in the foo recipe to detect the DISTRO and
> install the proper service file but I have a feeling this isn't the
> yocto way.
> 
> Is there a better way of handling this use case?
> 
> Thank you,
> 
> Davis
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#55850): https://lists.yoctoproject.org/g/yocto/message/55850
> Mute This Topic: https://lists.yoctoproject.org/mt/88415464/3647476
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [kweihmann@outlook.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


      reply	other threads:[~2022-01-14  8:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14  5:54 Installing specific systemd service file according to selected distro Davis Roman
2022-01-14  8:19 ` Konrad Weihmann [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=AM9PR09MB4642E272DD067D2848570553A8549@AM9PR09MB4642.eurprd09.prod.outlook.com \
    --to=kweihmann@outlook.com \
    --cc=davis.roman84@gmail.com \
    --cc=ghosty.lee.1984@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.