<br><br><div class="gmail_quote">On Fri, Mar 8, 2013 at 2:49 AM, Daniel Lazzari <span dir="ltr"><<a href="mailto:dlazzari@leapfrog.com" target="_blank">dlazzari@leapfrog.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">> On 2013-03-07 8:11, Jerrod Peach wrote:<br>
> > Hans,<br>
> ><br>
> > Are you sure you're seeing the patch system use $WORKDIR instead of $S<br>
> > as the root for patching? I've had to do a lot of patching in our own<br>
> > layers recently and I've always seen $S used as the root for the<br>
> > patch. Are you explicitly setting S = "${WORKDIR}/git"? That's what<br>
> > we do for our git recipes. That's how you get the system to recognize<br>
> > the source somewhere other than just $WORKDIR.<br>
> ><br>
> > As for specifying a different -pnum, you absolutely can do that like so:<br>
> ><br>
</div>> > /SRC_URI += "file://my-change.patch*;striplevel=X*"/<br>
<div class="im">> ><br>
> > X is the pnum that you want. Its default value is 1.<br>
> ><br>
> > You may also find this page useful -- it contains all sorts of hints<br>
> > for setting up your recipes in a Yocto-standard way:<br>
> ><br>
> > <a href="https://wiki.yoctoproject.org/wiki/Recipe_&_Patch_Style_Guide" target="_blank">https://wiki.yoctoproject.org/wiki/Recipe_&_Patch_Style_Guide</a><br>
> ><br>
> > That's where I learned about striplevel and the preference for it over<br>
> > the deprecated pnum parameter.<br>
> ><br>
> > Kind regards,<br>
> ><br>
> > Jerrod<br>
> ><br>
> ><br>
> Hi Jarod. Thanks, the pointer you gave will most certainly be of great aid. I will<br>
> try the striplevel approach instead of writing my own do_patch() override.<br>
> Regarding how certain I am that the root folder is ${WORKDIR} when<br>
> patching, not at all ;) In my do_patch() function is simply did `pwd` and it was<br>
> not set to ${S} as I set it to.<br>
> That does not mean that the built-in patch system is using ${WORKDIR}, I am<br>
> aware of that.<br>
> Things here is, even though my patch is placed in ${W} and I set ${S} to eg.<br>
> ${W}/git/some/folder, why would it not work? In another package I set ${S}<br>
> to ${WORKDIR}/git and it works just fine. I can not understand why setting<br>
> ${S} to something else breaks the logic?<br>
> It's not that bitbake can not find the patch file, it definitely does that, but the<br>
> -pnum seems to get messed up. But maybe that is the whole point of having<br>
> the striplevel=X in the first place.<br>
><br>
> Hans<br>
><br>
><br>
> ><br>
> ><br>
> ><br>
> ><br>
</div>> > On Thu, Mar 7, 2013 at 7:33 AM, Hans Beck?rus <<a href="mailto:hans.beckerus@gmail.com">hans.beckerus@gmail.com</a><br>
> > <mailto:<a href="mailto:hans.beckerus@gmail.com">hans.beckerus@gmail.com</a>>> wrote:<br>
> ><br>
> > On Thu, Mar 7, 2013 at 1:12 PM, Hans Beck?rus<br>
> > <<a href="mailto:hans.beckerus@gmail.com">hans.beckerus@gmail.com</a> <mailto:<a href="mailto:hans.beckerus@gmail.com">hans.beckerus@gmail.com</a>>><br>
<div><div class="h5">> wrote:<br>
> > > Hi. More problems ;)<br>
> > > I have a patch file that needs to be applied to a source tree<br>
> > and the<br>
> > > patch file is copied properly to the ${WORKDIR} directory.<br>
> > > So far so good. But, the problem with this source tree is that it is<br>
> > > not built from the traditional root folder of the repo.<br>
> > > This means I need to change ${S} to point somewhere else. This also<br>
> > > causes the patch system to fail!<br>
> > > I did an override of do_patch() in my .bb and that seems to<br>
> > work, but<br>
> > > I do not like to use overrides unless I really have to.<br>
> > > So basically, is there some way to tell the built-in patch system to<br>
> > > use a different -pnum value?<br>
> > > If there is, I could stick with the do_patch() as provided by<br>
> > default.<br>
> > ><br>
> > > Hans<br>
> ><br>
> > Hmm, ok a correction from my side. Forget parts of what I said ;)<br>
> > The patch system does not seem to use the value of ${S}, it is using<br>
> > ${WORKDIR} as the root for patching, this is also where the patch file<br>
> > is placed. The problem in my case does not seem to be that is built<br>
> > from a non-standard path. The reason why it fails seems to be because<br>
> > the actual source is not in ${WORKDIR}, it is in ${WORKDIR}/git. The<br>
> > patch file does include git as part of the source path for obvious<br>
> > reasons. What am I doing wrong? Having actual source code in<br>
> > ${WORKDIR}/git I assume is very common for git based downloads.<br>
> ><br>
> > Hans<br>
> > _______________________________________________<br>
> > yocto mailing list<br>
</div></div>> > <a href="mailto:yocto@yoctoproject.org">yocto@yoctoproject.org</a> <mailto:<a href="mailto:yocto@yoctoproject.org">yocto@yoctoproject.org</a>><br>
> > <a href="https://lists.yoctoproject.org/listinfo/yocto" target="_blank">https://lists.yoctoproject.org/listinfo/yocto</a><br>
> ><br>
> ><br>
<br>
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.<br>
<br>
Ex.<br>
file://gpio-sysfs-power-onoff-change.patch;patchdir=${WORKDIR}/wpa_supplicant-${PV}<br>
<br></blockquote><div>Thanks Daniel, that did the trick for me!<br>I set my patchdir=${W}/git and then used S=${W}/git/some/where/else as build source.<br>No more need to override do_patch() :)<br><br>Hans<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Daniel Lazzari Jr.<br>
Firmware Engineer<br>
<a href="mailto:dlazzari@leapfrog.com">dlazzari@leapfrog.com</a><br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
yocto mailing list<br>
<a href="mailto:yocto@yoctoproject.org">yocto@yoctoproject.org</a><br>
<a href="https://lists.yoctoproject.org/listinfo/yocto" target="_blank">https://lists.yoctoproject.org/listinfo/yocto</a><br>
</div></div></blockquote></div><br>