[yocto] devtool finish & patch order

Peter Kjellerstedt peter.kjellerstedt at axis.com
Thu Jun 14 16:11:09 PDT 2018


> -----Original Message-----
> From: yocto-bounces at yoctoproject.org [mailto:yocto-
> bounces at yoctoproject.org] On Behalf Of Alexander Kanavin
> Sent: den 14 juni 2018 09:07
> To: Tim Hammer <tdhammer99 at gmail.com>
> Cc: Yocto discussion list <yocto at yoctoproject.org>
> Subject: Re: [yocto] devtool finish & patch order
> 
> 2018-06-14 7:02 GMT+03:00 Tim Hammer <tdhammer99 at gmail.com>:
> >
> > My changes for U-Boot are not working as expected. I am wondering-
> did I use
> > devtool incorrectly?
> >
> > I used 'devtool modify' to create a working copy of the vendor's u-
> boot and
> > copied & modified files to add support for my custom board. I did my
> work in
> > 3 distinct and commitable steps, resulting in 3 patch files in my
> layer when
> > I ran 'devtool finish'.
> >
> > When I pulled the changes into another clone for validation, it
> appears to
> > be applying patches in reverse order! It is attempting to apply patch
> 003
> > but cannot find the file to modify. That file was created in patch
> 001. None
> > of the files created in patch 001 are in my working directory.
> >
> > I reversed the order of the patch files in the .bbappend file and it
> worked
> > fine.
> >
> > Do I need to use the tool differently to get the patches correctly
> applied?
> 
> Devtool should add newly added patches to the recipe in the same order
> as the commits you created in workdir repo. If that is not the case,
> please provide the steps that reproduce the issue.
> 
> Alex

It should, but there does not seem to be a guarantee that it does. 
To (hopefully) reproduce the problem, here is what I did:

* `devtool modify -w <some simple package>`
* Modify some file, e.g., add some comment to the Makefile.
* Commit it with subject "Change 1"
* Repeat the two steps above two more times, increasing the number in 
  the subject each time.
* `devtool finish <some simple package> <layer where the recipe is>`
* Examine the updated recipe. In my case the patches were in the correct 
  order after this step:

SRC_URI = "<original URI> \
           file://0001-Change-1.patch \
           file://0002-Change-2.patch \
           file://0003-Change-3.patch \
           "

* Not to be discouraged, I started over (using the existing source dir):
* `devtool modify -n <some simple package>`
* `git rebase -i 'HEAD~3'` (in workspace/sources/<some simple package>)
* Use "reword" on the last two commits and change their subject lines 
  to "Another change" and "Some third change".
* `devtool finish <some simple package> <some other layer than where the recipe is>`
* Now I ended up with the following in the new .bbappend file:

SRC_URI += "file://0002-Another-change.patch file://0003-Some-third-change.patch file://0001-Change-1.patch"

Also noteworthy is the different formattings used when updating the 
SRC_URI in the original recipe vs the bbappend file. The format 
used in the bbappend file is not one I would have chosen (personally 
I prefer to use SRC_URI += "..." for each patch, so that no other 
lines need to be modified when adding the first patch or removing 
the last one).

//Peter



More information about the yocto mailing list