zoukankan      html  css  js  c++  java
  • yocto 使用quilt进行打包

    Using Quilt in Your Workflow

    Quilt is a powerful tool that allows you to capture source code changes without having a clean source tree. This section outlines the typical workflow you can use to modify source code, test changes, and then preserve the changes in the form of a patch all using Quilt.

    Tip

    With regard to preserving changes to source files, if you clean a recipe or have rm_work enabled, the devtool workflow as described in the Yocto Project Application Development and the Extensible Software Development Kit (eSDK) manual is a safer development flow than the flow that uses Quilt.

    Follow these general steps:

    1. Find the Source Code: Temporary source code used by the OpenEmbedded build system is kept in the Build Directory. See the "Finding Temporary Source Code" section to learn how to locate the directory that has the temporary source code for a particular package.

    2. Change Your Working Directory: You need to be in the directory that has the temporary source code. That directory is defined by the Svariable.

    3. Create a New Patch: Before modifying source code, you need to create a new patch. To create a new patch file, use quilt new as below:

           $ quilt new my_changes.patch
                          
    4. Notify Quilt and Add Files: After creating the patch, you need to notify Quilt about the files you plan to edit. You notify Quilt by adding the files to the patch you just created:

           $ quilt add file1.c file2.c file3.c
                          
    5. Edit the Files: Make your changes in the source code to the files you added to the patch.

    6. Test Your Changes: Once you have modified the source code, the easiest way to test your changes is by calling the do_compile task as shown in the following example:

           $ bitbake -c compile -f package

      The -f or --force option forces the specified task to execute. If you find problems with your code, you can just keep editing and re-testing iteratively until things work as expected.

      Note

      All the modifications you make to the temporary source code disappear once you run the do_clean or do_cleanall tasks using BitBake (i.e. bitbake -c clean package and bitbake -c cleanall package). Modifications will also disappear if you use therm_work feature as described in the "Conserving Disk Space During Builds" section.
    7. Generate the Patch: Once your changes work as expected, you need to use Quilt to generate the final patch that contains all your modifications.

           $ quilt refresh
                          

      At this point, the my_changes.patch file has all your edits made to the file1.cfile2.c, and file3.c files.

      You can find the resulting patch file in the patches/ subdirectory of the source (S) directory.

    8. Copy the Patch File: For simplicity, copy the patch file into a directory named files, which you can create in the same directory that holds the recipe (.bb) file or the append (.bbappend) file. Placing the patch here guarantees that the OpenEmbedded build system will find the patch. Next, add the patch into the SRC_URI of the recipe. Here is an example:

        MY_PATCH_DIR="${TMPDIR}/需要打patch的文件路径"

        SRC_URI += "file://my_changes.patch; patchdir=${MY_PATCH_DIR}"

  • 相关阅读:
    [轉]javascript 的 location 各種用法
    [轉]PHP命名空间规则解析及高级功能
    [轉]虚拟机随谈(一):解释器,树遍历解释器,基于栈与基于寄存器
    [轉]深入理解SQL Server 2005 中的 COLUMNS_UPDATED函数
    [連接]JavaScript中链式调用之研习
    [轉]安装SQL SERVER 2008时,提示:服务SQLBrowser启动请求失败
    AS支除兩邊的空格
    [轉]详解UML六大关系(依赖、类属(继承)、关联、实现、聚合和组合)
    [轉]jQuery UI 关闭父窗口打开的Dialog
    [轉]让PHP支持像jQuery那样的链式操作
  • 原文地址:https://www.cnblogs.com/fire909090/p/11022491.html
Copyright © 2011-2022 走看看