1.安装bitbake,并设定path
使用git下載 bitbake並安裝
$git clone git://git.openembedded.org/bitbake
設定PATH
$export PATH=/home/
2. 执行bitbake:
bitbake
ERROR: Unable to find conf/bblayers.conf or conf/bitbake.conf. BBPATH is unset and/or not in a build directory?
3. 创建hello 目录,并设置BBPATH变量:
export BBPATH="/home/
再次执行bitbake,保存如下:
ERROR: Unable to find conf/bblayers.conf or conf/bitbake.conf. BBPATH is unset and/or not in a build directory?
4.创建conf/bitbake.conf,run bitbake
$ mkdir conf
再在conf下建立bitbake.conf,并输入下面内容
TMPDIR = "${TOPDIR}/tmp"
CACHE = "${TMPDIR}/cache"
STAMP = "${TMPDIR}/stamps"
T = "${TMPDIR}/work"
B = "${TMPDIR}"
执行bitbake:
ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/home/
--- Starting bitbake server pid 127776 at 2020-04-16 16:09:25.846593 ---
ERROR: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
5. 创建classes/base.bbclass,run bitbake
$ mkdir classes
在base.bbclass输入
addtask build
执行bitbake
$ bitbake
Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information
6.创建一个layer
创建myplayer,一个layer 中必须包含layer.conf 和recipe 文件。
创建mylayer/conf/layer.conf 文件,内容如下:
BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/*.bb"
BBFILE_COLLECTIONS += "mylayer"
BBFILE_PATTERN_mylayer := "^${LAYERDIR}/"
创建recipe 文件printhello.bb 内容如下:
DESCRIPTION = "Prints Hello World"
PN = 'printhello'
PV = '1'
python do_build() {
bb.plain("********************");
bb.plain("* *");
bb.plain("* Hello, World! *");
bb.plain("* *");
bb.plain("********************");
}
执行 bitbake printhello,打印如下:
ERROR: no recipe files to build, check your BBPATH and BBFILES?
ERROR: Nothing PROVIDES 'printhello'
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
这是因为在hello/conf/bbplayer.conf 中没有声明layer
7.在hello/conf/bbplayer.conf 中声明recipe 的路径
创建hello/conf/bbplayer.conf 内容如下:
BBLAYERS ?= "/home/
8 执行 bitbake printhello 打印如下:
bitbake printhello -f
WARNING: Layer mylayer should set LAYERSERIES_COMPAT_mylayer in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: Layer mylayer should set LAYERSERIES_COMPAT_mylayer in its conf/layer.conf file to list the core layer names it is compatible with.
Parsing recipes: 100% |####################################| Time: 0:00:00
Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |#################################| Time: 0:00:00
NOTE: No setscene tasks
NOTE: Executing Tasks
********************
* *
* Hello, World! *
* *
********************
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
Summary: There were 2 WARNING messages shown.
demo 成功执行: