All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Jose Quaresma <quaresma.jose@gmail.com>,
	Christopher Larson <kergoth@gmail.com>
Cc: "bitbake-devel@lists.openembedded.org"
	<bitbake-devel@lists.openembedded.org>,
	Christian Eggers <ceggers@arri.de>
Subject: RE: [bitbake-devel] conditional inheriting classes does not work with bbappends
Date: Wed, 13 Apr 2022 10:35:32 +0000	[thread overview]
Message-ID: <764ea7b8f1804d77afd5608632feb31d@axis.com> (raw)
In-Reply-To: <CANPvuR=BOhbH18iZJZ6n2StSPzxCmFL-o=O59gi6s91YLpzkYw@mail.gmail.com>


[-- 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 --]

  reply	other threads:[~2022-04-13 15:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-04-13 16:33       ` Diego Santa Cruz

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=764ea7b8f1804d77afd5608632feb31d@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=ceggers@arri.de \
    --cc=kergoth@gmail.com \
    --cc=quaresma.jose@gmail.com \
    /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.