* Problem with applying a patch using default -pnum
@ 2013-03-07 12:12 Hans Beckérus
2013-03-07 12:33 ` Hans Beckérus
2013-03-07 18:14 ` Paul Eggleton
0 siblings, 2 replies; 9+ messages in thread
From: Hans Beckérus @ 2013-03-07 12:12 UTC (permalink / raw)
To: yocto
Hi. More problems ;)
I have a patch file that needs to be applied to a source tree and the
patch file is copied properly to the ${WORKDIR} directory.
So far so good. But, the problem with this source tree is that it is
not built from the traditional root folder of the repo.
This means I need to change ${S} to point somewhere else. This also
causes the patch system to fail!
I did an override of do_patch() in my .bb and that seems to work, but
I do not like to use overrides unless I really have to.
So basically, is there some way to tell the built-in patch system to
use a different -pnum value?
If there is, I could stick with the do_patch() as provided by default.
Hans
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Problem with applying a patch using default -pnum
2013-03-07 12:12 Problem with applying a patch using default -pnum Hans Beckérus
@ 2013-03-07 12:33 ` Hans Beckérus
2013-03-07 19:11 ` Jerrod Peach
2013-03-07 18:14 ` Paul Eggleton
1 sibling, 1 reply; 9+ messages in thread
From: Hans Beckérus @ 2013-03-07 12:33 UTC (permalink / raw)
To: yocto
On Thu, Mar 7, 2013 at 1:12 PM, Hans Beckérus <hans.beckerus@gmail.com> wrote:
> Hi. More problems ;)
> I have a patch file that needs to be applied to a source tree and the
> patch file is copied properly to the ${WORKDIR} directory.
> So far so good. But, the problem with this source tree is that it is
> not built from the traditional root folder of the repo.
> This means I need to change ${S} to point somewhere else. This also
> causes the patch system to fail!
> I did an override of do_patch() in my .bb and that seems to work, but
> I do not like to use overrides unless I really have to.
> So basically, is there some way to tell the built-in patch system to
> use a different -pnum value?
> If there is, I could stick with the do_patch() as provided by default.
>
> Hans
Hmm, ok a correction from my side. Forget parts of what I said ;)
The patch system does not seem to use the value of ${S}, it is using
${WORKDIR} as the root for patching, this is also where the patch file
is placed. The problem in my case does not seem to be that is built
from a non-standard path. The reason why it fails seems to be because
the actual source is not in ${WORKDIR}, it is in ${WORKDIR}/git. The
patch file does include git as part of the source path for obvious
reasons. What am I doing wrong? Having actual source code in
${WORKDIR}/git I assume is very common for git based downloads.
Hans
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Problem with applying a patch using default -pnum
2013-03-07 12:33 ` Hans Beckérus
@ 2013-03-07 19:11 ` Jerrod Peach
2013-03-07 19:43 ` Hans Beckerus
0 siblings, 1 reply; 9+ messages in thread
From: Jerrod Peach @ 2013-03-07 19:11 UTC (permalink / raw)
To: Hans Beckérus; +Cc: yocto
[-- Attachment #1: Type: text/plain, Size: 2642 bytes --]
Hans,
Are you sure you're seeing the patch system use $WORKDIR instead of $S as
the root for patching? I've had to do a lot of patching in our own layers
recently and I've always seen $S used as the root for the patch. Are you
explicitly setting S = "${WORKDIR}/git"? That's what we do for our git
recipes. That's how you get the system to recognize the source somewhere
other than just $WORKDIR.
As for specifying a different -pnum, you absolutely can do that like so:
*SRC_URI += "file://my-change.patch;striplevel=X"*
X is the pnum that you want. Its default value is 1.
You may also find this page useful -- it contains all sorts of hints for
setting up your recipes in a Yocto-standard way:
https://wiki.yoctoproject.org/wiki/Recipe_&_Patch_Style_Guide
That's where I learned about striplevel and the preference for it over the
deprecated pnum parameter.
Kind regards,
Jerrod
On Thu, Mar 7, 2013 at 7:33 AM, Hans Beckérus <hans.beckerus@gmail.com>wrote:
> On Thu, Mar 7, 2013 at 1:12 PM, Hans Beckérus <hans.beckerus@gmail.com>
> wrote:
> > Hi. More problems ;)
> > I have a patch file that needs to be applied to a source tree and the
> > patch file is copied properly to the ${WORKDIR} directory.
> > So far so good. But, the problem with this source tree is that it is
> > not built from the traditional root folder of the repo.
> > This means I need to change ${S} to point somewhere else. This also
> > causes the patch system to fail!
> > I did an override of do_patch() in my .bb and that seems to work, but
> > I do not like to use overrides unless I really have to.
> > So basically, is there some way to tell the built-in patch system to
> > use a different -pnum value?
> > If there is, I could stick with the do_patch() as provided by default.
> >
> > Hans
>
> Hmm, ok a correction from my side. Forget parts of what I said ;)
> The patch system does not seem to use the value of ${S}, it is using
> ${WORKDIR} as the root for patching, this is also where the patch file
> is placed. The problem in my case does not seem to be that is built
> from a non-standard path. The reason why it fails seems to be because
> the actual source is not in ${WORKDIR}, it is in ${WORKDIR}/git. The
> patch file does include git as part of the source path for obvious
> reasons. What am I doing wrong? Having actual source code in
> ${WORKDIR}/git I assume is very common for git based downloads.
>
> Hans
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
[-- Attachment #2: Type: text/html, Size: 3769 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Problem with applying a patch using default -pnum
2013-03-07 19:11 ` Jerrod Peach
@ 2013-03-07 19:43 ` Hans Beckerus
2013-03-07 21:01 ` Jerrod Peach
0 siblings, 1 reply; 9+ messages in thread
From: Hans Beckerus @ 2013-03-07 19:43 UTC (permalink / raw)
To: Jerrod Peach; +Cc: yocto
[-- Attachment #1: Type: text/plain, Size: 3925 bytes --]
On 2013-03-07 8:11, Jerrod Peach wrote:
> Hans,
>
> Are you sure you're seeing the patch system use $WORKDIR instead of $S
> as the root for patching? I've had to do a lot of patching in our own
> layers recently and I've always seen $S used as the root for the
> patch. Are you explicitly setting S = "${WORKDIR}/git"? That's what
> we do for our git recipes. That's how you get the system to recognize
> the source somewhere other than just $WORKDIR.
>
> As for specifying a different -pnum, you absolutely can do that like so:
>
> /SRC_URI += "file://my-change.patch*;striplevel=X*"/
>
> X is the pnum that you want. Its default value is 1.
>
> You may also find this page useful -- it contains all sorts of hints
> for setting up your recipes in a Yocto-standard way:
>
> https://wiki.yoctoproject.org/wiki/Recipe_&_Patch_Style_Guide
>
> That's where I learned about striplevel and the preference for it over
> the deprecated pnum parameter.
>
> Kind regards,
>
> Jerrod
>
>
Hi Jarod. Thanks, the pointer you gave will most certainly be of great
aid. I will try the striplevel approach
instead of writing my own do_patch() override.
Regarding how certain I am that the root folder is ${WORKDIR} when
patching, not at all ;)
In my do_patch() function is simply did `pwd` and it was not set to ${S}
as I set it to.
That does not mean that the built-in patch system is using ${WORKDIR}, I
am aware of that.
Things here is, even though my patch is placed in ${W} and I set ${S} to
eg. ${W}/git/some/folder,
why would it not work? In another package I set ${S} to ${WORKDIR}/git
and it works
just fine. I can not understand why setting ${S} to something else
breaks the logic?
It's not that bitbake can not find the patch file, it definitely does
that, but the -pnum seems to get
messed up. But maybe that is the whole point of having the striplevel=X
in the first place.
Hans
>
>
>
>
> On Thu, Mar 7, 2013 at 7:33 AM, Hans Beckérus <hans.beckerus@gmail.com
> <mailto:hans.beckerus@gmail.com>> wrote:
>
> On Thu, Mar 7, 2013 at 1:12 PM, Hans Beckérus
> <hans.beckerus@gmail.com <mailto:hans.beckerus@gmail.com>> wrote:
> > Hi. More problems ;)
> > I have a patch file that needs to be applied to a source tree
> and the
> > patch file is copied properly to the ${WORKDIR} directory.
> > So far so good. But, the problem with this source tree is that it is
> > not built from the traditional root folder of the repo.
> > This means I need to change ${S} to point somewhere else. This also
> > causes the patch system to fail!
> > I did an override of do_patch() in my .bb and that seems to
> work, but
> > I do not like to use overrides unless I really have to.
> > So basically, is there some way to tell the built-in patch system to
> > use a different -pnum value?
> > If there is, I could stick with the do_patch() as provided by
> default.
> >
> > Hans
>
> Hmm, ok a correction from my side. Forget parts of what I said ;)
> The patch system does not seem to use the value of ${S}, it is using
> ${WORKDIR} as the root for patching, this is also where the patch file
> is placed. The problem in my case does not seem to be that is built
> from a non-standard path. The reason why it fails seems to be because
> the actual source is not in ${WORKDIR}, it is in ${WORKDIR}/git. The
> patch file does include git as part of the source path for obvious
> reasons. What am I doing wrong? Having actual source code in
> ${WORKDIR}/git I assume is very common for git based downloads.
>
> Hans
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
> https://lists.yoctoproject.org/listinfo/yocto
>
>
[-- Attachment #2: Type: text/html, Size: 7109 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Problem with applying a patch using default -pnum
2013-03-07 19:43 ` Hans Beckerus
@ 2013-03-07 21:01 ` Jerrod Peach
2013-03-07 21:22 ` Hans Beckerus
0 siblings, 1 reply; 9+ messages in thread
From: Jerrod Peach @ 2013-03-07 21:01 UTC (permalink / raw)
To: Hans Beckerus; +Cc: yocto
[-- Attachment #1: Type: text/plain, Size: 2457 bytes --]
On Thu, Mar 7, 2013 at 2:43 PM, Hans Beckerus <hans.beckerus@gmail.com>wrote:
> On 2013-03-07 8:11, Jerrod Peach wrote:
>
> Hans,
>
> Are you sure you're seeing the patch system use $WORKDIR instead of $S
> as the root for patching? I've had to do a lot of patching in our own
> layers recently and I've always seen $S used as the root for the patch.
> Are you explicitly setting S = "${WORKDIR}/git"? That's what we do for
> our git recipes. That's how you get the system to recognize the source
> somewhere other than just $WORKDIR.
>
> As for specifying a different -pnum, you absolutely can do that like so:
>
> *SRC_URI += "file://my-change.patch;striplevel=X"*
>
> X is the pnum that you want. Its default value is 1.
>
> You may also find this page useful -- it contains all sorts of hints for
> setting up your recipes in a Yocto-standard way:
>
> https://wiki.yoctoproject.org/wiki/Recipe_&_Patch_Style_Guide
>
> That's where I learned about striplevel and the preference for it over
> the deprecated pnum parameter.
>
> Kind regards,
>
> Jerrod
>
>
> Hi Jarod. Thanks, the pointer you gave will most certainly be of great
> aid. I will try the striplevel approach
> instead of writing my own do_patch() override.
> Regarding how certain I am that the root folder is ${WORKDIR} when
> patching, not at all ;)
> In my do_patch() function is simply did `pwd` and it was not set to ${S}
> as I set it to.
> That does not mean that the built-in patch system is using ${WORKDIR}, I
> am aware of that.
> Things here is, even though my patch is placed in ${W} and I set ${S} to
> eg. ${W}/git/some/folder,
> why would it not work? In another package I set ${S} to ${WORKDIR}/git and
> it works
> just fine. I can not understand why setting ${S} to something else breaks
> the logic?
> It's not that bitbake can not find the patch file, it definitely does
> that, but the -pnum seems to get
> messed up. But maybe that is the whole point of having the striplevel=X in
> the first place.
>
> Hans
>
>
pnum/striplevel's purpose is to strip off the leading paths from a patch
file. If you're having trouble understanding how that works, this link
might help:
http://drupal.org/patch/apply#comment-239397
Changing $S to a different depth and having do_patch() fail is certainly
expected behavior if you don't change the value of striplevel. Does that
answer your question?
[-- Attachment #2: Type: text/html, Size: 4107 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Problem with applying a patch using default -pnum
2013-03-07 21:01 ` Jerrod Peach
@ 2013-03-07 21:22 ` Hans Beckerus
0 siblings, 0 replies; 9+ messages in thread
From: Hans Beckerus @ 2013-03-07 21:22 UTC (permalink / raw)
To: Jerrod Peach; +Cc: yocto
[-- Attachment #1: Type: text/plain, Size: 3132 bytes --]
On 2013-03-07 10:01, Jerrod Peach wrote:
>
>
>
> On Thu, Mar 7, 2013 at 2:43 PM, Hans Beckerus <hans.beckerus@gmail.com
> <mailto:hans.beckerus@gmail.com>> wrote:
>
> On 2013-03-07 8:11, Jerrod Peach wrote:
>> Hans,
>>
>> Are you sure you're seeing the patch system use $WORKDIR instead
>> of $S as the root for patching? I've had to do a lot of patching
>> in our own layers recently and I've always seen $S used as the
>> root for the patch. Are you explicitly setting S =
>> "${WORKDIR}/git"? That's what we do for our git recipes. That's
>> how you get the system to recognize the source somewhere other
>> than just $WORKDIR.
>>
>> As for specifying a different -pnum, you absolutely can do that
>> like so:
>>
>> /SRC_URI += "file://my-change.patch*;striplevel=X*"/
>>
>> X is the pnum that you want. Its default value is 1.
>>
>> You may also find this page useful -- it contains all sorts of
>> hints for setting up your recipes in a Yocto-standard way:
>>
>> https://wiki.yoctoproject.org/wiki/Recipe_&_Patch_Style_Guide
>>
>> That's where I learned about striplevel and the preference for it
>> over the deprecated pnum parameter.
>>
>> Kind regards,
>>
>> Jerrod
>>
>>
> Hi Jarod. Thanks, the pointer you gave will most certainly be of
> great aid. I will try the striplevel approach
> instead of writing my own do_patch() override.
> Regarding how certain I am that the root folder is ${WORKDIR} when
> patching, not at all ;)
> In my do_patch() function is simply did `pwd` and it was not set
> to ${S} as I set it to.
> That does not mean that the built-in patch system is using
> ${WORKDIR}, I am aware of that.
> Things here is, even though my patch is placed in ${W} and I set
> ${S} to eg. ${W}/git/some/folder,
> why would it not work? In another package I set ${S} to
> ${WORKDIR}/git and it works
> just fine. I can not understand why setting ${S} to something else
> breaks the logic?
> It's not that bitbake can not find the patch file, it definitely
> does that, but the -pnum seems to get
> messed up. But maybe that is the whole point of having the
> striplevel=X in the first place.
>
> Hans
>
>
> pnum/striplevel's purpose is to strip off the leading paths from a
> patch file. If you're having trouble understanding how that works,
> this link might help:
>
> http://drupal.org/patch/apply#comment-239397
>
> Changing $S to a different depth and having do_patch() fail is
> certainly expected behavior if you don't change the value of
> striplevel. Does that answer your question?
Yes, I am fully aware of how -pnum works. My confusion was based on how
bitbake will assume a certain depth and use that as default.
Actually it could have been more clever by doing a comparison between $W
(or patch file location), the patch itself, and $S.
Anyway, you did answer my question. Thanks. I will try the striplevel
tomorrow when I am back at work.
Hans
[-- Attachment #2: Type: text/html, Size: 6671 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem with applying a patch using default -pnum
2013-03-07 12:12 Problem with applying a patch using default -pnum Hans Beckérus
2013-03-07 12:33 ` Hans Beckérus
@ 2013-03-07 18:14 ` Paul Eggleton
1 sibling, 0 replies; 9+ messages in thread
From: Paul Eggleton @ 2013-03-07 18:14 UTC (permalink / raw)
To: Hans Beckérus; +Cc: yocto
On Thursday 07 March 2013 13:12:57 Hans Beckérus wrote:
> I have a patch file that needs to be applied to a source tree and the
> patch file is copied properly to the ${WORKDIR} directory.
> So far so good. But, the problem with this source tree is that it is
> not built from the traditional root folder of the repo.
> This means I need to change ${S} to point somewhere else. This also
> causes the patch system to fail!
> I did an override of do_patch() in my .bb and that seems to work, but
> I do not like to use overrides unless I really have to.
> So basically, is there some way to tell the built-in patch system to
> use a different -pnum value?
Yes there is - use the striplevel parameter e.g (from make_3.82.bb):
file://make-savannah-bug30612-handling_of_archives.patch;striplevel=0
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Problem with applying a patch using default -pnum
@ 2013-03-08 1:49 Daniel Lazzari
2013-03-08 17:10 ` Hans Beckérus
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Lazzari @ 2013-03-08 1:49 UTC (permalink / raw)
To: yocto@yoctoproject.org
> On 2013-03-07 8:11, Jerrod Peach wrote:
> > Hans,
> >
> > Are you sure you're seeing the patch system use $WORKDIR instead of $S
> > as the root for patching? I've had to do a lot of patching in our own
> > layers recently and I've always seen $S used as the root for the
> > patch. Are you explicitly setting S = "${WORKDIR}/git"? That's what
> > we do for our git recipes. That's how you get the system to recognize
> > the source somewhere other than just $WORKDIR.
> >
> > As for specifying a different -pnum, you absolutely can do that like so:
> >
> > /SRC_URI += "file://my-change.patch*;striplevel=X*"/
> >
> > X is the pnum that you want. Its default value is 1.
> >
> > You may also find this page useful -- it contains all sorts of hints
> > for setting up your recipes in a Yocto-standard way:
> >
> > https://wiki.yoctoproject.org/wiki/Recipe_&_Patch_Style_Guide
> >
> > That's where I learned about striplevel and the preference for it over
> > the deprecated pnum parameter.
> >
> > Kind regards,
> >
> > Jerrod
> >
> >
> Hi Jarod. Thanks, the pointer you gave will most certainly be of great aid. I will
> try the striplevel approach instead of writing my own do_patch() override.
> Regarding how certain I am that the root folder is ${WORKDIR} when
> patching, not at all ;) In my do_patch() function is simply did `pwd` and it was
> not set to ${S} as I set it to.
> That does not mean that the built-in patch system is using ${WORKDIR}, I am
> aware of that.
> Things here is, even though my patch is placed in ${W} and I set ${S} to eg.
> ${W}/git/some/folder, why would it not work? In another package I set ${S}
> to ${WORKDIR}/git and it works just fine. I can not understand why setting
> ${S} to something else breaks the logic?
> It's not that bitbake can not find the patch file, it definitely does that, but the
> -pnum seems to get messed up. But maybe that is the whole point of having
> the striplevel=X in the first place.
>
> Hans
>
>
> >
> >
> >
> >
> > On Thu, Mar 7, 2013 at 7:33 AM, Hans Beck?rus <hans.beckerus@gmail.com
> > <mailto:hans.beckerus@gmail.com>> wrote:
> >
> > On Thu, Mar 7, 2013 at 1:12 PM, Hans Beck?rus
> > <hans.beckerus@gmail.com <mailto:hans.beckerus@gmail.com>>
> wrote:
> > > Hi. More problems ;)
> > > I have a patch file that needs to be applied to a source tree
> > and the
> > > patch file is copied properly to the ${WORKDIR} directory.
> > > So far so good. But, the problem with this source tree is that it is
> > > not built from the traditional root folder of the repo.
> > > This means I need to change ${S} to point somewhere else. This also
> > > causes the patch system to fail!
> > > I did an override of do_patch() in my .bb and that seems to
> > work, but
> > > I do not like to use overrides unless I really have to.
> > > So basically, is there some way to tell the built-in patch system to
> > > use a different -pnum value?
> > > If there is, I could stick with the do_patch() as provided by
> > default.
> > >
> > > Hans
> >
> > Hmm, ok a correction from my side. Forget parts of what I said ;)
> > The patch system does not seem to use the value of ${S}, it is using
> > ${WORKDIR} as the root for patching, this is also where the patch file
> > is placed. The problem in my case does not seem to be that is built
> > from a non-standard path. The reason why it fails seems to be because
> > the actual source is not in ${WORKDIR}, it is in ${WORKDIR}/git. The
> > patch file does include git as part of the source path for obvious
> > reasons. What am I doing wrong? Having actual source code in
> > ${WORKDIR}/git I assume is very common for git based downloads.
> >
> > Hans
> > _______________________________________________
> > yocto mailing list
> > yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
> > https://lists.yoctoproject.org/listinfo/yocto
> >
> >
I also found another useful patch param called patchdir that sets the directory from which the patch is applied. This is useful when ${S} is set to a directory deeper than you want to patch from but don't want to mess with setting ${S}. I needed it to apply a patch to wpa_supplicant's src directory.
Ex.
file://gpio-sysfs-power-onoff-change.patch;patchdir=${WORKDIR}/wpa_supplicant-${PV}
Daniel Lazzari Jr.
Firmware Engineer
dlazzari@leapfrog.com
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Problem with applying a patch using default -pnum
2013-03-08 1:49 Daniel Lazzari
@ 2013-03-08 17:10 ` Hans Beckérus
0 siblings, 0 replies; 9+ messages in thread
From: Hans Beckérus @ 2013-03-08 17:10 UTC (permalink / raw)
To: Daniel Lazzari; +Cc: yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 5216 bytes --]
On Fri, Mar 8, 2013 at 2:49 AM, Daniel Lazzari <dlazzari@leapfrog.com>wrote:
> > On 2013-03-07 8:11, Jerrod Peach wrote:
> > > Hans,
> > >
> > > Are you sure you're seeing the patch system use $WORKDIR instead of $S
> > > as the root for patching? I've had to do a lot of patching in our own
> > > layers recently and I've always seen $S used as the root for the
> > > patch. Are you explicitly setting S = "${WORKDIR}/git"? That's what
> > > we do for our git recipes. That's how you get the system to recognize
> > > the source somewhere other than just $WORKDIR.
> > >
> > > As for specifying a different -pnum, you absolutely can do that like
> so:
> > >
> > > /SRC_URI += "file://my-change.patch*;striplevel=X*"/
> > >
> > > X is the pnum that you want. Its default value is 1.
> > >
> > > You may also find this page useful -- it contains all sorts of hints
> > > for setting up your recipes in a Yocto-standard way:
> > >
> > > https://wiki.yoctoproject.org/wiki/Recipe_&_Patch_Style_Guide
> > >
> > > That's where I learned about striplevel and the preference for it over
> > > the deprecated pnum parameter.
> > >
> > > Kind regards,
> > >
> > > Jerrod
> > >
> > >
> > Hi Jarod. Thanks, the pointer you gave will most certainly be of great
> aid. I will
> > try the striplevel approach instead of writing my own do_patch()
> override.
> > Regarding how certain I am that the root folder is ${WORKDIR} when
> > patching, not at all ;) In my do_patch() function is simply did `pwd`
> and it was
> > not set to ${S} as I set it to.
> > That does not mean that the built-in patch system is using ${WORKDIR}, I
> am
> > aware of that.
> > Things here is, even though my patch is placed in ${W} and I set ${S} to
> eg.
> > ${W}/git/some/folder, why would it not work? In another package I set
> ${S}
> > to ${WORKDIR}/git and it works just fine. I can not understand why
> setting
> > ${S} to something else breaks the logic?
> > It's not that bitbake can not find the patch file, it definitely does
> that, but the
> > -pnum seems to get messed up. But maybe that is the whole point of having
> > the striplevel=X in the first place.
> >
> > Hans
> >
> >
> > >
> > >
> > >
> > >
> > > On Thu, Mar 7, 2013 at 7:33 AM, Hans Beck?rus <hans.beckerus@gmail.com
> > > <mailto:hans.beckerus@gmail.com>> wrote:
> > >
> > > On Thu, Mar 7, 2013 at 1:12 PM, Hans Beck?rus
> > > <hans.beckerus@gmail.com <mailto:hans.beckerus@gmail.com>>
> > wrote:
> > > > Hi. More problems ;)
> > > > I have a patch file that needs to be applied to a source tree
> > > and the
> > > > patch file is copied properly to the ${WORKDIR} directory.
> > > > So far so good. But, the problem with this source tree is that
> it is
> > > > not built from the traditional root folder of the repo.
> > > > This means I need to change ${S} to point somewhere else. This
> also
> > > > causes the patch system to fail!
> > > > I did an override of do_patch() in my .bb and that seems to
> > > work, but
> > > > I do not like to use overrides unless I really have to.
> > > > So basically, is there some way to tell the built-in patch
> system to
> > > > use a different -pnum value?
> > > > If there is, I could stick with the do_patch() as provided by
> > > default.
> > > >
> > > > Hans
> > >
> > > Hmm, ok a correction from my side. Forget parts of what I said ;)
> > > The patch system does not seem to use the value of ${S}, it is
> using
> > > ${WORKDIR} as the root for patching, this is also where the patch
> file
> > > is placed. The problem in my case does not seem to be that is built
> > > from a non-standard path. The reason why it fails seems to be
> because
> > > the actual source is not in ${WORKDIR}, it is in ${WORKDIR}/git.
> The
> > > patch file does include git as part of the source path for obvious
> > > reasons. What am I doing wrong? Having actual source code in
> > > ${WORKDIR}/git I assume is very common for git based downloads.
> > >
> > > Hans
> > > _______________________________________________
> > > yocto mailing list
> > > yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
> > > https://lists.yoctoproject.org/listinfo/yocto
> > >
> > >
>
> I also found another useful patch param called patchdir that sets the
> directory from which the patch is applied. This is useful when ${S} is set
> to a directory deeper than you want to patch from but don't want to mess
> with setting ${S}. I needed it to apply a patch to wpa_supplicant's src
> directory.
>
> Ex.
>
> file://gpio-sysfs-power-onoff-change.patch;patchdir=${WORKDIR}/wpa_supplicant-${PV}
>
> Thanks Daniel, that did the trick for me!
I set my patchdir=${W}/git and then used S=${W}/git/some/where/else as
build source.
No more need to override do_patch() :)
Hans
Daniel Lazzari Jr.
> Firmware Engineer
> dlazzari@leapfrog.com
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
[-- Attachment #2: Type: text/html, Size: 7126 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-03-08 17:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-07 12:12 Problem with applying a patch using default -pnum Hans Beckérus
2013-03-07 12:33 ` Hans Beckérus
2013-03-07 19:11 ` Jerrod Peach
2013-03-07 19:43 ` Hans Beckerus
2013-03-07 21:01 ` Jerrod Peach
2013-03-07 21:22 ` Hans Beckerus
2013-03-07 18:14 ` Paul Eggleton
-- strict thread matches above, loose matches on Subject: below --
2013-03-08 1:49 Daniel Lazzari
2013-03-08 17:10 ` Hans Beckérus
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.