All of lore.kernel.org
 help / color / mirror / Atom feed
* conditional inheriting classes does not work with bbappends
@ 2022-04-07 14:17 Christian Eggers
  2022-04-07 21:59 ` [bitbake-devel] " Christopher Larson
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Eggers @ 2022-04-07 14:17 UTC (permalink / raw)
  To: bitbake-devel


[-- Attachment #1.1: Type: text/plain, Size: 1860 bytes --]

Example: meta-openembedded/meta-networking/recipes-support/chrony/chrony_4.2.bb

--------------------------------8<--------------------------------
# Add chronyd user if privdrop packageconfig is selected
inherit ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'useradd', '', d)}
USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}"
USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /bin/nologin chronyd;', '', d)}"

...

PACKAGECONFIG ??= ...
-------------------------------->8--------------------------------


Problem #1: useradd is not inherited because PACKAGECONFIG is set below the conditional "inherit"
statement. Even when I add "privdrop" to PACKAGECONFIG here, useradd.bbclass is not inherited. I
must move the PACKAGECONFIG line above the inherit statement to make this work.

Problem #2: Due to problem #1, useradd.bbclass is also not inherited when I add "privdrop" to
PACKAGECONFIG in bbappend file (in a custom layer).

regards
Christian





_______________________________________________________
Christian
Eggers
Software Engineer
​
ARRI
Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Arriweg 17,
83071
Stephanskirchen
www.arri.com

+49 8036 3009-3118
CEggers@arri.de

​
Get all the latest information from www.arri.com, Facebook, Twitter, Instagram, LinkedIn and YouTube.

Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRA 57918
Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRB 54477
Geschäftsführer: Dr. Matthias Erb (Chairman); Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger

​

[-- Attachment #1.2: Type: text/html, Size: 10917 bytes --]

[-- Attachment #2: image372264.png --]
[-- Type: image/png, Size: 528 bytes --]

[-- Attachment #3: image543396.png --]
[-- Type: image/png, Size: 824 bytes --]

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

* Re: [bitbake-devel] conditional inheriting classes does not work with bbappends
  2022-04-07 14:17 conditional inheriting classes does not work with bbappends Christian Eggers
@ 2022-04-07 21:59 ` Christopher Larson
  2022-04-08 16:54   ` Christian Eggers
  2022-04-13 10:24   ` Jose Quaresma
  0 siblings, 2 replies; 8+ messages in thread
From: Christopher Larson @ 2022-04-07 21:59 UTC (permalink / raw)
  To: bitbake-devel, Christian Eggers

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

There’s no way to avoid that, inherit lines are evaluated *at the moment of inherit* on that line, they aren’t postponed.

--
Christopher Larson
chris_larson@mentor.com, chris.larson@siemens.com, kergoth@gmail.com
Principal Software Engineer, Embedded Linux Solutions, Siemens Digital Industries Software
On Apr 7, 2022, 7:17 AM -0700, Christian Eggers <ceggers@arri.de>, wrote:
> Example: meta-openembedded/meta-networking/recipes-support/chrony/chrony_4.2.bb
>
> --------------------------------8<--------------------------------
> # Add chronyd user if privdrop packageconfig is selected
> inherit ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'useradd', '', d)}
> USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}"
> USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /bin/nologin chronyd;', '', d)}"
>
> ...
>
> PACKAGECONFIG ??= ...
> -------------------------------->8--------------------------------
>
>
> Problem #1: useradd is not inherited because PACKAGECONFIG is set below the conditional "inherit"
> statement. Even when I add "privdrop" to PACKAGECONFIG here, useradd.bbclass is not inherited. I
> must move the PACKAGECONFIG line above the inherit statement to make this work.
>
> Problem #2: Due to problem #1, useradd.bbclass is also not inherited when I add "privdrop" to
> PACKAGECONFIG in bbappend file (in a custom layer).
>
> regards
> Christian
>
>
>
>
> _______________________________________________________
> Christian
> Eggers
> Software Engineer
>
> ARRI
> Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
> Arriweg 17 ,
> 83071
> Stephanskirchen
> www.arri.com
>
> +49 8036 3009-3118
> CEggers@arri.de
>
>
> Get all the latest information from www.arri.com, Facebook, Twitter, Instagram, LinkedIn and YouTube.
>
> Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
> Sitz: München ‑ Registergericht: Amtsgericht München ‑ Handelsregisternummer: HRA 57918
> Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
> Sitz: München ‑ Registergericht: Amtsgericht München ‑ Handelsregisternummer: HRB 54477
> Geschäftsführer: Dr. Matthias Erb (Chairman); Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#13594): https://lists.openembedded.org/g/bitbake-devel/message/13594
> Mute This Topic: https://lists.openembedded.org/mt/90313668/3617123
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [kergoth@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

[-- Attachment #2.1: Type: text/html, Size: 12635 bytes --]

[-- Attachment #2.2: image372264.png --]
[-- Type: image/png, Size: 528 bytes --]

[-- Attachment #2.3: image543396.png --]
[-- Type: image/png, Size: 824 bytes --]

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

* Re: [bitbake-devel] conditional inheriting classes does not work with bbappends
  2022-04-07 21:59 ` [bitbake-devel] " Christopher Larson
@ 2022-04-08 16:54   ` Christian Eggers
  2022-04-12 14:12     ` Peter Kjellerstedt
  2022-04-13 10:24   ` Jose Quaresma
  1 sibling, 1 reply; 8+ messages in thread
From: Christian Eggers @ 2022-04-08 16:54 UTC (permalink / raw)
  To: bitbake-devel, Christopher Larson


[-- Attachment #1.1: Type: text/plain, Size: 2668 bytes --]

On Thursday, 7 April 2022, 23:59:39 CEST, Christopher Larson wrote:
> There’s no way to avoid that, inherit lines are evaluated *at the moment of inherit* on that line, they aren’t postponed.

ok, this is what I would expect. So how to handle this:

- do not conditionally inherit in PACKAGECONFIG (may be impossible)?
- do not set PACKAGECONFIG in bbappend files (use distro/machine/layer/local config for this)?

regards
Christian


>
> --
> Christopher Larson
> chris_larson@mentor.com, chris.larson@siemens.com, kergoth@gmail.com
> Principal Software Engineer, Embedded Linux Solutions, Siemens Digital Industries Software

_______________________________________________________
Christian
Eggers
Software Engineer
​
ARRI
Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Arriweg 17,
83071
Stephanskirchen
www.arri.com

+49 8036 3009-3118
CEggers@arri.de

​
Get all the latest information from www.arri.com, Facebook, Twitter, Instagram, LinkedIn and YouTube.

Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRA 57918
Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRB 54477
Geschäftsführer: Dr. Matthias Erb (Chairman); Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger

​
> On Apr 7, 2022, 7:17 AM -0700, Christian Eggers <ceggers@arri.de>, wrote:
> > Example: meta-openembedded/meta-networking/recipes-support/chrony/chrony_4.2.bb
> >
> > --------------------------------8<--------------------------------
> > # Add chronyd user if privdrop packageconfig is selected
> > inherit ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'useradd', '', d)}
> > USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}"
> > USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /bin/nologin chronyd;', '', d)}"
> >
> > ...
> >
> > PACKAGECONFIG ??= ...
> > -------------------------------->8--------------------------------
> >
> >
> > Problem #1: useradd is not inherited because PACKAGECONFIG is set below the conditional "inherit"
> > statement. Even when I add "privdrop" to PACKAGECONFIG here, useradd.bbclass is not inherited. I
> > must move the PACKAGECONFIG line above the inherit statement to make this work.
> >
> > Problem #2: Due to problem #1, useradd.bbclass is also not inherited when I add "privdrop" to
> > PACKAGECONFIG in bbappend file (in a custom layer).
> >
> > regards
> > Christian




[-- Attachment #1.2: Type: text/html, Size: 11959 bytes --]

[-- Attachment #2: image232494.png --]
[-- Type: image/png, Size: 528 bytes --]

[-- Attachment #3: image127421.png --]
[-- Type: image/png, Size: 824 bytes --]

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

* RE: [bitbake-devel] conditional inheriting classes does not work with bbappends
  2022-04-08 16:54   ` Christian Eggers
@ 2022-04-12 14:12     ` Peter Kjellerstedt
  2022-04-13  6:03       ` Christian Eggers
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Kjellerstedt @ 2022-04-12 14:12 UTC (permalink / raw)
  To: Christian Eggers, bitbake-devel, Christopher Larson


[-- Attachment #1.1: Type: text/plain, Size: 4173 bytes --]

I don’t think there is a generic solution to this problem. What we do in the particular case is to enable the PACKAGECONFIG in a bbappend and then also add an extra inherit useradd to the bbappend file. Not perfect, but it works.

//Peter

From: bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org> On Behalf Of Christian Eggers
Sent: den 8 april 2022 18:54
To: bitbake-devel@lists.openembedded.org; Christopher Larson <kergoth@gmail.com>
Subject: Re: [bitbake-devel] conditional inheriting classes does not work with bbappends

On Thursday, 7 April 2022, 23:59:39 CEST, Christopher Larson wrote:
> There’s no way to avoid that, inherit lines are evaluated *at the moment of inherit* on that line, they aren’t postponed.

ok, this is what I would expect. So how to handle this:

- do not conditionally inherit in PACKAGECONFIG (may be impossible)?
- do not set PACKAGECONFIG in bbappend files (use distro/machine/layer/local config for this)?

regards
Christian


>
> --
> Christopher Larson
> chris_larson@mentor.com<mailto:chris_larson@mentor.com>, chris.larson@siemens.com<mailto:chris.larson@siemens.com>, kergoth@gmail.com<mailto:kergoth@gmail.com>
> Principal Software Engineer, Embedded Linux Solutions, Siemens Digital Industries Software
_______________________________________________________​

Christian



Eggers


Software Engineer

​



ARRI

Arnold & Richter Cine Technik GmbH & Co. Betriebs KG


Arriweg 17

,

83071



Stephanskirchen



www.arri.com

<http://www.arri.com/>

[cid:image001.png@01D84E88.2A146C90]

+49 8036 3009-3118<tel:+49%208036%203009-3118>



[cid:image002.png@01D84E88.2A146C90]

CEggers@arri.de<mailto:CEggers@arri.de>





​


[One modular system, two new stabilizers: ARTEMIS 2 & TRINITY 2]<https://www.arri.com/trinity2_artemis2>

Get all the latest information from www.arri.com<https://www.arri.com/>, Facebook<https://www.facebook.com/TeamARRI>, Twitter<https://twitter.com/ARRIChannel>, Instagram<https://www.instagram.com/arri/>, LinkedIn<https://www.linkedin.com/company/arri> and YouTube<https://www.youtube.com/user/ARRIChannel>.


Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: München ‑ Registergericht: Amtsgericht München ‑ Handelsregisternummer: HRA 57918
Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: München ‑ Registergericht: Amtsgericht München ‑ Handelsregisternummer: HRB 54477
Geschäftsführer: Dr. Matthias Erb (Chairman); Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger


​



> On Apr 7, 2022, 7:17 AM -0700, Christian Eggers <ceggers@arri.de<mailto:ceggers@arri.de>>, wrote:
> > Example: meta-openembedded/meta-networking/recipes-support/chrony/chrony_4.2.bb
> >
> > --------------------------------8<--------------------------------
> > # Add chronyd user if privdrop packageconfig is selected
> > inherit ${@bb.utils.contains('PACKAGECONFIG<mailto:$%7b@bb.utils.contains('PACKAGECONFIG>', 'privdrop', 'useradd', '', d)}
> > USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}<mailto:$%7b@bb.utils.contains('PACKAGECONFIG',%20'privdrop',%20'$%7bPN%7d',%20'',%20d)%7d>"
> > USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /bin/nologin chronyd;', '', d)}<mailto:$%7b@bb.utils.contains('PACKAGECONFIG',%20'privdrop',%20'--system%20-d%20/%20-M%20--shell%20/bin/nologin%20chronyd;',%20'',%20d)%7d>"
> >
> > ...
> >
> > PACKAGECONFIG ??= ...
> > -------------------------------->8--------------------------------
> >
> >
> > Problem #1: useradd is not inherited because PACKAGECONFIG is set below the conditional "inherit"
> > statement. Even when I add "privdrop" to PACKAGECONFIG here, useradd.bbclass is not inherited. I
> > must move the PACKAGECONFIG line above the inherit statement to make this work.
> >
> > Problem #2: Due to problem #1, useradd.bbclass is also not inherited when I add "privdrop" to
> > PACKAGECONFIG in bbappend file (in a custom layer).
> >
> > regards
> > Christian



[-- Attachment #1.2: Type: text/html, Size: 16827 bytes --]

[-- Attachment #2: image001.png --]
[-- Type: image/png, Size: 528 bytes --]

[-- Attachment #3: image002.png --]
[-- Type: image/png, Size: 824 bytes --]

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

* Re: [bitbake-devel] conditional inheriting classes does not work with bbappends
  2022-04-12 14:12     ` Peter Kjellerstedt
@ 2022-04-13  6:03       ` Christian Eggers
  0 siblings, 0 replies; 8+ messages in thread
From: Christian Eggers @ 2022-04-13  6:03 UTC (permalink / raw)
  To: bitbake-devel, Christopher Larson, Peter Kjellerstedt


[-- Attachment #1.1: Type: text/plain, Size: 4167 bytes --]

On Tuesday, 12 April 2022, 16:12:57 CEST, Peter Kjellerstedt wrote:
> I don’t think there is a generic solution to this problem. What we do in the particular case is to enable the PACKAGECONFIG in a bbappend and then also add an extra inherit useradd to the bbappend file. Not perfect, but it works.
>

I have also chosen this workaround. The problem is, that it does not work the other way around:

If the default value for PACKAGECONFIG causes conditionally inheriting specific classes,
these classes will also be inherited if PACKAGECONFIG is overwritten later in a bbappend.


> //Peter
>
>
_______________________________________________________
Christian
Eggers
Software Engineer
​
ARRI
Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Arriweg 17,
83071
Stephanskirchen
www.arri.com

+49 8036 3009-3118
CEggers@arri.de

​
Get all the latest information from www.arri.com, Facebook, Twitter, Instagram, LinkedIn and YouTube.

Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRA 57918
Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRB 54477
Geschäftsführer: Dr. Matthias Erb (Chairman); Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger

​
From: bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org> On Behalf Of Christian Eggers
> Sent: den 8 april 2022 18:54
> To: bitbake-devel@lists.openembedded.org; Christopher Larson <kergoth@gmail.com>
> Subject: Re: [bitbake-devel] conditional inheriting classes does not work with bbappends
>
> On Thursday, 7 April 2022, 23:59:39 CEST, Christopher Larson wrote:
> > There’s no way to avoid that, inherit lines are evaluated *at the moment of inherit* on that line, they aren’t postponed.
>
> ok, this is what I would expect. So how to handle this:
>
> - do not conditionally inherit in PACKAGECONFIG (may be impossible)?
> - do not set PACKAGECONFIG in bbappend files (use distro/machine/layer/local config for this)?
>
> regards
> Christian
>
>
> >
> > --
> > Christopher Larson
> > chris_larson@mentor.com<mailto:chris_larson@mentor.com>, chris.larson@siemens.com<mailto:chris.larson@siemens.com>, kergoth@gmail.com<mailto:kergoth@gmail.com>
> > Principal Software Engineer, Embedded Linux Solutions, Siemens Digital Industries Software
> _______________________________________________________​
>
>
>
> ​
>
>
>
> > On Apr 7, 2022, 7:17 AM -0700, Christian Eggers <ceggers@arri.de<mailto:ceggers@arri.de>>, wrote:
> > > Example: meta-openembedded/meta-networking/recipes-support/chrony/chrony_4.2.bb
> > >
> > > --------------------------------8<--------------------------------
> > > # Add chronyd user if privdrop packageconfig is selected
> > > inherit ${@bb.utils.contains('PACKAGECONFIG<mailto:$%7b@bb.utils.contains('PACKAGECONFIG>', 'privdrop', 'useradd', '', d)}
> > > USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}<mailto:$%7b@bb.utils.contains('PACKAGECONFIG',%20'privdrop',%20'$%7bPN%7d',%20'',%20d)%7d>"
> > > USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /bin/nologin chronyd;', '', d)}<mailto:$%7b@bb.utils.contains('PACKAGECONFIG',%20'privdrop',%20'--system%20-d%20/%20-M%20--shell%20/bin/nologin%20chronyd;',%20'',%20d)%7d>"
> > >
> > > ...
> > >
> > > PACKAGECONFIG ??= ...
> > > -------------------------------->8--------------------------------
> > >
> > >
> > > Problem #1: useradd is not inherited because PACKAGECONFIG is set below the conditional "inherit"
> > > statement. Even when I add "privdrop" to PACKAGECONFIG here, useradd.bbclass is not inherited. I
> > > must move the PACKAGECONFIG line above the inherit statement to make this work.
> > >
> > > Problem #2: Due to problem #1, useradd.bbclass is also not inherited when I add "privdrop" to
> > > PACKAGECONFIG in bbappend file (in a custom layer).
> > >
> > > regards
> > > Christian
>
>
>





[-- Attachment #1.2: Type: text/html, Size: 13896 bytes --]

[-- Attachment #2: image459447.png --]
[-- Type: image/png, Size: 528 bytes --]

[-- Attachment #3: image329235.png --]
[-- Type: image/png, Size: 824 bytes --]

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

* Re: [bitbake-devel] conditional inheriting classes does not work with bbappends
  2022-04-07 21:59 ` [bitbake-devel] " Christopher Larson
  2022-04-08 16:54   ` Christian Eggers
@ 2022-04-13 10:24   ` Jose Quaresma
  2022-04-13 10:35     ` Peter Kjellerstedt
  1 sibling, 1 reply; 8+ messages in thread
From: Jose Quaresma @ 2022-04-13 10:24 UTC (permalink / raw)
  To: Christopher Larson; +Cc: bitbake-devel, Christian Eggers


[-- Attachment #1.1: Type: text/plain, Size: 3803 bytes --]

Hi

Christopher Larson <kergoth@gmail.com> escreveu no dia quinta, 7/04/2022
à(s) 22:59:

> There’s no way to avoid that, inherit lines are evaluated *at the moment
> of inherit* on that line, they aren’t postponed.
>

Does the require have the same behaviour as the inherit? i.e: evaluated *at
the moment of inherit*
if not something like that can do the job:

cat <<'EOF' > my.bbappend
PACKAGECONFIG ?= "my-knob"
require ${@bb.utils.contains('PACKAGECONFIG', 'my-knob',
'my-conditional-inheriting.inc', '', d)}
EOF

cat <<'EOF' >my-conditional-inheriting.inc
inherit my.bbclass
EOF


Jose


>
> --
> Christopher Larson
> chris_larson@mentor.com, chris.larson@siemens.com, kergoth@gmail.com
> Principal Software Engineer, Embedded Linux Solutions, Siemens Digital
> Industries Software
> On Apr 7, 2022, 7:17 AM -0700, Christian Eggers <ceggers@arri.de>, wrote:
>
> Example: meta-openembedded/meta-networking/recipes-support/chrony/
> chrony_4.2.bb
>
> --------------------------------8<--------------------------------
> # Add chronyd user if privdrop packageconfig is selected
> inherit ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'useradd', '',
> d)}
> USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop',
> '${PN}', '', d)}"
> USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop',
> '--system -d / -M --shell /bin/nologin chronyd;', '', d)}"
>
> ...
>
> PACKAGECONFIG ??= ...
> -------------------------------->8--------------------------------
>
>
> Problem #1: useradd is not inherited because PACKAGECONFIG is set below
> the conditional "inherit"
> statement. Even when I add "privdrop" to PACKAGECONFIG here,
> useradd.bbclass is not inherited. I
> must move the PACKAGECONFIG line above the inherit statement to make this
> work.
>
> Problem #2: Due to problem #1, useradd.bbclass is also not inherited when
> I add "privdrop" to
> PACKAGECONFIG in bbappend file (in a custom layer).
>
> regards
> Christian
>
>
>
>
> _______________________________________________________
> Christian
> Eggers
> Software Engineer
> ARRI
> Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
> Arriweg 17 ,
> 83071
> Stephanskirchen
>
>
> *www.arri.com  * <http://www.arri.com/>
> *+49 8036 3009-3118* <+49%208036%203009-3118>
> *CEggers@arri.de* <CEggers@arri.de>
>
> [image: One modular system, two new stabilizers: ARTEMIS 2 & TRINITY 2]
> <https://www.arri.com/trinity2_artemis2>
> Get all the latest information from *www.arri.com* <https://www.arri.com/>
> , *Facebook* <https://www.facebook.com/TeamARRI>, *Twitter*
> <https://twitter.com/ARRIChannel>, *Instagram*
> <https://www.instagram.com/arri/>, *LinkedIn*
> <https://www.linkedin.com/company/arri> and *YouTube*
> <https://www.youtube.com/user/ARRIChannel>.
>
> Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
>
> Sitz: München ‑ Registergericht: Amtsgericht München ‑ Handelsregisternummer: HRA 57918
> Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
>
> Sitz: München ‑ Registergericht: Amtsgericht München ‑ Handelsregisternummer: HRB 54477
>
> Geschäftsführer: Dr. Matthias Erb (Chairman); Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger
>
>
>
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#13595):
> https://lists.openembedded.org/g/bitbake-devel/message/13595
> Mute This Topic: https://lists.openembedded.org/mt/90313668/5052612
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [
> quaresma.jose@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

-- 
Best regards,

José Quaresma

[-- Attachment #1.2: Type: text/html, Size: 14579 bytes --]

[-- Attachment #2: image372264.png --]
[-- Type: image/png, Size: 528 bytes --]

[-- Attachment #3: image543396.png --]
[-- Type: image/png, Size: 824 bytes --]

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

* RE: [bitbake-devel] conditional inheriting classes does not work with bbappends
  2022-04-13 10:24   ` Jose Quaresma
@ 2022-04-13 10:35     ` Peter Kjellerstedt
  2022-04-13 16:33       ` Diego Santa Cruz
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Kjellerstedt @ 2022-04-13 10:35 UTC (permalink / raw)
  To: Jose Quaresma, Christopher Larson; +Cc: bitbake-devel, Christian Eggers


[-- Attachment #1.1: Type: text/plain, Size: 4306 bytes --]

Yes, require is evaluated immediately, just like inherit, so unfortunately the suggested example below doesn’t solve the problem either.

//Peter

From: bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org> On Behalf Of Jose Quaresma
Sent: den 13 april 2022 12:25
To: Christopher Larson <kergoth@gmail.com>
Cc: bitbake-devel@lists.openembedded.org; Christian Eggers <ceggers@arri.de>
Subject: Re: [bitbake-devel] conditional inheriting classes does not work with bbappends

Hi

Christopher Larson <kergoth@gmail.com<mailto:kergoth@gmail.com>> escreveu no dia quinta, 7/04/2022 à(s) 22:59:
There’s no way to avoid that, inherit lines are evaluated *at the moment of inherit* on that line, they aren’t postponed.

Does the require have the same behaviour as the inherit? i.e: evaluated *at the moment of inherit*
if not something like that can do the job:

cat <<'EOF' > my.bbappend
PACKAGECONFIG ?= "my-knob"
require ${@bb.utils.contains('PACKAGECONFIG<mailto:$%7b@bb.utils.contains('PACKAGECONFIG>', 'my-knob', 'my-conditional-inheriting.inc', '', d)}
EOF

cat <<'EOF' >my-conditional-inheriting.inc
inherit my.bbclass
EOF


Jose


--
Christopher Larson
chris_larson@mentor.com<mailto:chris_larson@mentor.com>, chris.larson@siemens.com<mailto:chris.larson@siemens.com>, kergoth@gmail.com<mailto:kergoth@gmail.com>
Principal Software Engineer, Embedded Linux Solutions, Siemens Digital Industries Software
On Apr 7, 2022, 7:17 AM -0700, Christian Eggers <ceggers@arri.de<mailto:ceggers@arri.de>>, wrote:

Example: meta-openembedded/meta-networking/recipes-support/chrony/chrony_4.2.bb<http://chrony_4.2.bb>

--------------------------------8<--------------------------------
# Add chronyd user if privdrop packageconfig is selected
inherit ${@bb.utils.contains('PACKAGECONFIG<mailto:$%7b@bb.utils.contains('PACKAGECONFIG>', 'privdrop', 'useradd', '', d)}
USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}<mailto:$%7b@bb.utils.contains('PACKAGECONFIG',%20'privdrop',%20'$%7bPN%7d',%20'',%20d)%7d>"
USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /bin/nologin chronyd;', '', d)}<mailto:$%7b@bb.utils.contains('PACKAGECONFIG',%20'privdrop',%20'--system%20-d%20/%20-M%20--shell%20/bin/nologin%20chronyd;',%20'',%20d)%7d>"

...

PACKAGECONFIG ??= ...
-------------------------------->8--------------------------------


Problem #1: useradd is not inherited because PACKAGECONFIG is set below the conditional "inherit"
statement. Even when I add "privdrop" to PACKAGECONFIG here, useradd.bbclass is not inherited. I
must move the PACKAGECONFIG line above the inherit statement to make this work.

Problem #2: Due to problem #1, useradd.bbclass is also not inherited when I add "privdrop" to
PACKAGECONFIG in bbappend file (in a custom layer).

regards
Christian



_______________________________________________________

Christian



Eggers


Software Engineer




ARRI

Arnold & Richter Cine Technik GmbH & Co. Betriebs KG


Arriweg 17

,

83071



Stephanskirchen



www.arri.com

<http://www.arri.com/>

[cid:image001.png@01D84F32.F4FB5220]

+49 8036 3009-3118<tel:+49%208036%203009-3118>



[cid:image002.png@01D84F32.F4FB5220]

CEggers@arri.de<mailto:CEggers@arri.de>






[One modular system, two new stabilizers: ARTEMIS 2 & TRINITY 2]<https://www.arri.com/trinity2_artemis2>

Get all the latest information from www.arri.com<https://www.arri.com/>, Facebook<https://www.facebook.com/TeamARRI>, Twitter<https://twitter.com/ARRIChannel>, Instagram<https://www.instagram.com/arri/>, LinkedIn<https://www.linkedin.com/company/arri> and YouTube<https://www.youtube.com/user/ARRIChannel>.


Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: München ‑ Registergericht: Amtsgericht München ‑ Handelsregisternummer: HRA 57918
Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: München ‑ Registergericht: Amtsgericht München ‑ Handelsregisternummer: HRB 54477
Geschäftsführer: Dr. Matthias Erb (Chairman); Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger










--
Best regards,

José Quaresma

[-- Attachment #1.2: Type: text/html, Size: 18107 bytes --]

[-- Attachment #2: image001.png --]
[-- Type: image/png, Size: 528 bytes --]

[-- Attachment #3: image002.png --]
[-- Type: image/png, Size: 824 bytes --]

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

* RE: [bitbake-devel] conditional inheriting classes does not work with bbappends
  2022-04-13 10:35     ` Peter Kjellerstedt
@ 2022-04-13 16:33       ` Diego Santa Cruz
  0 siblings, 0 replies; 8+ messages in thread
From: Diego Santa Cruz @ 2022-04-13 16:33 UTC (permalink / raw)
  To: peter.kjellerstedt, Jose Quaresma, Christopher Larson
  Cc: bitbake-devel, Christian Eggers


[-- Attachment #1.1: Type: text/plain, Size: 8692 bytes --]

Hi,

For what is worth I always tweak PACKAGECONFIG values with recipe specific overrides instead of using bbappends. I define those overrides in a distro config or local.conf.

For instance

PACKAGECONFIG:pn-p11-kit ?= "trust-paths"

That should solve your problem.

I only use bbappends when some of the logic in the recipe needs to be tweaked, not when the configuration which is already supported by the base recipe needs to be adjusted.

Best,
--
Diego Santa Cruz, PhD
Technology Architect
spinetix.com

From: bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: 13 April 2022 12:36
To: Jose Quaresma <quaresma.jose@gmail.com>; Christopher Larson <kergoth@gmail.com>
Cc: bitbake-devel@lists.openembedded.org; Christian Eggers <ceggers@arri.de>
Subject: Re: [bitbake-devel] conditional inheriting classes does not work with bbappends

Yes, require is evaluated immediately, just like inherit, so unfortunately the suggested example below doesn’t solve the problem either.

//Peter

From: bitbake-devel@lists.openembedded.org<mailto:bitbake-devel@lists.openembedded.org> <bitbake-devel@lists.openembedded.org<mailto:bitbake-devel@lists.openembedded.org>> On Behalf Of Jose Quaresma
Sent: den 13 april 2022 12:25
To: Christopher Larson <kergoth@gmail.com<mailto:kergoth@gmail.com>>
Cc: bitbake-devel@lists.openembedded.org<mailto:bitbake-devel@lists.openembedded.org>; Christian Eggers <ceggers@arri.de<mailto:ceggers@arri.de>>
Subject: Re: [bitbake-devel] conditional inheriting classes does not work with bbappends

Hi

Christopher Larson <kergoth@gmail.com<mailto:kergoth@gmail.com>> escreveu no dia quinta, 7/04/2022 à(s) 22:59:
There’s no way to avoid that, inherit lines are evaluated *at the moment of inherit* on that line, they aren’t postponed.

Does the require have the same behaviour as the inherit? i.e: evaluated *at the moment of inherit*
if not something like that can do the job:

cat <<'EOF' > my.bbappend
PACKAGECONFIG ?= "my-knob"
require ${@bb.utils.contains('PACKAGECONFIG<mailto:$%7b@bb.utils.contains('PACKAGECONFIG>', 'my-knob', 'my-conditional-inheriting.inc', '', d)}
EOF

cat <<'EOF' >my-conditional-inheriting.inc
inherit my.bbclass
EOF


Jose


--
Christopher Larson
chris_larson@mentor.com<mailto:chris_larson@mentor.com>, chris.larson@siemens.com<mailto:chris.larson@siemens.com>, kergoth@gmail.com<mailto:kergoth@gmail.com>
Principal Software Engineer, Embedded Linux Solutions, Siemens Digital Industries Software
On Apr 7, 2022, 7:17 AM -0700, Christian Eggers <ceggers@arri.de<mailto:ceggers@arri.de>>, wrote:
Example: meta-openembedded/meta-networking/recipes-support/chrony/chrony_4.2.bb<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fchrony_4.2.bb%2F&data=04%7C01%7Cdiego.santacruz%40spinetix.com%7C11c119e4d43f4016dbe408da1d395982%7C5f4034faed2d4840a93facb1e9633b93%7C0%7C0%7C637854429401057247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=4fvCrQ%2FUpjM0cAlu46wXrUtVPDmyZzC6HxS19L3m%2Bls%3D&reserved=0>

--------------------------------8<--------------------------------
# Add chronyd user if privdrop packageconfig is selected
inherit ${@bb.utils.contains('PACKAGECONFIG<mailto:$%7b@bb.utils.contains('PACKAGECONFIG>', 'privdrop', 'useradd', '', d)}
USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}<mailto:$%7b@bb.utils.contains('PACKAGECONFIG',%20'privdrop',%20'$%7bPN%7d',%20'',%20d)%7d>"
USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /bin/nologin chronyd;', '', d)}<mailto:$%7b@bb.utils.contains('PACKAGECONFIG',%20'privdrop',%20'--system%20-d%20/%20-M%20--shell%20/bin/nologin%20chronyd;',%20'',%20d)%7d>"

...

PACKAGECONFIG ??= ...
-------------------------------->8--------------------------------


Problem #1: useradd is not inherited because PACKAGECONFIG is set below the conditional "inherit"
statement. Even when I add "privdrop" to PACKAGECONFIG here, useradd.bbclass is not inherited. I
must move the PACKAGECONFIG line above the inherit statement to make this work.

Problem #2: Due to problem #1, useradd.bbclass is also not inherited when I add "privdrop" to
PACKAGECONFIG in bbappend file (in a custom layer).

regards
Christian


_______________________________________________________
Christian

Eggers
Software Engineer
ARRI
Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Arriweg 17
,
83071

Stephanskirchen
www.arri.com

<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.arri.com%2F&data=04%7C01%7Cdiego.santacruz%40spinetix.com%7C11c119e4d43f4016dbe408da1d395982%7C5f4034faed2d4840a93facb1e9633b93%7C0%7C0%7C637854429401057247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=tiJPvwRKsqyDuVJzhXKBT2ckZ78vM%2Fotp7q23xpqEbc%3D&reserved=0>
[cid:image001.png@01D84F64.9A2D17C0]
+49 8036 3009-3118<tel:+49%208036%203009-3118>
[cid:image002.png@01D84F64.9A2D17C0]
CEggers@arri.de<mailto:CEggers@arri.de>
[One modular system, two new stabilizers: ARTEMIS 2 & TRINITY 2]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.arri.com%2Ftrinity2_artemis2&data=04%7C01%7Cdiego.santacruz%40spinetix.com%7C11c119e4d43f4016dbe408da1d395982%7C5f4034faed2d4840a93facb1e9633b93%7C0%7C0%7C637854429401057247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1zOItD0N3d%2F8Y121EK5wZAEhnF5tpXcq4Ulz2CtNOxI%3D&reserved=0>
Get all the latest information from www.arri.com<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.arri.com%2F&data=04%7C01%7Cdiego.santacruz%40spinetix.com%7C11c119e4d43f4016dbe408da1d395982%7C5f4034faed2d4840a93facb1e9633b93%7C0%7C0%7C637854429401057247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Y6X%2FJnaw7uSAtJHrGhRE2TpqxgjpEf9q4Tz9Ns9vDVU%3D&reserved=0>, Facebook<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2FTeamARRI&data=04%7C01%7Cdiego.santacruz%40spinetix.com%7C11c119e4d43f4016dbe408da1d395982%7C5f4034faed2d4840a93facb1e9633b93%7C0%7C0%7C637854429401057247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=5UDNqJ9GbTT3iobu9u7jSXDNdReea2Dr1kS2ax5mx3s%3D&reserved=0>, Twitter<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FARRIChannel&data=04%7C01%7Cdiego.santacruz%40spinetix.com%7C11c119e4d43f4016dbe408da1d395982%7C5f4034faed2d4840a93facb1e9633b93%7C0%7C0%7C637854429401057247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2Fj21U95e8A0XO05vD0UvJ%2FROmA2coFG81JTJ5kBYUkM%3D&reserved=0>, Instagram<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.instagram.com%2Farri%2F&data=04%7C01%7Cdiego.santacruz%40spinetix.com%7C11c119e4d43f4016dbe408da1d395982%7C5f4034faed2d4840a93facb1e9633b93%7C0%7C0%7C637854429401057247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=pvcUBxCa0rA4lrEkA4VV7CFDWH9TbLYqzYt90tAz2P4%3D&reserved=0>, LinkedIn<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Farri&data=04%7C01%7Cdiego.santacruz%40spinetix.com%7C11c119e4d43f4016dbe408da1d395982%7C5f4034faed2d4840a93facb1e9633b93%7C0%7C0%7C637854429401057247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=pjF3UBfGtV47BSLy8U%2B%2FqP19njbxzdWm3GyBnDAyAWo%3D&reserved=0> and YouTube<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fuser%2FARRIChannel&data=04%7C01%7Cdiego.santacruz%40spinetix.com%7C11c119e4d43f4016dbe408da1d395982%7C5f4034faed2d4840a93facb1e9633b93%7C0%7C0%7C637854429401057247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=u5oCqbTtXJz%2BtuFqzmj7lgBRRmlVyHcyW%2F91Pqs25XQ%3D&reserved=0>.

Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: München ‑ Registergericht: Amtsgericht München ‑ Handelsregisternummer: HRA 57918
Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: München ‑ Registergericht: Amtsgericht München ‑ Handelsregisternummer: HRB 54477
Geschäftsführer: Dr. Matthias Erb (Chairman); Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger




--
Best regards,

José Quaresma

[-- Attachment #1.2: Type: text/html, Size: 24512 bytes --]

[-- Attachment #2: image001.png --]
[-- Type: image/png, Size: 528 bytes --]

[-- Attachment #3: image002.png --]
[-- Type: image/png, Size: 824 bytes --]

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

end of thread, other threads:[~2022-04-14 16:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 14:17 conditional inheriting classes does not work with bbappends Christian Eggers
2022-04-07 21:59 ` [bitbake-devel] " Christopher Larson
2022-04-08 16:54   ` Christian Eggers
2022-04-12 14:12     ` Peter Kjellerstedt
2022-04-13  6:03       ` Christian Eggers
2022-04-13 10:24   ` Jose Quaresma
2022-04-13 10:35     ` Peter Kjellerstedt
2022-04-13 16:33       ` Diego Santa Cruz

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.