Skip to contentSkip to conversation

Debugging OpenEmbedded Builds

DISCUSSION Christian Keck 3 participants 3 messages Sep 27, 2011 – Oct 7, 2011

lore
Share & tools
lore
#0 lore raw

How can debug an OpenEmbedded build? I have made some changes to a board file, but it seems that my changes have no effect. Is there a opportunity to look into source code just before they are compiled?

Thanks, Christian

Signature · 10 lines
Dipl.-Ing. Christian Keck
Institut für Produktionsmesstechnik
Technische Universität Braunschweig
Schleinitzstraße 20
D-38106 Braunschweig
Telefon: (0531) 391-7026
Telefax: (0531) 391-5837

Mail: mailto://[email protected]
Internet: http://www.iprom.tu-bs.de
#1 lore raw
Quoted 3 lines · Christian Keck

How can debug an OpenEmbedded build? I have made some changes to a board file, but it seems that my changes have no effect. Is there a opportunity to look into source code just before they are compiled?

you can use bitbake -e recipe, to see how variables and scripts that will be executed look like. also it generates scripts in the temp/ dir in WORKDIR that can be inspected, also bitbake -c devshell NAME gets you into such an environment.

#2 lore raw
In reply to Christian Keck

Hi Christian,

What I often do to check out the recipe building is something like this...

bitbake -D -f -c clean foobarrecipe

The -D gives you lots of debugging output so you can see things happening

The -f forces bitbake to do what you say

(otherwise it's likely to check its internal state for a recipe, decide the recipe has already been built, and ignore you. You can often tell if you've been ignored as it'll say XXX tasks, of which XXX didn't need to be executed, where XXX is the same number meaning nothing happened)

The -c specifies a command. The clean command wipes out the working directory in your tree. The working directory will depend on what you're building but will probably be somewhere in ./openembedded/build/tmp_XXX/work/. You can use find or similar on the name of your recipe to figure out where it is.

So clean wipes things out, then you can try

bitbake -D -c compile foobarrecipe

Note that we're not forcing things here, and we already have that recipe in a "clean" state which means bitbake will go through the intermediary stages to get a compilation done, unpacking, patching and so forth.

After that's finished you can go to the working directory for the recipe and see what happened - you should see output files and so forth, and you can look in the temp folder in there to see the logs and scripts that are used.

Also, you probably want to make sure RM_WORK is commented out of your configuration file (local.conf I think) as otherwise bitbake will clean up the working directories after itself. I still think the compile command I suggest will work ok but if you do a full build of a recipe then at the end the work files will be cleaned. Note that removing RM_WORK will likely make your build tree MUCH bigger!

There are better ways I'm sure, such as using devshell, but this is the mechanism that works for me.

Cheers,

Alex Lennon

Dynamic Devices Ltd
http://www.dynamicdevices.co.uk

Quoted 4 lines · Christian Keck

How can debug an OpenEmbedded build? I have made some changes to a board file, but it seems that my changes have no effect. Is there a opportunity to look into source code just before they are compiled?

Thanks, Christian