[bitbake-devel] how easy to extend "bitbake -e" to print *selected* subset of variables?

Robert P. J. Day rpjday at crashcourse.ca
Sat Nov 24 12:12:19 UTC 2012


On Fri, 23 Nov 2012, Chris Larson wrote:

> On Fri, Nov 23, 2012 at 6:26 AM, Robert P. J. Day <rpjday at crashcourse.ca> wrote:

>       > What variables are you not seeing? bitbake -e shows all variables
>       > but ones which are flagged 'unexport' (e.g. DISTRO, MACHINE). --
>
>   *sigh* ... just ignore my stupidity.  in my fatigue, i totally
> forgot that configuring a pandaboard required adding meta-ti on top
> of straight OE, and there was no yocto-related content involved, but
> i was still remembering all of the variables i could see when i was
> using yocto.
>
> Heh, oops, that'd explain it :) 

  yeah, that was one of those facepalm moments,

http://media.photobucket.com/image/recent/KoalaMeatPie/618px-JeanLucPicardFacepalm.jpg

> I personally think that something like it would be useful in bitbake proper.
>
> FYI, bitbake-env now supports optionally showing function dependencies:
>
> $ bitbake-env -d TARGET_PREFIX
> def csl_target_sys(d):
>     toolchain_path = d.getVar('EXTERNAL_TOOLCHAIN', True)
>
>     for triplet in d.getVar('CSL_TARGET_SYS', True).split():
>         gcc = os.path.join(toolchain_path, 'bin', triplet + '-gcc')
>         if os.path.exists(gcc):
>             return triplet + '-'
>     return 'powerpc-mel-linux-gnuspe-'
>
> # TARGET_PREFIX="${@csl_target_sys(d)}"
> TARGET_PREFIX="powerpc-linux-gnu-"
>
> $ bitbake-env -d do_compile
> base_do_compile () {
>         if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then
>                 oe_runmake || die "make failed"
>         else
>                 bbnote "nothing to compile"
>         fi
> }
>
> do_compile () {
>     base_do_compile
> }

  whoa, where *is* this?  is it on tap to be added to bitbake/bin,
since i think that would be a delightful idea.

  just to recap, my interest in this sort of thing is not so much for
debugging as for instruction -- when i last taught an intro class
in OE/yocto, i made extensive use of the "bitbake-layers" utility when
explaining and defining layers, and the class loved it, that they
could see the results of adding a new layer.

  so something similar for the environment would be just ducky.  of
course, i really should learn python one of these days so i could do
this sort of thing myself.  soon ...

rday


-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


More information about the bitbake-devel mailing list