From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yann E. MORIN Date: Tue, 15 Mar 2016 22:53:39 +0100 Subject: [Buildroot] refresh patch series of a package In-Reply-To: References: Message-ID: <20160315215339.GE5053@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net 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. | '------------------------------^-------^------------------^--------------------'