<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jan 20, 2013 at 8:44 AM, Richard Purdie <span dir="ltr">&lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, 2013-01-18 at 17:43 +0000, Kamble, Nitin A wrote:<br>
&gt;<br>
&gt; &gt; -----Original Message-----<br>
&gt; &gt; From: Saul Wold [mailto:<a href="mailto:sgw@linux.intel.com">sgw@linux.intel.com</a>]<br>
&gt; &gt; Sent: Friday, January 18, 2013 9:37 AM<br>
&gt; &gt; To: Kamble, Nitin A<br>
&gt; &gt; Cc: <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
&gt; &gt; Subject: Re: [OE-core] [PATCH 1/1] linux-yocto_3.4: use<br>
&gt; &gt; ${KSRC_linux_yocto_3_4_repo} based SRC_URI<br>
&gt; &gt;<br>
&gt; &gt; On 01/18/2013 09:23 AM, Kamble, Nitin A wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;&gt; -----Original Message-----<br>
&gt; &gt; &gt;&gt; From: Saul Wold [mailto:<a href="mailto:sgw@linux.intel.com">sgw@linux.intel.com</a>]<br>
&gt; &gt; &gt;&gt; Sent: Friday, January 18, 2013 9:19 AM<br>
&gt; &gt; &gt;&gt; To: Kamble, Nitin A<br>
&gt; &gt; &gt;&gt; Cc: <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
&gt; &gt; &gt;&gt; Subject: Re: [OE-core] [PATCH 1/1] linux-yocto_3.4: use<br>
&gt; &gt; &gt;&gt; ${KSRC_linux_yocto_3_4_repo} based SRC_URI<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; On 01/16/2013 11:46 AM, <a href="mailto:nitin.a.kamble@intel.com">nitin.a.kamble@intel.com</a> wrote:<br>
&gt; &gt; &gt;&gt;&gt; From: Nitin A Kamble &lt;<a href="mailto:nitin.a.kamble@intel.com">nitin.a.kamble@intel.com</a>&gt;<br>
&gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt;&gt;&gt; This makes replacing kernel git repository easy.<br>
&gt; &gt; &gt;&gt;&gt; For example you can add the following line in your local.conf to use<br>
&gt; &gt; &gt;&gt;&gt; your own local kernel repository:<br>
&gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt;&gt;&gt; KSRC_linux_yocto_3_4_repo = &quot;/home/nitin/linux-yocto-<br>
&gt; &gt; &gt;&gt; 3.4.git/;protocol=file&quot;<br>
&gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt;&gt;&gt; Signed-off-by: Nitin A Kamble &lt;<a href="mailto:nitin.a.kamble@intel.com">nitin.a.kamble@intel.com</a>&gt;<br>
&gt; &gt; &gt;&gt;&gt; ---<br>
&gt; &gt; &gt;&gt;&gt;    meta/recipes-kernel/linux/<a href="http://linux-yocto_3.4.bb" target="_blank">linux-yocto_3.4.bb</a> |    3 ++-<br>
&gt; &gt; &gt;&gt;&gt;    1 files changed, 2 insertions(+), 1 deletions(-)<br>
&gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt;&gt;&gt; diff --git a/meta/recipes-kernel/linux/<a href="http://linux-yocto_3.4.bb" target="_blank">linux-yocto_3.4.bb</a><br>
&gt; &gt; &gt;&gt;&gt; b/meta/recipes-kernel/linux/<a href="http://linux-yocto_3.4.bb" target="_blank">linux-yocto_3.4.bb</a><br>
&gt; &gt; &gt;&gt;&gt; index 70ed967..92129b6 100644<br>
&gt; &gt; &gt;&gt;&gt; --- a/meta/recipes-kernel/linux/<a href="http://linux-yocto_3.4.bb" target="_blank">linux-yocto_3.4.bb</a><br>
&gt; &gt; &gt;&gt;&gt; +++ b/meta/recipes-kernel/linux/<a href="http://linux-yocto_3.4.bb" target="_blank">linux-yocto_3.4.bb</a><br>
&gt; &gt; &gt;&gt;&gt; @@ -11,7 +11,8 @@ SRCREV_machine_qemux86-64 ?=<br>
&gt; &gt; &gt;&gt; &quot;5432e2acb6053f9f7563cf63abd101ed2fdc1b6f&quot;<br>
&gt; &gt; &gt;&gt;&gt;    SRCREV_machine ?= &quot;5432e2acb6053f9f7563cf63abd101ed2fdc1b6f&quot;<br>
&gt; &gt; &gt;&gt;&gt;    SRCREV_meta ?= &quot;7e0cd2990798aae80565baa17d3b6c771874f284&quot;<br>
&gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt;&gt;&gt; -SRC_URI = &quot;git://<a href="http://git.yoctoproject.org/linux-yocto-" target="_blank">git.yoctoproject.org/linux-yocto-</a><br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; 3.4.git;protocol=git;nocheckout=1;branch=${KBRANCH},${KMETA};name=ma<br>
&gt; &gt; &gt;&gt; chine,meta&quot;<br>
&gt; &gt; &gt;&gt;&gt; +KSRC_linux_yocto_3_4_repo ?= &quot;<a href="http://git.yoctoproject.org/linux-yocto-" target="_blank">git.yoctoproject.org/linux-yocto-</a><br>
&gt; &gt; &gt;&gt; 3.4.git;protocol=git&quot;<br>
&gt; &gt; &gt;&gt;&gt; +SRC_URI =<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &quot;git://${KSRC_linux_yocto_3_4_repo};nocheckout=1;branch=${KBRANCH},${<br>
&gt; &gt; &gt;&gt; KMETA};name=machine,meta&quot;<br>
&gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; Nitin,<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; Can&#39;t the same be accomplished by setting SRC_URI-yocto-linux in your<br>
&gt; &gt; &gt;&gt; local.conf file:<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt;&gt; SRC_URI_linux-yocto =<br>
&gt; &gt; &gt;&gt;&gt; &quot;/home/nitin/linux-yocto-3.4.git/;protocol=file<br>
&gt; &gt; &gt;&gt; ;nocheckout=1;branch=${KBRANCH},${KMETA};name=machine,meta&quot;<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; Yes, it might require a little cut paste of the nocheck... part.<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; Sau!<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Saul,<br>
&gt; &gt; &gt;     This way same settings can be used for any BSP. And shouldn&#39;t we make<br>
&gt; &gt; life of YP developer easy?<br>
&gt; &gt; &gt;<br>
&gt; &gt; This just seems like an extra variable that then needs to be documented<br>
&gt; &gt; when the SRC_URI already exists for this purpose.<br>
&gt;<br>
&gt; And this new variable is going to make kernel developer&#39;s life easy to just replace the kernel repository<br>
&gt; while keeping all the kernel repo branch names same.<br>
&gt;<br>
&gt; As a kernel/BSP developer it definitely makes my life easier.<br>
<br>
</div></div>I&#39;m not taking things like this which solve a given specialist use case<br>
but would need to result in every recipe changing where someone wanted<br>
to do this. To be blunt, your choice of variable name also sucks.<br>
<br>
Embrace the power of the scripting we have, there are much more<br>
interesting ways to solve this problem generically. For example, I wrote<br>
this piece of code in a few minutes (admittedly untested):<br>
<br></blockquote><div><br></div><div style>Agreed! I&#39;m not even sure how I missed that this was to the *oe-core* linux-yocto</div><div style>recipes (Nitin: you need to cc&#39; me, or let me stage and merge changes to these</div>
<div style>recipes as a general rule), but I wouldn&#39;t have let this in either. </div><div style><br></div><div style>I admit to having such things in local/hack layers, but they definitely are not something</div><div style>
I&#39;d ever have wanted to see in main recipes.</div><div style><br></div><div style>Cheers,</div><div style><br></div><div style>Bruce</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
urlremapper.bbclass:<br>
<br>
python () {<br>
    mod = False<br>
    newsrcuri = []<br>
    srcuri = (d.getVar(&quot;SRC_URI&quot;, True) or &quot;&quot;).split()<br>
    maps = d.getVarFlags(&quot;URLREMAP&quot;)<br>
    for uri in srcuri:<br>
        for u in maps:<br>
        if uri.startswith(u):<br>
            uri.replace(u, maps[u])<br>
            mod = True<br>
        newsrcuri.append(uri)<br>
    if mod:<br>
        d.setVar(&quot;SRC_URI&quot;, &quot; &quot;.join(newsrcuri))<br>
}<br>
<br>
<br>
URLREMAP[git://<a href="http://git.yoctoproject.org/linux-yocto-3.4.git" target="_blank">git.yoctoproject.org/linux-yocto-3.4.git</a>] = &quot;git:///home/nitin/linux-yocto-3.4.git/;protocol=file&quot;<br>
<br>
which should do what you want but in a generic way which doesn&#39;t require<br>
us to hack each recipe. You can do it completely locally if you create a<br>
classes directory alongside your conf directory and place the .bbclass<br>
there, then add INHERIT += &quot;urlremapper&quot; in local.conf.<br>
<br>
Cheers,<br>
<br>
Richard<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core" target="_blank">http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>&quot;Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end&quot;
</div></div>