[yocto] Navigating the layer labyrinth
I am a new user for a few weeks now, trying to make a customized image for a toradex colibri-vf module, so far I have succeeded in the following disciplines: * adding the 3rd party layers that I need * making my own layers * using a .bbappend to patch the device tree * using a .bbappend to workaround a bug(?) in one of the freescale layers * writing my own recipe to install a python script * writing recipes for pulling additional python packages with pypi and setuptools3 * writing my own image recipe * making it boot and run on the target platform During this learning experience I have made the following observations of circumstances that made it especially hard for me to get things done, I'm not yet really sure if this is a documentation issue or if it is really a missing feature but I feel I could have had a much *much* easier time learning and understanding the concepts and relationships and the inner workings of existing layers upon which I want to build my system if the following things were possible (and/or if they are already possible they should be documented in the very first chapter of the documentation): * Finding the *file path* of an existing recipe (or append file or class) *by its name* and also all existing .bbappends for it, i imagine something simple like bitbake --show-paths foo-bar would output me the small list of absolute paths of recipe files by the name foo-bar and all matching .bbappend files in the order in which they would be applied, it would show me only this small list of paths and not dump 100kb of unrelated information along with it. This would be incredibly helpful when I need to inspect an existing recipe in order to understand how I can bbappend it or even just to see and understand what it actually does. * A simple way to track the assignment of a certain variable, to inspect its contents and if it refers to other variables then recursively show their contents too (and also the path of the bb file where this happens), and also show which other recipes will directly and indirectrly depend on this variable further down the line, I imagine this should output two tree-like structures where one can see at one glance how and where all the contents of that variable come from and where they are going to be used. Again this should be a simple command that formats and outputs that (and only that) information in a well formatted and compact tree-like representation. * The absolute killer application would be an IDE or an editor plugin where I open any .bb file and can then just CTRL-click on any include, require, inherit, depend, rdepend, or any variable name and it would open another editor containing that recipe file where it is defined and/or populate a sidebar with a list or a tree of direct and indirect references to that name, backward and forward, and I could just click on any node of that tree an and it would open the file in the editor and jump to that line of code. Such a thing would be an incredibly helpful tool, it would make even the most complex and tangled labyrinth of recipes navigable with ease. Please tell me that such a thing already exists and I just have not found it yet. Bernd -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
[yocto] possible to append or patch existing machine .conf file?
Suppose I have the following bugfix patch for a 3rd party machine conf file I am using: diff --git a/conf/machine/colibri-vf.conf b/conf/machine/colibri-vf.conf index 3ddef79..ba47488 100644 --- a/conf/machine/colibri-vf.conf +++ b/conf/machine/colibri-vf.conf @@ -35,6 +35,6 @@ MKUBIFS_ARGS = " -c 8112 -e 124KiB -m 2KiB -F" UBINIZE_ARGS = " -p 128KiB -m 2048 -s 2048" UBI_VOLNAME = "rootfs" -SERIAL_CONSOLE ?= "115200 ttyLP0" +SERIAL_CONSOLE = "115200 ttyLP0" MACHINE_FEATURES += "usbgadget usbhost vfat alsa touchscreen" Is there a proper way to somehow temporarily add something to my layer to apply this patch until it makes its way upstream and into the branch I am using? Or should I make my own machine file, include the original one and then change the variable? So far I have not found any elegant way to otherwise force this variable to its correct value in my image recipe, the only way I have found to work around this bug is to .bbappend the inittab recipe where this variable is actually used and change the value of another variable (SERIAL_CONSOLES, note the S at the end) which is derived from SERIAL_CONSOLE right there in this bbappend file. This seems to help. But while doing this I have also noticed a strange anomaly in the output of bitbake -e: * When I change the variable in my image recipe then bitbake -e will show another "set" access and both variables SERIAL_CONSOLE and SERIAL_CONSOLES will have the correct value as intended by me but the produced image will have the **wrong** entry in its inittab. * When I bbappend the inittab recipe to set SERIAL_CONSOLES right there where it is used then my final image will have a correct inittab and the serial console will work bit there is **no** mention of that variable change in the output of bitbake -e * Only when I change the machine conf file iitself to set the variable then bitbake -e and the produced image both show the correct entry. Why does it behave that way? -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] possible to append or patch existing machine .conf file?
I have now combined the last 2 answers: I did not want to put more customization than machine and distro into my local.conf and since I already have my own distro conf I have now put the include conf/machine/${MACHINE}-extra.conf into my own distro conf file and made colibri-vf-extra.conf, both files are now inside my own layer folder and under my project's version control so it won't get lost. This works. Thank you 2017-10-13 10:56 GMT+02:00 Bernd : > sorry, the gmail user interface sent the reply not to the list by > default, I did not notice it > > 2017-10-13 10:43 GMT+02:00 Ayoub Zaki : >> Hi Bernd, >> >> >> Glad that it worked :-) >> >> Please post your answers to the ML. >> >> Best regards >> >> >> -- >> Ayoub Zaki >> Embedded Systems Consultant >> >> Vaihinger Straße 2/1 >> D-71634 Ludwigsburg >> >> Tel. : +4971415074546 >> Mobile : +4917662901545 >> Email: ayoub.z...@embexus.com >> Homepage : https://embexus.com >> >> >> On 13.10.2017 10:33, Bernd wrote: >>> >>> I have now combined the last 2 answers: >>> >>> I did not want to put more customization than machine and distro into >>> my local.conf and since I already have my own distro conf I have now >>> put the include conf/machine/${MACHINE}-extra.conf into my own distro >>> conf file and made colibri-vf-extra.conf, both files are now inside my >>> own layer folder and under my project's version control so it won't >>> get lost. This works. Thank you >>> >>> >>> 2017-10-12 20:32 GMT+02:00 Ayoub Zaki : >>>> >>>> Hi, >>>> >>>> On 12.10.2017 12:32, Bernd wrote: >>>>> >>>>> Suppose I have the following bugfix patch for a 3rd party machine conf >>>>> file I am using: >>>>> >>>>> diff --git a/conf/machine/colibri-vf.conf b/conf/machine/colibri-vf.conf >>>>> index 3ddef79..ba47488 100644 >>>>> --- a/conf/machine/colibri-vf.conf >>>>> +++ b/conf/machine/colibri-vf.conf >>>>> @@ -35,6 +35,6 @@ MKUBIFS_ARGS = " -c 8112 -e 124KiB -m 2KiB -F" >>>>>UBINIZE_ARGS = " -p 128KiB -m 2048 -s 2048" >>>>>UBI_VOLNAME = "rootfs" >>>>> >>>>> -SERIAL_CONSOLE ?= "115200 ttyLP0" >>>>> +SERIAL_CONSOLE = "115200 ttyLP0" >>>>> >>>>>MACHINE_FEATURES += "usbgadget usbhost vfat alsa touchscreen" >>>>> >>>>> Is there a proper way to somehow temporarily add something to my layer >>>>> to apply this patch until it makes its way upstream and into the >>>>> branch I am using? Or should I make my own machine file, include the >>>>> original one and then change the variable? >>>> >>>> you can add to local.conf or distro.conf : >>>> >>>> include conf/machine/${MACHINE}-extra.conf >>>> >>>> then create in your meta layer or bsp layer : >>>> >>>> conf/machine/beaglebone-extra.conf >>>> conf/machine/rasberrypi-extra.conf >>>> conf/machine/xyz-extra.conf >>>> >>>> which contains overrides for your machine settings. >>>> Note that is an include and not require, which means that if you machine >>>> has >>>> no *extra.conf then it's simply skkiped ( no overrides) >>>> >>>>> So far I have not found any elegant way to otherwise force this >>>>> variable to its correct value in my image recipe, the only way I have >>>>> found to work around this bug is to .bbappend the inittab recipe where >>>>> this variable is actually used and change the value of another >>>>> variable (SERIAL_CONSOLES, note the S at the end) which is derived >>>>> from SERIAL_CONSOLE right there in this bbappend file. This seems to >>>>> help. >>>>> >>>>> But while doing this I have also noticed a strange anomaly in the >>>>> output of bitbake -e: >>>>> >>>>> * When I change the variable in my image recipe then bitbake -e will >>>>> show another "set" access and both variables SERIAL_CONSOLE and >>>>> SERIAL_CONSOLES will have the correct value as intended by me but the >>>>> produced image will have the **wrong** entry in its inittab. >>>>> >>>>> * When I bbappend the inittab recipe to set SERIAL_CONSOLES right >>>>> there where it is used then my final image will have a correct inittab >>>>> and the serial console will work bit there is **no** mention of that >>>>> variable change in the output of bitbake -e >>>>> >>>>> * Only when I change the machine conf file iitself to set the variable >>>>> then bitbake -e and the produced image both show the correct entry. >>>>> Why does it behave that way? >>>> >>>> >>>> -- >>>> Ayoub Zaki >>>> Embedded Systems Consultant >>>> >>>> Vaihinger Straße 2/1 >>>> D-71634 Ludwigsburg >>>> >>>> Tel. : +4971415074546 >>>> Mobile : +4917662901545 >>>> Email: ayoub.z...@embexus.com >>>> Homepage : https://embexus.com >>>> >>>> -- >>>> ___ >>>> yocto mailing list >>>> yocto@yoctoproject.org >>>> https://lists.yoctoproject.org/listinfo/yocto >> >> -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
[yocto] variable override syntax, where is it documented?
I just found out that I can ovverride the line hostname = "${MACHINE}" in base-files simply by assigning a value to hostname_pn-base-files in my configuration file and it will re-assign it with a higher priority than "=". Now I wonder where this kind of black magic is documented, I don't seem to be able to locate any document that explains the "_pn-" syntax and I wonder if there are even more such tricks that could be useful and am looking for a document that explains them all. Is there such a thing? - Bernd -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto