[meta-xilinx] Quilt

Harold Lapprich hlapprich at pixel-velocity.com
Tue Jul 7 12:41:59 PDT 2015


To Whom It May Concern,

Need to make a modification to the Yocto Linux kernel using 'Quilt' (xilinx_emacpcs.c file for IEEE15888 PTP Slave Synchronization).

Followed instruction in 'Yocto Project Development, 4.3.2. Using Quilt Workflow' (steps taken in green, steps missing highlighted in red).

Was able to get 'Quilt' to work under 'meta-xilink' which isn't my Yocto development branch. Also 'meta-xilinx' makes use the devicetree infrastructure so the layer is very complicated.

How is a 'Quilt' patch be done for 'meta-xilinx' (should the patch exist within 'meta-xilinx')?

If the patch is to be done against 'meta-xilinx', how is patch to be extracted and integrated so a build can be done (i.e., git meta-xilinx followed by the patch)?


Thanks,
Harold Lapprich

4.3.2. Using a Quilt Workflow

Quilt<http://savannah.nongnu.org/projects/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 temporary source code, test changes, and then preserve the changes in the form of a patch all using Quilt.

Follow these general steps:

1.   Find the Source Code: The temporary source code used by the OpenEmbedded build system is kept in the Build Directory. See the "Finding the Temporary Source Code<http://www.yoctoproject.org/docs/1.6.1/dev-manual/dev-manual.html#finding-the-temporary-source-code>" section to learn how to locate the directory that has the temporary source code for a particular package.

poky/build/tmp/work/zx3_pm3_zynq7-poky-linux-gnueabi/linux-xlnx/3.14-xilinx+git2b48a8aeea7367359f9eebe55c4a09a05227f32b-r0/git/drivers/net/ethernet/xilinx

2.   Change Your Working Directory: You need to be in the directory that has the temporary source code. That directory is defined by the S<http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-S> variable.

poky/build/tmp/work/zx3_pm3_zynq7-poky-linux-gnueabi/linux-xlnx/3.14-xilinx+git2b48a8aeea7367359f9eebe55c4a09a05227f32b-r0/git/drivers/net/ethernet/xilinx

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:

$ mkdir patches

$ quilt new my_changes.patch

$ quilt new patch1.patch

Patch patch1.patch is now on top



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

$quilt add xilinx_emacps.c

File xilinx_emacps.c added to patch patch1.patch



5.   Edit the Files: Make your changes in the temporary source code to the files you added to the patch.
        Index: xilinx/xilinx_emacps.c
        ===================================================================
        --- xilinx.orig/xilinx_emacps.c 2015-07-07 07:42:42.533844236 -0400
        +++ xilinx/xilinx_emacps.c      2015-07-07 07:50:42.000000000 -0400
        @@ -15,10 +15,8 @@
          * TODO:
          * 1. JUMBO frame is not enabled per EPs spec. Please update it if this
          *    support is added in and set MAX_MTU to 9000.
        - * 2. PTP slave mode: Findout and implement the proper equation and algorithm
        - *    for adjusting the hw timer frequency inorder to sync with the master
        - *    clock offset. Also formula for deriving the max adjustable frequency
        - *    value in ppb.
        + * 2. PTP slave mode: Currently master and slave sync is tested for 111MHz and
        + *    125 MHz ptp clock. Need to test with various other clock frequencies.
          */

         .

         .

         .

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

$ bitbake -c compile -f <name_of_package>



$ bitbake -c compile -f linux-yocto

Loading cache: 100% |########################################################################################################################################################| ETA:  00:00:00

Loaded 1841 entries from dependency cache.

Parsing recipes: 100% |######################################################################################################################################################| Time: 00:00:00

Parsing of 1408 .bb files complete (1405 cached, 3 parsed). 1832 targets, 69 skipped, 0 masked, 0 errors.

NOTE: Resolving any missing task queue dependencies



Build Configuration:

BB_VERSION        = "1.22.0"

BUILD_SYS         = "x86_64-linux"

NATIVELSBSTRING   = "Ubuntu-14.04"

TARGET_SYS        = "arm-poky-linux-gnueabi"

MACHINE           = "zx3-pm3-zynq7"

DISTRO            = "poky"

DISTRO_VERSION    = "1.6.2"

TUNE_FEATURES     = " armv7a vfp neon zynq"

TARGET_FPU        = "vfp-neon"

meta

meta-yocto

meta-yocto-bsp

meta-pixel        = "daisy:827dc7f12cf0d9f446c713a4a5b07a87146b77ab"

meta-oe

meta-networking   = "daisy:d3d14d3fcca7fcde362cf0b31411dc4eea6d20aa"

meta-xilinx       = "daisy:fbf7b7cebd3c0f43b6e80c6de7cb771bb848c461"

meta-xilinx-community = "master:6a7ebbc6e895bd87593a2571e43cc5215e45fa52"

meta-enclustra    = "master:49f7fbaa240f5de52de9285a37c4627034fac050"



NOTE: Preparing runqueue

NOTE: Tainting hash to force rebuild of task /home/hlapprich/sven/poky/meta/recipes-kernel/linux/linux-yocto_3.14.bb, do_compile

NOTE: Executing SetScene Tasks

NOTE: Executing RunQueue Tasks

Currently 1 running tasks (258 of 258):

0: linux-yocto-3.14.4+gitAUTOINC+183622e809_cb22733185-r0 do_compile (pid 27006)





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 -c clean or -c cleanall with BitBake for the package. Modifications will also disappear if you use the rm_work feature as described in the "Building an Image<http://www.yoctoproject.org/docs/1.6.1/yocto-project-qs/yocto-project-qs.html#building-image>" section of the Yocto Project Quick Start.

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



$quilt refresh



Refreshed patch patch1.patch



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

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

ls patches



patch1.patch  series



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<http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-SRC_URI> of the recipe. Here is an example:

SRC_URI += "file://my_changes.patch"



cp patches/patch1.patch ~/sven/poky/meta-xilinx/recipes-kernel/linux/files/


        require linux-machine-common.inc

        COMPATIBLE_MACHINE_zynq = "zynq"
        COMPATIBLE_MACHINE_microblaze = "microblaze"
        SRC_URI += "file://patch1.patch"











9.   Increment the Recipe Revision Number: Finally, don't forget to 'bump' the PR<http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-PR> value in the recipe since the resulting packages have changed.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-xilinx/attachments/20150707/81f29bd5/attachment.html>


More information about the meta-xilinx mailing list