bitbake 建立helloword
2015-05-28 13:33
225 查看
1、建立hello 工程
我的目录在 /home/chunyun/yocto/下。
mkdir hello
cd hello/
下载bitbake,参考 http://www.yoctoproject.org/docs/1.8/bitbake-user-manual/bitbake-user-manual.html#obtaining-bitbake 配置bitbake。
配置环境变量:
依然切换到 hello目录,
export PATH=/home/chunyun/yocto/bitbake/bin/:$PATH
注:我的bitbake目录在yocto下。
2、设置BBPATH
BBPATH="/home/chunyun/yocto/hello/"
export BBPATH
echo BBPATH
BBPATH即工作目录。
3、创建
这个配置是用来存储 变量和 相关的数据元、配置文件等。
内容:
TMPDIR = "${TOPDIR}/tmp"
CACHE = "${TMPDIR}/cache"
STAMP = "${TMPDIR}/stamps"
T = "${TMPDIR}/work"
B = "${TMPDIR}"
4、创建
类文件提供共同的代码和方法。
类文件内容:
addtask build
5、创建相关层级内容
在工作目录创建
mkdir mylayer
mkdir conf
建立层级配置文件 conf/layer.conf,用来供调用。
layer.conf内容为
BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/*.bb"
BBFILE_COLLECTIONS += "mylayer"
BBFILE_PATTERN_mylayer := "^${LAYERDIR}/"
创建一个print方法在mylayer目录层
命名为 bblayers.conf, 内容:
DESCRIPTION = "Prints Hello World"
PN = 'printhello'
PV = '1'
python do_build() {
bb.plain("..................");
bb.plain(". .");
bb.plain(". Hello, World! .");
bb.plain(". .");
bb.plain("..................");
}
6、创建
这个目录在hello目录下,使用的是本地调用路径。
BBLAYERS ?= " \
/home/chunyun/yocto/mylayer \
"
7、运行 helleworld。
bitbake printhello
可以看到如下:
Parsing recipes: 100% |###############################################################################################| Time: 00: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
NOTE: Preparing RunQueue
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 1 tasks of which 1 didn't need to be rerun and all succeeded.
运行成功。
我的目录在 /home/chunyun/yocto/下。
mkdir hello
cd hello/
下载bitbake,参考 http://www.yoctoproject.org/docs/1.8/bitbake-user-manual/bitbake-user-manual.html#obtaining-bitbake 配置bitbake。
配置环境变量:
依然切换到 hello目录,
export PATH=/home/chunyun/yocto/bitbake/bin/:$PATH
注:我的bitbake目录在yocto下。
2、设置BBPATH
BBPATH="/home/chunyun/yocto/hello/"
export BBPATH
echo BBPATH
BBPATH即工作目录。
3、创建
conf/bitbake.conf
这个配置是用来存储 变量和 相关的数据元、配置文件等。
内容:
TMPDIR = "${TOPDIR}/tmp"
CACHE = "${TMPDIR}/cache"
STAMP = "${TMPDIR}/stamps"
T = "${TMPDIR}/work"
B = "${TMPDIR}"
4、创建
classes/base.bbclass
类文件提供共同的代码和方法。
类文件内容:
addtask build
5、创建相关层级内容
在工作目录创建
mkdir mylayer
mkdir conf
建立层级配置文件 conf/layer.conf,用来供调用。
layer.conf内容为
BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/*.bb"
BBFILE_COLLECTIONS += "mylayer"
BBFILE_PATTERN_mylayer := "^${LAYERDIR}/"
创建一个print方法在mylayer目录层
命名为 bblayers.conf, 内容:
DESCRIPTION = "Prints Hello World"
PN = 'printhello'
PV = '1'
python do_build() {
bb.plain("..................");
bb.plain(". .");
bb.plain(". Hello, World! .");
bb.plain(". .");
bb.plain("..................");
}
6、创建
conf/bblayers.conf
这个目录在hello目录下,使用的是本地调用路径。
BBLAYERS ?= " \
/home/chunyun/yocto/mylayer \
"
7、运行 helleworld。
bitbake printhello
可以看到如下:
Parsing recipes: 100% |###############################################################################################| Time: 00: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
NOTE: Preparing RunQueue
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 1 tasks of which 1 didn't need to be rerun and all succeeded.
运行成功。
相关文章推荐
- Lua HelloWord!
- Android studio 首次运行,模拟器中不显示HelloWord
- linux helloword 内核编译.ko菜鸟记录
- QT的"hello word"
- [Office]使用 OpenXML SDK 建立 Word 文件檔
- kotlin HelloWord
- NDK的环境搭建 - HelloWordNDK
- C中char str[] = "hello word";与char *str = "hello word";
- [转载]Hello Word Outlook Add-In using C#
- c++ 第一篇 Hello,Word!
- JMX入门之StandardMBean HelloWord
- (12) Hadoop Java 实现MapReduce HelloWord 单词统计 更新版
- osgi equinox helloword
- 我的第一个java程序:HelloWord
- [MAC]学习第一篇 mac环境下的COCOS2D-X HelloWord
- Hello Word.
- QT学习第一步 - 初步建立开发环境以及Hello
- linux fedora 24 ruby helloword
- hadoop mapreduce hello world(wordcount)
- 使用hello-gl2建立ndk-gdb环境(有源码和无源码调试环境)