1.配置环境变量
export TEMPLATECONF=${PWD}/meta/meta-mediatek-mt8516/conf/base/aud8516m3v4-slc-32b-avs
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
source meta/poky/oe-init-build-env
mengtiancui@CNNJSX-160009:~/mtk8516m3v6$exportTEMPLATECONF=${PWD}/meta/meta-mediatek mt8516/conf/base/aud8516m3v4-slc-32b-avs
mengtiancui@CNNJSX-160009:~/mtk8516m3v6$ export LC_ALL=en_US.UTF-8
mengtiancui@CNNJSX-160009:~/mtk8516m3v6$ export LANG=en_US.UTF-8
mengtiancui@CNNJSX-160009:~/mtk8516m3v6$ source meta/poky/oe-init-build-env
WARNING: unable to chmod /home/mengtiancui/mtk8516m3v6/build
WARNING: unable to chmod /home/mengtiancui/mtk8516m3v6/build/conf
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
mengtiancui@CNNJSX-160009:~/mtk8516m3v6/build$
1 编译整个project
bitbake mtk-image-aud-8516 2>&1 | tee build.log
bitbake mtk-image-aud-8516 -c cleanall
2.编译kernel:
bitbake virtual/kernel
bitbake virtual/kernel -c cleanall
project编译
开始编译请依次执行命令:
$ export TEMPLATECONF=${PWD}/meta/base/conf/mt8516/aud8516-ztk-basic
$ source meta/poky/oe-init-build-env
$ bitbake mtk-image-aud-8516 2>&1 | tee build.log
编译成功后,会有如下提示,
成功编译后,生成的image保存在:build/tmp/deploy/images/aud8516-ztk-basic
部分编译
Yocto提供部分编译的功能,可以单独编译某一个模块(以.bb为单位)。比如您有一个应用程序,对应的的bb文件是new-program.bb,
您可以使用下面的命令来单独编译(注意所有bitbake指令请在 build/ 目录下执行),
$ bitbake new-program -c cleanall && bitbake new-program
单独编译后,如果要生成最后烧录的image,请继续执行,
$ bitbake mtk-image-aud-8516
特别地,如果要单独编译kernel部分生成boot.img,可以执行下面的命令,
$ bitbake virtual/kernel -c clean && bitbake virtual/kernel –f
如果提示 “bitbake” 命令找不到,请回退到到根目录,
$ source meta/poky/oe-init-build-env
$ bitbake new-program -c cleanall && bitbake new-program
clean有三种级别,可以供您选择,
如果您有修改.bb文件,需要使用 “cleanall” 后才会生效。
clean: Removes all output files for a target
cleanall: Removes all output files, shared state cache, and downloaded source files for a target
cleansstate: Removes all output files and shared state cache for a target