On 21 Jul 2023, at 10:24, Yann CARDAILLAC via lists.openembedded.org 
<[email protected]> wrote:
> There's something that has always been missing in my experience of Yocto, 
> it's the ability to simply configure files with yocto variables.
> 
> Basically the idea is to have a class that will automatically sed all 
> variables from yocto inside a file using a delimiter, or to reuse the way it 
> is done with .wks.in with the ${var} syntax, even if I can already see some 
> limitations with shell scripts.
> 
> What I intend to do is to provide some variables to a recipe and then to use 
> them to complete a template. 
> 
> For instance I'd like to put some stuff inside my machine.conf and want those 
> variables to be filled inside my templated script.
> 
> Is there any official way to do this?
> 
> As far as I can see there's not, the only examples I've found are using hand 
> made seds. But I might not be looking in the right place.
> 
> If I'm right, I'm wondering why this is not generalized inside a poky class. 
> I've found this meta : 
> https://github.com/coreycothrum/meta-bitbake-variable-substitution doing 
> exactly what I needed, but since it's not mainline I assume that as always 
> there's a good reason why it's not something you want to have in mainline.
> 
> If that's only because there wasn't any submission and If you're up for it 
> going mainline, I can work (with coreycothrum if he wants to?) it through the 
> patch submission process.

There’s also a class that I hacked up a while ago that I never finished because 
I wanted to automatically handle variable dependencies, otherwise it’s no good:

https://github.com/rossburton/meta-ross/blob/master/classes/bbin.bbclass

I’d like to see something in core, but the scope should be relatively tight.  I 
don’t like the automatic expansion that meta-bitbake-variable-substitution 
does, I’m thinking of a pathological case where piglit wanted to use @@bindir@@ 
in a wrapper script: it would also attempt to process many gigabytes of 
installed files.

The bbin class _only_ works on files in SRC_URI, so foo.sh.bbin would be 
processed at do_unpack and end up in WORKDIR/foo.sh.  The scope is more limited 
but you know exactly what it’s doing.

Ross
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#184681): 
https://lists.openembedded.org/g/openembedded-core/message/184681
Mute This Topic: https://lists.openembedded.org/mt/100273728/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to