Download BitBake User Manual

Transcript
Hello World Example
TMPDIR
CACHE
STAMP
T
B
=
=
=
=
=
"${TOPDIR}/tmp"
"${TMPDIR}/cache"
"${TMPDIR}/stamps"
"${TMPDIR}/work"
"${TMPDIR}"
The TMPDIR variable establishes a directory that BitBake uses for build output and intermediate
files (other than the cached information used by the Setscene process. Here, the TMPDIR directory
is set to hello/tmp.
Tip
You can always safely delete the tmp directory in order to rebuild a BitBake target. The
build process creates the directory for you when you run BitBake.
For information about each of the other variables defined in this example, click on the links to take
you to the definitions in the glossary.
6. Run Bitbake: After making sure that the conf/bitbake.conf file exists, you can run the bitbake
command again:
$ bitbake
ERROR: Traceback (most recent call last):
File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
return func(fn, *args)
File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 177, in _inherit
bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 92, in inherit
include(fn, file, lineno, d, "inherit")
File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 100, in include
raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
ParseError: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
ERROR: Unable to parse base: ParseError in configuration INHERITs: Could not inherit file class
In the sample output, BitBake could not find the classes/base.bbclass file. You need to create
that file next.
7. Creating classes/base.bbclass: BitBake uses class files to provide common code and
functionality. The minimally required class for BitBake is the classes/base.bbclass file. The base
class is implicitly inherited by every recipe. BitBake looks for the class in the classes directory of
the project (i.e hello/classes in this example).
Create the classes directory as follows:
$ cd $HOME/hello
$ mkdir classes
Move to the classes directory and then create the base.bbclass file by inserting this single line:
addtask build
The minimal task that BitBake runs is the do_build task. This is all the example needs in order
to build the project. Of course, the base.bbclass can have much more depending on which build
environments BitBake is supporting. For more information on the base.bbclass file, you can look
at http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#tasks.
58