All of lore.kernel.org
 help / color / mirror / Atom feed
* How to iherit class based on a conditional variable? #sysvinit #systemd
@ 2021-10-25 12:38 Bel Hadj Salem Talel
  2021-10-25 14:04 ` [yocto] " Alexander Kanavin
  0 siblings, 1 reply; 2+ messages in thread
From: Bel Hadj Salem Talel @ 2021-10-25 12:38 UTC (permalink / raw)
  To: yocto

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

Hello,

I have a recipe that installs a simple bash script to run on startup.
As you all know, there is systemd and sysvinit.
I need to add support for both init managers.

I can do :
SRC_URI_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'file://script.service', 'file://script.sh', d)}"

and I can do the same in all the tasks.

The problem is, that I need to inherit either systemd or update-rc.d

Is it possible to inherit them all, or how can I inherit something conditionally ?

Thanks,
Talel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [yocto] How to iherit class based on a conditional variable? #sysvinit #systemd
  2021-10-25 12:38 How to iherit class based on a conditional variable? #sysvinit #systemd Bel Hadj Salem Talel
@ 2021-10-25 14:04 ` Alexander Kanavin
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Kanavin @ 2021-10-25 14:04 UTC (permalink / raw)
  To: Bel Hadj Salem Talel; +Cc: Yocto-mailing-list

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

It's fine to inherit both classes and install both files without even
checking DISTRO_FEATURES. There's behind the scenes magic that will do the
right thing depending on what init manager is chosen in the distro config.

Alex

On Mon, 25 Oct 2021 at 14:38, Bel Hadj Salem Talel <bhstalel@gmail.com>
wrote:

> Hello,
>
> I have a recipe that installs a simple bash script to run on startup.
> As you all know, there is systemd and sysvinit.
> I need to add support for both init managers.
>
> I can do :
> SRC_URI_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd',
> 'file://script.service', 'file://script.sh', d)}"
>
> and I can do the same in all the tasks.
>
> The problem is, that I need to inherit either systemd or update-rc.d
>
> Is it possible to inherit them all, or how can I inherit something
> conditionally ?
>
> Thanks,
> Talel
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#55135):
> https://lists.yoctoproject.org/g/yocto/message/55135
> Mute This Topic: https://lists.yoctoproject.org/mt/86575814/1686489
> Mute #sysvinit:https://lists.yoctoproject.org/g/yocto/mutehashtag/sysvinit
> Mute #systemd:https://lists.yoctoproject.org/g/yocto/mutehashtag/systemd
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-25 14:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 12:38 How to iherit class based on a conditional variable? #sysvinit #systemd Bel Hadj Salem Talel
2021-10-25 14:04 ` [yocto] " Alexander Kanavin

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.