一、Bitbake
(1)使用教程可以参考:BitBake 实用指南,大部分步骤跟着操作即可了解bitbake的工作流程;
(1)执行 bitbake -vDD,然后查看其输出,它告诉我们大量关于 BitBake 如何动作的信息。
bitbake -s 列出可用的 recipes
sunyongfeng@openswitch-OptiPlex-380:~/workshop/test/tutorial/build$ bitbake -s
Parsing recipes: 100% |
Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors.
Recipe Name Latest Version Preferred Version
=========== ============== =================
first :0.1-r1
(2)bitbake first 编译 first 组件。
sunyongfeng@openswitch-OptiPlex-380:~/workshop/test/tutorial/build$ bitbake first
tmp/work/first-0.1-r1/temp 目录,里面有一些有趣的文件:
(3)如果想看某个 recipe 提供哪些 tasks,可以通过 bitbake -c listtasks recipe_name 查看:
sunyongfeng@openswitch-OptiPlex-380:~/workshop/test/tutorial/build$ bitbake -c listtasks second
(4)
构建一个 recipe。使用 bitbade recipe-name 执行该 recipe 的所有 tasks。
执行一个 task。使用 bitbake -c your-task recipe-name 只运行 recipe 中的某个 task。
构建所有 recipe。使用 bitbake world 运行所有 recipes 的所有 tasks。
(5)sunyongfeng@openswitch-OptiPlex-380:~/workshop/test/tutorial/build$ bitbake-layers show-layers
sunyongfeng@openswitch-OptiPlex-380:~/workshop/test/tutorial/build$ bitbake-layers show-recipes
配置相关:
(1)EXPORT_FUNCTIONS
使该 build 函数可被这个 class 的使用者使用,如果不添加这行,则它不会覆盖 base class 中的 build 函数。
(2)recipe 文件也有通用的命名方法:{recipe}_{version}.bb
(2)进一步可以参考:【Yocto】BitBake入门之HelloWorld和bitbake版本hello world进行熟悉
(3)进一步:【Yocto】BitBake入门之镜像中的HelloWorld
补充:
-
所有相关文档和代码,我将其全部上传至github
-
bitbake_test的使用步骤:
bitbake_test目录中我已经将git bitbake下载完毕,集成到了当前工程中,你只需要将下面两行添加至环境变量
wangji@script-wang:~$ ll ~/.bashrc
export PATH=$PATH:/home/wangji/ota/bitbake_test/bitbake/bin
export PYTHONPATH=$PYTHONPATH:/home/wangji/ota/bitbake_test/bitbake/lib
wangji@script-wang:~$ source ~/.bashrc
BitBake的典型方法:通用 task 由 class 定义,比如下载源代码、configure、make 和其他操作,recipe 设置这些 task 所需要的变量。
二、Yocto
yocto,Yocto项目介绍及入门 – 嵌入师工程师必备利器
- Yocto官方手册
- 中文资料:嵌入式Linux系统开发:基于Yocto Project,2018
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)