Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] refresh patch series of a package
Date: Tue, 15 Mar 2016 22:53:39 +0100	[thread overview]
Message-ID: <20160315215339.GE5053@free.fr> (raw)
In-Reply-To: <dc4e098c9171e359102d277f132176d1@idefix.lespocky.dyndns.org>

Alexander, All,

On 2016-03-15 14:56 +0100, Alexander Dahl spake thusly:
> a lot of packages have one or more patches to be applied after unpacking
> the tarball and before moving on to the next steps of the build process.
> The part of the manual covering this seems to be section 18 [1] and if I
> read it correctly, patches in the format of git-format-patch are
> preferred in style and numbering. Refreshing a patch series can be
> necessary on package version bumps for example. However in contrast to
> OpenWRT [2] and ptxdist [3] there seems to be no tool support or
> documented way how to refresh such a patch stack in buildroot. (Or did I
> miss it?)
> 
> So first question: am I right the patches are currently not applied
> applied with git or quilt or any other tool, but with plain 'patch'?

Yes, you're right. They are applied with plain patch.

> For a maintainer of a package one way to maintain such a patch series
> would be to have a custom branch on top of upstream version control, and
> on a new release rebase the custom branch, export those patches with
> `git format-patch` and manually copy them over to buildroot package
> folder. If not already doing it like this, one would have to import the
> old patches from buildroot package first.

What I do when I need to, is:

    $ git clone git://upstream.url/of/package/foo.git
    $ cd foo
    $ git checkout version-used-by-buildroot
    $ git checkout -b for-buildroot
    $ git am /path/to/buildroot/package/foo/*.patch
            (or I use plain if they are not git patches)
    $ git rebase --onto new-version version-used-by-buildroot for-buildroot
            (and fix conflicts, drop things blabla...)

Then from Buildroot, I use a local.mk:

    $ cat local.mk
    FOO_OVERRIDE_SRCDIR = /path/to/my/foo
    $ make foo-build

If it fails somehow, I go back to foo's git dir, do some more tweaking,
and then go back to Buidlroot:

    $ make foo-reconfigure

And so on until all is correct.

When I'm done with the patches, I just export them:

    $ cd /path/to/buildroot/
    $ rm package/foo/*.patch
    $ cd /path/to/foo
    $ git format-patch -N -o /path/to/buildroot/package/foo/ new-version..for-buildroot

Then the usual git-add and git-rm as needed

Regards,
Yann E. MORIN.

> What ptxdist does to simplify this (stricly speaking "can do", it's
> optional) is basically the following: unpack tarball as usual, create a
> new (temporary) git repo from the unpacked sources, apply additional
> patches with git. Now you have a new git repo with the tarball content
> as initial version and one git commit/changeset per patch. You can now
> edit the sources, do interactive git rebase, do more or less usual git
> based development on top of the original tarball and eventually export
> all the stuff again as patches in the format you want (git patches, the
> same format we use here for changes on buildroot itself) and put it
> directly back to the BSP. Personally I find this a convenient way to
> maintain patch series.
> 
> OpenWRT has some kind of HowTo and works with quilt. Although I didn't
> look deep into it, it seems at least recommended practice over there.
> 
> I'm not (yet?) familiar with buildroot internals. Would an easier and
> unified way to maintain patch series be a feature people would like to
> have? So would it be worth the time developing a solution for this? Or
> would it be too difficult to integrate?
> 
> Greets
> Alex
> 
> P.S.: please keep Christoph in Cc, he's not on the list.
> 
> [1] https://buildroot.org/downloads/manual/manual.html#patch-policy
> [2] https://wiki.openwrt.org/doc/devel/patches
> [3] http://www.pengutronix.de/software/ptxdist/ (currently not
> documented how to recreate patch series, I could tell you ;-) )
> 
> -- 
> ?With the first link, the chain is forged. The first speech censured,
> the first thought forbidden, the first freedom denied, chains us all
> irrevocably.? (Jean-Luc Picard, quoting Judge Aaron Satie)
> *** GnuPG-FP: C28E E6B9 0263 95CF 8FAF  08FA 34AD CD00 7221 5CC6 ***
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

      reply	other threads:[~2016-03-15 21:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 13:56 [Buildroot] refresh patch series of a package Alexander Dahl
2016-03-15 21:53 ` Yann E. MORIN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160315215339.GE5053@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox