Date
1 - 2 of 2
how bitbake works
Mayank Agarwal <mayank77fromindia@...>
Hi,
I am new to yocto.I have following doubts.
a) How bitbake decides the order of compiling and executing modules.
b) Is it possible to compile 1 module before or after another one
c) Is there any file where we can see the complete list of all tasks that bitbake executes in the order of execution.
d) How can we use logging mechanism in bitbake.Is it possible to put log statements in recipe files and see the logs on terminal
during compilation and execution.
e) Optmization of bitbake steps.Is there any guide that tells how can we optimize.For me 1 module takes close to 3 hrs in executing
Is there any method that i can reduce build time by pre compiling that module.
Best Regards
Mayank
On Sat, Jul 17, 2021 at 2:12 AM Mayank Agarwal <mayank77fromindia@...> wrote:
a) How bitbake decides the order of compiling and executing modules.
You generally build images. Images have dependencies. If you map out the dependencies as a big giant graph, the dependencies with no child nodes get built first. The build continues from there as all dependencies are met and then the core image can be assembled.
There are also some intrinsic dependencies like the sysroot compiler, etc that always have to be built first. Bitbake caches dependencies and reuses them in subsequent builds if it does not detect any changes to them.
b) Is it possible to compile 1 module before or after another one
Think of it in terms of dependencies. If A depends on B, then B gets built first. You would use the DEPENDS (build time dependency) and the RDEPDENDS_${PN} (runtime dependencies) variables for this.
c) Is there any file where we can see the complete list of all tasks that bitbake executes in the order of execution.
Yes, you can generate a graph of the entire execution with the --graphviz argument, e.g. "bitbake core-image-sato --graphviz". This generates a build graph document in the build directory.
d) How can we use logging mechanism in bitbake.Is it possible to put log statements in recipe files and see the logs on terminal during compilation and execution.
Yes, but that is out of scope for a quick email reply like this.
You should read the manuals at https://docs.yoctoproject.org. They are a very rich source of information. The more you read them, the smarter your questions will get, and the more likely you are to get help when you experience complex problems.
You might also want to take a look at the FAQ (https://wiki.yoctoproject.org/wiki/FAQ) and the Technical FAQ (https://wiki.yoctoproject.org/wiki/Technical_FAQ).
e) Optmization of bitbake steps.Is there any guide that tells how can we optimize.For me 1 module takes close to 3 hrs in executingIs there any method that i can reduce build time by pre compiling that module.
Faster hardware? It really depends on the specifics of what you are building. There is no magic formula.
I have one build that takes 28 hours on a 2 core machine. It builds in 2-3 hours now on a 20 Core machine. My developers only require a subset of that build so they can cache an initial build on their 4 core laptops in about 8 hours. There is also an option to use shared cache if that works for your particular situation.
Also, I normally dedicate about 2.5 gigs of RAM per core to avoid crashes due to RAM starvation. Otherwise you may experience random "difficult to explain" build crashes.
..Ch:W..
"Perfection must be reached by degrees; she requires the slow hand of time." - Voltaire