[meta-xilinx] Yocto quilt/patch Issue

Nathan Rossi nathan at nathanrossi.com
Fri Jul 10 07:55:55 PDT 2015


On Sat, Jul 11, 2015 at 12:17 AM, Harold Lapprich
<hlapprich at pixel-velocity.com> wrote:
> Hi Nathan,
>
> Was able to resolve the issue yesterday but the problems are due to issues with Yocto Linux 3.14 and bitbake 1.22.0. The problems are not in 3.17 and bitbake 1.24.0, the Yocto documentation available (and the URL links you provided point to the most current)  with respect to Linux 3.17 which makes trying to come up with a solution even more difficult. There seems to be no information on changes from update to update and therefore one isn't able to reference the proper Yocto material for the release they're working on. Another words there is a release documentation control mechanism missing within Yocto that should be addressed but I am not a member of the distribution community but this does need addressing.

Its good to hear you have resolved your issue. I have just noticed
(after re-reading your previous email again) where you may have gone
off track.

It appears that you want to add a patch to the linux-xlnx_3.14 kernel.
In your previous email you were doing this by modifying the recipes in
meta-xilinx (which is ok, however they will be local changes).

I noticed that you had added the patch file to
"meta-xilinx/receipes-kernel/linux/files" which is good. However you
added the patch configuration to the linux-yocto_3.14.bbappend recipe.
This is a separate kernel recipe and when building the linux-xlnx_3.14
kernel has no affect its configuration/patches.

You should instead have added those lines (the ones copied below) to
the "linux-xlnx_3.14.bb" file instead.
                                        FILESEXTRAPATHS_prepend :=
"${THISDIR}/files:"
                                        SRC_URI +=
"file://IEEE1588PTP_Slave_Sync.patch;patch=1"

This is why when trying to clean and rebuild the patch was not
applying. As although the patch file was put in the layer, the
configuration was not put in the kernel that you wanted to build.

I assume this may have arisen from a misunderstanding of the two
available kernels "linux-yocto" and "linux-xlnx" as well as the
documentation specifically stating linux-yocto in its examples. To
clarify, yocto can have recipes for more then one kernel, in the
meta-xilinx layer for example there is two variants (linux-xlnx and
linux-yocto) and multiple versions of those variants. By default the
linux-xlnx kernel is used for zynq machines this however can be
changed.

It would be great if you could confirm this is the case. Or if not
would you be able to elaborate more on the issue?

==

Also in reference to the documentation you can access older versions
for prior Yocto/OE releases via:
https://www.yoctoproject.org/documentation/archived

or simply changing the version number in the url:
http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#patching-the-kernel
http://www.yoctoproject.org/docs/1.7.2/dev-manual/dev-manual.html#patching-the-kernel
http://www.yoctoproject.org/docs/1.7.1/dev-manual/dev-manual.html#patching-the-kernel
http://www.yoctoproject.org/docs/1.7/dev-manual/dev-manual.html#patching-the-kernel
etc.

Regards,
Nathan

>
> Thanks,
> Harold
>
> -----Original Message-----
> From: Nathan Rossi [mailto:nathan at nathanrossi.com]
> Sent: Friday, July 10, 2015 5:00 AM
> To: Harold Lapprich
> Cc: meta-xilinx at yoctoproject.org
> Subject: Re: [meta-xilinx] Yocto quilt/patch Issue
>
> On Thu, Jul 9, 2015 at 7:11 AM, Harold Lapprich <hlapprich at pixel-velocity.com> wrote:
>> To Whom It May Concern,
>>
>>
>>
>>
>>
>> Been an embedded Unix/Linux developers for years and started using
>> Yocto about 5 months ago.
>>
>>
>>
>> Have gotten to the point where I need to make changes to the 'meta-xilinx'
>> kernel layer.
>>
>
> It is unlikely that you need to make changes to the meta-xilinx layer.
> This is because the major flexibility of Yocto/OE is that you can make a layer that overrides or appends to the existing recipes.
>
> I recommend you have a read of the wealth of documentation. Some of the key sections linked below:
> http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#developing-a-board-support-package-bsp
> http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#patching-the-kernel
>
> The following are the most important for your use case:
> http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#create-a-layer-for-your-changes
> http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#creating-the-patch
> http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#set-up-your-layer-for-the-build
>
>>
>>
>> Trying to use 'quilt' for development and 'git' for patching. Can make
>> changes in the temporary development directory, build and test without
>> a problem. But when I try to make a 'quilt' or 'git' patch for a
>> permanant record I can't get it to work. Able to create the patch file using 'quilt'
>> and 'git' but when integrated into the 'meta-xlinx/receipe-kernel/linux'
>> directory nothing works.
>
> For reference the kernel recipes are slightly different to the majority of other recipes in yocto. This is because the kernel recipes manage the source slightly different. I recommend using the git steps documented in the "creating-the-patch" section linked above. But it doesn't particularly matter how you obtain the patch file.
>
>>
>>
>>
>>
>>
>> Using 'Yocto Project Developent Manual' as my user guide:
>>
>>
>>
>>                Quilt
>>
>>
>>
>>                               4. Modifying Source Code
>>
>>                                              4.3.3 Using Quilt in Your
>> Workflow
>>
>>                                                             cd
>> temporary build directory
>>
>>                                                             mkdir
>> patches
>>
>>                                                             quilt new
>> my_changes.patch
>>
>>                                                             quilt add
>> file
>>
>>                                                             build &
>> test changes (i.e. bitbake virtual/kernel -c clean, bitbake
>> virtual/kernel)
>>
>>                                                             quilt
>> refresh
>>
>>
>> IEEE1588PTP_Slave_Sync.patch (more the file to check the content)
>>
>>
>>
>>                                                             Quilt
>> Patch
>> (meta-xilinx/receipes-kernel/linux/)
>>
>>
>>
>>
>> linux-xlnx_3.14.bb
>>
>>
>>
>>
>> include linux-xlnx.inc
>>
>>
>>
>>                                         PR = "r1"
>>
>>
>>
>>                                         # Kernel version and SRCREV
>> correspond to: xlnx_3.14 branch
>>
>>                                         KBRANCH = "xlnx_3.14"
>>
>>                                         LINUX_VERSION = "3.14"
>>
>>                                         SRCREV =
>> "2b48a8aeea7367359f9eebe55c4a09a05227f32b"
>>
>>
>>
>>
>> linux-yocto_3.14.bbappend
>>
>>
>>
>>
>> require linux-machine-common.inc
>>
>>
>>
>>
>>
>>                                         FILESEXTRAPATHS_prepend :=
>> "${THISDIR}/files:"
>>
>>                                         SRC_URI +=
>> "file://IEEE1588PTP_Slave_Sync.patch;patch=1"
>>
>>
>>
>>
>>
>>
>> cp patch file (meta-xilinx/receipes-kernel/linux/files
>>
>>
>>
>>
>> IEEE1588PTP_Slave_Sync.patch
>
> So the idea is to move these recipe changes into your layer with a bbappend for the linux-xlnx kernel.
>
> e.g.
> meta-mylayer/recipes-kernel/linux/linux-xlnx_3.14.bbappend:
> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> SRC_URI += "file://IEEE1588PTP_Slave_Sync.patch"
>
> With the patch located:
> meta-mylayer/recipes-kernel/linux/files/IEEE1588PTP_Slave_Sync.patch
>
>>
>>
>>
>>
>> bitbake virtual/kernel -c clean (patch is now perserved so cleaning
>> isn't a
>> problem)
>>
>>
>>
>>
>> bitbake virtual/kernel -c compile
>>
>>
>>
>>                                       No errors, check the time stamp
>> on the file to be patched and it is updated
>>
>>
>>
>>                            more file and the patch has not been applied.
>>
>>
>>
>>
>>
>> Have searched the web and read a number of articles beside Yocto
>> document and nothing works (this was a nice article:
>> http://wp.angstrom-distribution.org/openembeddedangstrom-kernel-workflow/).
>>
>>
>>
>> Is there an issue with making a patch in the 'meta-xilinx' layer?
>>
>
> There are no issues with patches for the meta-xilinx layer however there are many things that need to be considered. In this case the patch would be for the kernel and as such likely not be accepted as the meta-xilinx layer does not maintain the kernel linux-xlnx (the only patches that get applied in the meta-xilinx layer are major bug fixes), this is the role of Xilinx OSL, you would need to submit the patch to git at xilinx.com or to the mainline linux kernel. And you changes would then come through and be available in the meta-xilinx layer with the newer kernels.
>
>>
>>
>> Removed the patch from the files directory and 'bitbake' complains so
>> it is being seen, is the patch applied to the file so one can 'more'
>> it to verify the changes?
>>
>>
>>
>> Really have been working this issue and any input from the
>> 'meta-xilinx' and 'yocto' community would be appreciated (shouldn't be
>> this difficult or developers wouldn't be using the tool).
>>
>
> I think you have gotten 50% of the way based on your description, you just need to make a separate layer for you modifications to the kernel.
>
> Regards,
> Nathan
>
>>
>>
>> Thanks,
>>
>> Harold
>>
>>
>>
>>
>>
>>
>> --
>> _______________________________________________
>> meta-xilinx mailing list
>> meta-xilinx at yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/meta-xilinx
>>



More information about the meta-xilinx mailing list