All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Ashfield <bruce.ashfield@gmail.com>
To: Paul Barker <paul@betafive.co.uk>
Cc: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/6] kernel-yocto: allow kernel-meta repositories to be patched
Date: Sun, 10 Mar 2019 22:35:56 -0400	[thread overview]
Message-ID: <CADkTA4OjYBPDUkzY=GHGSMfZmKW5=Hg6nrjikwD2vxBCb01hqQ@mail.gmail.com> (raw)
In-Reply-To: <751a6405-4e20-89d6-daf5-664ec775bb7d@betafive.co.uk>

On Sat, Mar 9, 2019 at 5:10 PM Paul Barker <paul@betafive.co.uk> wrote:
>
> On 06/03/2019 16:37, bruce.ashfield@gmail.com wrote:
> > From: Bruce Ashfield <bruce.ashfield@gmail.com>
> >
> > For testing purposes, it is often easier to patch a fragment
> > in a kernel-meta repository versus needing to make a copy or
> > modify the source repository.
> >
> > We can allow this sort of patching when a patchdir of kernel-meta
> > is passed (to indicate the nested kernel-meta repository).
> >
> > Also note that we must patch the meta data before they are
> > processed/gathered, since migrated copies to the kernel source
> > directory will be used later.
> >
> > Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> > ---
> >   meta/classes/kernel-yocto.bbclass | 29 +++++++++++++++++++++++++----
> >   1 file changed, 25 insertions(+), 4 deletions(-)
> >
> > diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
> > index 496c8a7f68..d2b194dd55 100644
> > --- a/meta/classes/kernel-yocto.bbclass
> > +++ b/meta/classes/kernel-yocto.bbclass
> > @@ -5,12 +5,21 @@ PATCH_GIT_USER_NAME ?= "OpenEmbedded"
> >
> >   # returns local (absolute) path names for all valid patches in the
> >   # src_uri
> > -def find_patches(d):
> > +def find_patches(d,subdir):
> >       patches = src_patches(d)
> >       patch_list=[]
> >       for p in patches:
> > -        _, _, local, _, _, _ = bb.fetch.decodeurl(p)
> > -        patch_list.append(local)
> > +        _, _, local, _, _, parm = bb.fetch.decodeurl(p)
> > +        # if patchdir has been passed, we won't be able to apply it so skip
> > +        # the patch for now, and special processing happens later
> > +        patchdir = ''
> > +        if "patchdir" in parm:
> > +            patchdir = parm["patchdir"]
> > +        if patchdir:
>
> Did you mean 'if subdir:' here?

Nope. I did mean if patchdir: here, that doesn't mean it is working perfectly,
but I did definitely mean patchdir.

>
> I'm seeing duplicate attempts to apply a patch listed on SRC_URI in the
> linux-raspberrypi_4.14.bb recipe from meta-raspberrypi. The first
> attempt is in do_kernel_metadata and this succeeds, the second is in
> do_patch and this fails as the patch has already been applied.

Hmm. The only thing that should be patchable in the meta data
gathering is the meta data. Not the kernel source tree. It is just
there as a rough debug / devel trigger. kernel-meta is a separate
repo, so patches are only applied there.

Something that triggers in do_patch can't be patching that same
repo, since the kernel tree is separate ..

Is the raspberrypi recipe using the upstream kernel-cache repo
or is it doing something else ?

Is it also using patches with patchdir specified in the src_uri ?
If it isn't, I can't see how any of this is triggering.

I'm out of the office this week, but this is something I can sort
out .. can you send me the exact set of layers (and any
local.conf I'd need) to trigger this ? I'll have some time tomorrow
night to poke at it a bit.

Bruce

>
> In this case, patchdir = '' as there is no patchdir set for this in the
> recipe. The patch is still picked up when find_patches() is called with
> subdir='kernel-meta' since the test here is false and the comparison
> below is not performed.
>
> > +            if subdir == patchdir:
> > +                patch_list.append(local)
> > +        else:
> > +            patch_list.append(local)
> >
> >       return patch_list
> >
> > @@ -119,8 +128,20 @@ do_kernel_metadata() {
> >               fi
> >       fi
> >
> > +     # was anyone trying to patch the kernel meta data ?, we need to do
> > +     # this here, since the scc commands migrate the .cfg fragments to the
> > +     # kernel source tree, where they'll be used later.
> > +     check_git_config
> > +     patches="${@" ".join(find_patches(d,'kernel-meta'))}"
> > +     for p in $patches; do
> > +         (
> > +             cd ${WORKDIR}/kernel-meta
> > +             git am -s $p
> > +         )
> > +     done
> > +
> >       sccs_from_src_uri="${@" ".join(find_sccs(d))}"
> > -     patches="${@" ".join(find_patches(d))}"
> > +     patches="${@" ".join(find_patches(d,''))}"
> >       feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}"
> >
> >       # a quick check to make sure we don't have duplicate defconfigs
> >
>
> --
> Paul Barker
> Beta Five Ltd



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


  reply	other threads:[~2019-03-11  2:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06 16:37 [PATCH 0/6] linux-yocto: consolidated pull request (5.0 kernel intro) bruce.ashfield
2019-03-06 16:37 ` [PATCH 1/6] kernel-yocto: allow kernel-meta repositories to be patched bruce.ashfield
2019-03-09 22:09   ` Paul Barker
2019-03-11  2:35     ` Bruce Ashfield [this message]
2019-03-11  3:14       ` Bruce Ashfield
2019-03-11  4:01         ` Bruce Ashfield
2019-03-11  4:17           ` Bruce Ashfield
2019-03-06 16:37 ` [PATCH 2/6] linux-libc-headers: update to 5.x headers bruce.ashfield
2019-03-07 15:19   ` Khem Raj
2019-03-07 15:20     ` Khem Raj
2019-03-08 14:48       ` Adrian Bunk
2019-03-08 17:49         ` Khem Raj
2019-03-08 14:24     ` Bruce Ashfield
2019-03-08 17:51       ` Khem Raj
2019-03-06 16:37 ` [PATCH 3/6] linux-yocto: introduce 5.0 versioned recipe bruce.ashfield
2019-03-06 16:37 ` [PATCH 4/6] lttng: add 5.x fixup patches to 2.10.8 release bruce.ashfield
2019-03-06 16:37 ` [PATCH 5/6] linux-yocto/5.0: update configs for h/w reference boards bruce.ashfield
2019-03-06 16:37 ` [PATCH 6/6] machine: bump preferred version to 5.0 bruce.ashfield
2019-03-06 23:05 ` [PATCH 0/6] linux-yocto: consolidated pull request (5.0 kernel intro) Richard Purdie
2019-03-07  4:21   ` Bruce Ashfield
2019-03-07  4:23     ` Bruce Ashfield
2019-03-07 13:04       ` Richard Purdie
2019-03-07 15:48         ` Bruce Ashfield
2019-03-07 22:28           ` Richard Purdie

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='CADkTA4OjYBPDUkzY=GHGSMfZmKW5=Hg6nrjikwD2vxBCb01hqQ@mail.gmail.com' \
    --to=bruce.ashfield@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=paul@betafive.co.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.