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

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

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

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

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

bitbake Package -c listtasks

 

如:bitbake core-image-weston -c listtasks

有以下结果:

  1.  
    Initialising tasks: 100% |#################################################################################################################################################################| Time: 0:00:07
  2.  
    NOTE: Executing RunQueue Tasks
  3.  
    do_build Default task for a recipe - depends on all other normal tasks required to 'build' a recipe
  4.  
    do_checkuri Validates the SRC_URI value
  5.  
    do_checkuriall Validates the SRC_URI value for all recipes required to build a target
  6.  
    do_clean Removes all output files for a target
  7.  
    do_cleanall Removes all output files, shared state cache, and downloaded source files for a target
  8.  
    do_cleansstate Removes all output files and shared state cache for a target
  9.  
    do_compile Compiles the source in the compilation directory
  10.  
    do_configure Configures the source by enabling and disabling any build-time and configuration options for the software being built
  11.  
    do_devpyshell Starts an interactive Python shell for development/debugging
  12.  
    do_devshell Starts a shell with the environment set up for development/debugging
  13.  
    do_dtv_checking
  14.  
    do_fetch Fetches the source code
  15.  
    do_fetchall Fetches all remote sources required to build a target
  16.  
    do_image
  17.  
    do_image_complete
  18.  
    do_image_complete_setscene (setscene version)
  19.  
    do_image_ext4
  20.  
    do_image_qa
  21.  
    do_image_qa_setscene (setscene version)
  22.  
    do_image_tar
  23.  
    do_install Copies files from the compilation directory to a holding area
  24.  
    do_listtasks Lists all defined tasks for a target
  25.  
    do_package Analyzes the content of the holding area and splits it into subsets based on available packages and files
  26.  
    do_package_qa_setscene Runs QA checks on packaged files (setscene version)
  27.  
    do_package_setscene Analyzes the content of the holding area and splits it into subsets based on available packages and files (setscene version)
  28.  
    do_package_write_rpm Creates the actual RPM packages and places them in the Package Feed area
  29.  
    do_package_write_rpm_setscene Creates the actual RPM packages and places them in the Package Feed area (setscene version)
  30.  
    do_packagedata Creates package metadata used by the build system to generate the final packages
  31.  
    do_packagedata_setscene Creates package metadata used by the build system to generate the final packages (setscene version)
  32.  
    do_patch Locates patch files and applies them to the source code
  33.  
    do_populate_lic Writes license information for the recipe that is collected later when the image is constructed
  34.  
    do_populate_lic_setscene Writes license information for the recipe that is collected later when the image is constructed (setscene version)
  35.  
    do_populate_sdk Creates the file and directory structure for an installable SDK
  36.  
    do_populate_sdk_ext
  37.  
    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)
  38.  
    do_prepare_recipe_sysroot
  39.  
    do_rootfs Creates the root filesystem (file and directory structure) for an image
  40.  
    do_rootfs_wicenv
  41.  
    do_sdk_depends
  42.  
    do_unpack Unpacks the source code into a working directory
  43.  
    do_vp9_checking
  44.  
    NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
  45.  
     

说明上面可以支持的CMD。

接着使用如下命令:

bitbake  -b bbfile -c CMD(before list)

  1.  
    bitbake  -b pulseaudio_10.0 -c compile
  2.  
     
  3.  
    bitbake  -b pulseaudio_10.0 -c clean
  4.  
     
  5.  
    bitbake -b pulseaudio_10.0 -c build
  6.  
     
  7.  
    bitbake  -b pulseaudio_10.0 -c configure
  8.  
     
  9.  
    bitbake  -b pulseaudio_10.0 -c compile
  10.  
     
  11.  
    bitbake  -b pulseaudio_10.0 -c install

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

1,bbappend文件的编译方式

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

  1.  
    # We have a conf and classes directory, add to BBPATH
  2.  
    BBPATH .= ":${LAYERDIR}"
  3.  
    # We have recipes-* directories, add to BBFILES
  4.  
    BBFILES += "${LAYERDIR}/recipes-*/*/*.bb"
  5.  
     
  6.  
    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\(新增)

posted @ 2020-12-03 10:36  fire909090  阅读(2625)  评论(0编辑  收藏  举报