From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Christian Eggers <ceggers@arri.de>,
"bitbake-devel@lists.openembedded.org"
<bitbake-devel@lists.openembedded.org>,
Christopher Larson <kergoth@gmail.com>
Subject: RE: [bitbake-devel] conditional inheriting classes does not work with bbappends
Date: Tue, 12 Apr 2022 14:12:57 +0000 [thread overview]
Message-ID: <4e01937824084bff8aadf5adfd965670@axis.com> (raw)
In-Reply-To: <3188702.aeNJFYEL58@localhost.localdomain>
[-- 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 --]
next prev parent reply other threads:[~2022-04-12 16:46 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 [this message]
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
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=4e01937824084bff8aadf5adfd965670@axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=ceggers@arri.de \
--cc=kergoth@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.