All of lore.kernel.org
 help / color / mirror / Atom feed
* Overwrite a bblcass globally
@ 2020-05-26 14:36 Ayoub Zaki
  2020-05-26 14:42 ` [yocto] " Quentin Schulz
  2020-05-26 14:45 ` Robert P. J. Day
  0 siblings, 2 replies; 4+ messages in thread
From: Ayoub Zaki @ 2020-05-26 14:36 UTC (permalink / raw)
  To: Yocto Project

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

Hi,

I would like to make changes on systemd.bblcass in my layer.

I can create new one e.g my-systemd.bbclass to overwrite the default one
but this will not work since I want that ALL recipes in all layers I'm
using to make usage of it.

are there ways to achieve this?


Thank you !


Cheers

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

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

* Re: [yocto] Overwrite a bblcass globally
  2020-05-26 14:36 Overwrite a bblcass globally Ayoub Zaki
@ 2020-05-26 14:42 ` Quentin Schulz
  2020-05-26 15:08   ` Ayoub Zaki
  2020-05-26 14:45 ` Robert P. J. Day
  1 sibling, 1 reply; 4+ messages in thread
From: Quentin Schulz @ 2020-05-26 14:42 UTC (permalink / raw)
  To: ayoub.zaki; +Cc: Yocto Project

Hi Ayoub,

On Tue, May 26, 2020 at 04:36:13PM +0200, Ayoub Zaki via lists.yoctoproject.org wrote:
> Hi,
> 
> I would like to make changes on systemd.bblcass in my layer.
> 
> I can create new one e.g my-systemd.bbclass to overwrite the default one
> but this will not work since I want that ALL recipes in all layers I'm
> using to make usage of it.
> 
> are there ways to achieve this?
> 

BBPATH[1] is what's used to locate bbclasses. It's defined in your
conf/layer.conf.

You can either make sure your layer is parsed before the one having the
original systemd.bbclass (in BBLAYERS of conf/bblayers.conf) or prepend
to BBPATH instead of appending.

Although... It's usually bad practice because it means that if I were to use
two layers doing the same thing (overriding the same bbclass), the behavior
is kind of undefined depending on which order they are parsed.

Ideally, you should contribute back the modifications to upstream
systemd.bbclass, that way, no need to duplicate it and override it from
somewhere else.

[1] https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-BBPATH

Cheers,
Quentin

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

* Re: [yocto] Overwrite a bblcass globally
  2020-05-26 14:36 Overwrite a bblcass globally Ayoub Zaki
  2020-05-26 14:42 ` [yocto] " Quentin Schulz
@ 2020-05-26 14:45 ` Robert P. J. Day
  1 sibling, 0 replies; 4+ messages in thread
From: Robert P. J. Day @ 2020-05-26 14:45 UTC (permalink / raw)
  To: ayoub.zaki; +Cc: Yocto Project

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

On Tue, 26 May 2020, Ayoub Zaki via lists.yoctoproject.org wrote:

> Hi,

> I would like to make changes on systemd.bblcass in my layer. 
>
> I can create new one e.g my-systemd.bbclass to overwrite the default
> one but this will not work since I want that ALL recipes in all
> layers I'm using to make usage of it.
>
> are there ways to achieve this?

  aside from whether there is a good way to do this, this seems to be
a really bad idea since recipes that inherit what they *think* is the
systemd class file will be getting something different; that's just
inviting all sorts of unintended bugs.

rday

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

* Re: [yocto] Overwrite a bblcass globally
  2020-05-26 14:42 ` [yocto] " Quentin Schulz
@ 2020-05-26 15:08   ` Ayoub Zaki
  0 siblings, 0 replies; 4+ messages in thread
From: Ayoub Zaki @ 2020-05-26 15:08 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: Yocto Project

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

Thanks for the idea of using BBPATH.

my change is kind of custom and I don't think someone else will make use of
it.


Cheers

On Tue, May 26, 2020 at 4:42 PM Quentin Schulz <
quentin.schulz@streamunlimited.com> wrote:

> Hi Ayoub,
>
> On Tue, May 26, 2020 at 04:36:13PM +0200, Ayoub Zaki via
> lists.yoctoproject.org wrote:
> > Hi,
> >
> > I would like to make changes on systemd.bblcass in my layer.
> >
> > I can create new one e.g my-systemd.bbclass to overwrite the default one
> > but this will not work since I want that ALL recipes in all layers I'm
> > using to make usage of it.
> >
> > are there ways to achieve this?
> >
>
> BBPATH[1] is what's used to locate bbclasses. It's defined in your
> conf/layer.conf.
>
> You can either make sure your layer is parsed before the one having the
> original systemd.bbclass (in BBLAYERS of conf/bblayers.conf) or prepend
> to BBPATH instead of appending.
>
> Although... It's usually bad practice because it means that if I were to
> use
> two layers doing the same thing (overriding the same bbclass), the behavior
> is kind of undefined depending on which order they are parsed.
>
> Ideally, you should contribute back the modifications to upstream
> systemd.bbclass, that way, no need to duplicate it and override it from
> somewhere else.
>
> [1]
> https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-BBPATH
>
> Cheers,
> Quentin
>

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

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

end of thread, other threads:[~2020-05-26 15:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 14:36 Overwrite a bblcass globally Ayoub Zaki
2020-05-26 14:42 ` [yocto] " Quentin Schulz
2020-05-26 15:08   ` Ayoub Zaki
2020-05-26 14:45 ` Robert P. J. Day

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.