<div dir="ltr">Hi Uwe,<br><div><div class="gmail_extra"><br><div class="gmail_quote">2018-08-03 10:39 GMT+02:00 Uwe Geuder <span dir="ltr"><<a href="mailto:jrswdnan22@snkmail.com" target="_blank">jrswdnan22@snkmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
[Disclaimer: I have posted a similar message months ago. There were no<br>
replies. Let's try whether I can express myself clearer this time.]<br>
<br>
One of the few informations I could find about how to create my own<br>
layer was something like<br>
<a href="https://www.openembedded.org/wiki/Creating_a_new_Layer" rel="noreferrer" target="_blank">https://www.openembedded.org/<wbr>wiki/Creating_a_new_Layer</a><br>
 </blockquote><div><br></div><div>Did you check <br></div><div><a href="https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#creating-a-general-layer-using-the-bitbake-layers-script">https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#creating-a-general-layer-using-the-bitbake-layers-script</a></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Especially for creating a distro layer that does not give much guidance.<br>
<br>
I could not find any examples of distro layers (except poky of course)<br>
on the net. Can somebody give me pointers?<br>
<br></blockquote><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The auto-generated local.conf mentions subclassing<br>
poky. Is that concept explained anywhere?<br>
<br>
I inherited a distro layer, which sets a lot of its policy (selection of<br>
systemd and other feature/package selection) in layer.conf. From reading<br>
the documentation and other layer.conf files I understand that is NOT<br>
the way to do it. I would expect those settings in distro/<distro>.conf.<br>
<br>
The yocto reference manual says for many variables: "Set it in your<br>
local.conf". For me they are policy, so why shouldn't I set them in<br>
distro/<distro>.conf?<br>
<br></blockquote><div><br></div><div>
<div>Did you also check</div><div><a href="https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#creating-your-own-distribution">https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#creating-your-own-distribution</a></div><div><br></div><div>You can look some Freescale example here:</div><div><a href="https://github.com/Freescale/meta-freescale-distro">https://github.com/Freescale/meta-freescale-distro</a></div>

</div><div><br></div><div>In fact, when Yocto manual refers to adding something to local.conf, it is the minimal way to do it, <br></div><div>but the cleanest is indeed to set it in machine/distro config file.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Well, basically there is only one configuration in bitbake. So often it<br>
does not matter in what configuration file a variable is set. The<br>
setting will end up in the environment of the tasks. However, especially<br>
when the ?= operator is used order becomes significant.<br>
<br>
Particularly tricky I found the DISTRO variable. <br>
<br>
Our distro layer does<br>
<br>
1.) set the DISTRO variable in layer.conf (according to the manual it<br>
should be done in local.conf)<br>
2.) from distro/<distro>.conf include (well, require) poky.conf. Is<br>
that a big no-no??? Of course I could copy all settings I want to keep from<br>
poky (and all those I don't understand what they do...), but copying code<br>
is generally not good SW engineering, including sounds better.<br>
3.) set DISTRO again after having included poky.conf . According to<br>
the yocto-check-layer script a distro must not set its own<br>
name. However, poky does not follow that rule and sets its name, so our<br>
code has to violate the rule once more and revert poky's wrongdoing.<br>
<br></blockquote><div><br></div><div>1.) DISTRO is local to build folder, so it should be in local.conf, and you can use a wrapper script to help creating this local.conf file, <br></div><div>see <a href="https://github.com/Freescale/fsl-community-bsp-base/blob/master/setup-environment">https://github.com/Freescale/fsl-community-bsp-base/blob/master/setup-environment</a> for instance.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
In an attempt to make our code more in line with what I understand to be<br>
correct style, I tried to move all policy settings to<br>
distro/<distro>.conf and the DISTRO setting to local.conf.<br>
<br>
However that created a couple of problems:<br>
<br>
1. If I set DISTRO in local.conf before adding all needed layers, my own<br>
distro layer last, bitbake-layers fails in a sanity check that the<br>
distro does not exist. Fair enough, it doesn't know about before it has<br>
been added.<br>
<br>
2. If I first modify my local.conf with all my settings except DISTRO,<br>
then run all the add-layer operations and finally modify local.conf a<br>
2nd time to set DISTRO correctly the build works. However, all recipes<br>
are reparsed when the build starts. I guess this is caused by the config<br>
change.<br>
<br>
So in the end having the DISTRO setting in layer.conf seems to work<br>
best. All add-layer commands succeed and recipes can be used from the<br>
cache when the build starts. Best, except that I don't think that's the<br>
way it's documented.<br></blockquote><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Any thoughts what I might be missing?<br></blockquote><div><br></div><div>
You can use git submodule, or google repo to create Yocto environment, 
you don't need to create your layer each time and you don't have to 
compile before using bitbake-layers.

<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Regards,<br>
<br>
Uwe<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
<br>
Uwe Geuder<br>
Neuro Event Labs Oy<br>
Tampere, Finland<br>
<a href="mailto:uwe.gexder@neuroeventlabs.com">uwe.gexder@neuroeventlabs.com</a> (Bot check: fix one obvious typo)<br>
-- <br>
______________________________<wbr>_________________<br>
yocto mailing list<br>
<a href="mailto:yocto@yoctoproject.org">yocto@yoctoproject.org</a><br>
<a href="https://lists.yoctoproject.org/listinfo/yocto" rel="noreferrer" target="_blank">https://lists.yoctoproject.<wbr>org/listinfo/yocto</a><br>
</font></span></blockquote></div><br></div></div></div>