BitBake (dev): Difference between revisions

From Openembedded.org
Jump to navigation Jump to search
No edit summary
m (adding to developer category)
Line 42: Line 42:
bb.note(mystring)
bb.note(mystring)
</pre>
</pre>
[[Category:Dev]]

Revision as of 10:49, 2 October 2008

developer homepage

Tutorial

This tutorial focus bitbake developement, not bbclass or openembedded developement that is documented elsewhere.

"Helloworld" using bb library

#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-

import bb

version = bb.__version__
bb.note("Hello from helloworld using lib bb v%s." % ( version ))

Same using data class :

#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-

import os , bb
from bb import data

hello = ("Hello from helloworld using lib bb v%s." % ( bb.__version__ ))

d = data.init()
data.setVar('HELLO_MSG', hello, d)

mystring = data.getVar('HELLO_MSG', d, 1)
bb.note(mystring)