Hello Richard, I can try to explain it in some examples.
I would like to add some extra (dynamic) variables into local.conf in eSDK mode. I have found, that there are 2 possibilities (in populate_sdk_ext.bbclass) sdk-extra.conf and sdk_extraconf. - sdk-extra.conf - You have to have handle own function to write into sdk-extra.conf. I think, this is not the right way for me. - sdk_extraconf - This variable is fine, but there are some restrictions. There is no easy way to add multiple variables including values. I would like to have: aaa = "valueA" bbb = "valueB" in local.conf file. 1. sdk_extraconf = 'aaa = "valueA"\nbbb = "valueB"' - this will write aaa = "valueA"\nbbb = "valueB" 2. python copy_buildsystem_prepend() { d.setVar('sdk_extraconf','aaa = "valueA"\nbbb = "valueB"') } - This will write exactly, what you want, but you have to have an copy_buildsystem_prepend and mentioned all variables with values defined in your class/recipe. 3. sdk_extraconf = "# My notes about local.conf" - Yes, you can write some string into local.conf with this way. So I have founded an way, how to add multiple variables without explicitly specifying their values. # format variables for sdk_extraconf def write_sdk_vars(d): return '\n' + '\n'.join([var + ' = "' + d.getVar(var) + '"' for var in d.getVar('SDK_EXTRACONF_VARS').split()]) SDK_EXTRACONF_VARS = "aaa bbb" sdk_extraconf_append = " ${@write_sdk_vars(d)}" It will do exactly what I want, but this way is little bit nasty. So I have created a more complex solution for community usage. I think, this patch adds more functionality also for other projects. They can add only variables into list and the class will handle all the rest. Is it enough for the explanation? Regards, Andrej On 2020-03-06 18:16, Richard Purdie wrote: > On Fri, 2020-03-06 at 16:32 +0100, Andrej Valek wrote: >> "add option to append lines into local.conf": >> - What about dropping "sdk_extraconf"? > > I'm curious what you didn't find useful about the other format and why > this version is better? > > Cheers, > > Richard > -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core