yocto:bitbake单独编译某个模块的方法

在yocto编译环境中如果想单独编译某个模块

可以在已经搭建好的yocto编译环境中使用如下命令

Yocto中对于不同的Package,有不同的task,即可以执行不同的操作,有一些是所有包共通的,例如clean,build等。

我们可以使用下面命令来查看一个包都有哪些可执行的task:

bitbake Package -c listtasks

 

如:bitbake core-image-weston -c listtasks

有以下结果:

Initialising tasks: 100% |#################################################################################################################################################################| Time: 0:00:07
NOTE: Executing RunQueue Tasks
do_build                       Default task for a recipe - depends on all other normal tasks required to 'build' a recipe
do_checkuri                    Validates the SRC_URI value
do_checkuriall                 Validates the SRC_URI value for all recipes required to build a target
do_clean                       Removes all output files for a target
do_cleanall                    Removes all output files, shared state cache, and downloaded source files for a target
do_cleansstate                 Removes all output files and shared state cache for a target
do_compile                     Compiles the source in the compilation directory
do_configure                   Configures the source by enabling and disabling any build-time and configuration options for the software being built
do_devpyshell                  Starts an interactive Python shell for development/debugging
do_devshell                    Starts a shell with the environment set up for development/debugging
do_dtv_checking                
do_fetch                       Fetches the source code
do_fetchall                    Fetches all remote sources required to build a target
do_image                       
do_image_complete              
do_image_complete_setscene      (setscene version)
do_image_ext4                  
do_image_qa                    
do_image_qa_setscene            (setscene version)
do_image_tar                   
do_install                     Copies files from the compilation directory to a holding area
do_listtasks                   Lists all defined tasks for a target
do_package                     Analyzes the content of the holding area and splits it into subsets based on available packages and files
do_package_qa_setscene         Runs QA checks on packaged files (setscene version)
do_package_setscene            Analyzes the content of the holding area and splits it into subsets based on available packages and files (setscene version)
do_package_write_rpm           Creates the actual RPM packages and places them in the Package Feed area
do_package_write_rpm_setscene  Creates the actual RPM packages and places them in the Package Feed area (setscene version)
do_packagedata                 Creates package metadata used by the build system to generate the final packages
do_packagedata_setscene        Creates package metadata used by the build system to generate the final packages (setscene version)
do_patch                       Locates patch files and applies them to the source code
do_populate_lic                Writes license information for the recipe that is collected later when the image is constructed
do_populate_lic_setscene       Writes license information for the recipe that is collected later when the image is constructed (setscene version)
do_populate_sdk                Creates the file and directory structure for an installable SDK
do_populate_sdk_ext            
do_populate_sysroot_setscene   Copies a subset of files installed by do_install into the sysroot in order to make them available to other recipes (setscene version)
do_prepare_recipe_sysroot      
do_rootfs                      Creates the root filesystem (file and directory structure) for an image
do_rootfs_wicenv               
do_sdk_depends                 
do_unpack                      Unpacks the source code into a working directory
do_vp9_checking                
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.

说明上面可以支持的CMD。

接着使用如下命令:

bitbake  -b bbfile -c CMD(before list)

bitbake  -b pulseaudio_10.0 -c compile

bitbake  -b pulseaudio_10.0 -c clean

bitbake -b pulseaudio_10.0 -c build

bitbake  -b pulseaudio_10.0 -c configure

bitbake  -b pulseaudio_10.0 -c compile

bitbake  -b pulseaudio_10.0 -c install

一般要在yocto的编译环境中打patch的方式如下:

1,bbappend文件的编译方式

在poky目录下的meta/conf/有个layer.conf配置文件

# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb"

BBFILES += "${LAYERDIR}/recipes-*/*/*.bbappend"

其中BBFILES为需要参加编译的文件。

2,基于模块的源码的patch

把patch文件放在模块的放patch的目录下

找到该模块的bb文件,参照已有的打patch的方式,添加自己的patch。

比如:

SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \

           file://0001-padsp-Make-it-compile-on-musl.patch \

           file://0001-client-conf-Add-allow-autospawn-for-root.patch \

           file://pulseaudio-discuss-iochannel-don-t-use-variable-length-array-in-union.patch \

           file://volatiles.04_pulse \

           file://fix-add-connectionid-in-simple.patch\(新增)

 

  • 8
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值