<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 1, 2013 at 1:56 PM, Saul Wold <span dir="ltr">&lt;<a href="mailto:sgw@linux.intel.com" target="_blank">sgw@linux.intel.com</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="im">On 02/01/2013 06:18 AM, Bruce Ashfield wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
<br>
<br>
On Fri, Feb 1, 2013 at 4:00 AM, &lt;<a href="mailto:Qi.Chen@windriver.com" target="_blank">Qi.Chen@windriver.com</a><br></div>
&lt;mailto:<a href="mailto:Qi.Chen@windriver.com" target="_blank">Qi.Chen@windriver.com</a>&gt;<u></u>&gt; wrote:<br>
<br>
    From: Chen Qi &lt;<a href="mailto:Qi.Chen@windriver.com" target="_blank">Qi.Chen@windriver.com</a> &lt;mailto:<a href="mailto:Qi.Chen@windriver.com" target="_blank">Qi.Chen@windriver.com</a>&gt;<u></u>&gt;<div class="im">
<br>
<br>
    Add config fragments to busybox.<br>
<br>
    Both the implementation and the use case are similar to yocto kernel&#39;s<br>
    configuration fragments.<br>
<br>
<br>
I can fairly easily tweak the configuration parts of the kern-tools to<br>
handle this<br>
use case as well. That would allow us to re-use the kernel&#39;s merge_config.sh<br>
script (with a minor dependency change) and save some duplicated code. It<br>
also gets you the advantage that you can consolidate configuration fragments<br>
outside of any build system, which isn&#39;t as critical here, but something<br>
that<br>
is used quite a bit during kernel testing.<br>
<br>
</div></blockquote>
Bruce,<br>
<br>
Where is the merge_config.sh script today?  Would you propose moving it to the scripts dir and have the busybox recipe call it?<br></blockquote><div><br></div><div style>It&#39;s part of the mainline kernel, hence why grabbing the guts out of it reproducing </div>
<div style>it here isn&#39;t the best idea, we&#39;ll have a need to keep them in sync. In fact, I have</div><div style>2 or 3 pending patches for it in the kern-tools repository that I need to get upstream</div><div style>
(as an example).</div><div style><br></div><div style>I&#39;d propose either creating a separate recipe for it (i.e. like kconfig-frontends) or I could</div><div style>keep it in kern-tools (badly named, but we can work on that ;) and maintain / coordinate</div>
<div style>changes to it.</div><div style><br></div><div style>I just don&#39;t want to see the effort happen twice, we are busy enough!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
What would be your timing on making such a change, ie hold this patch until your get it merge or merge this and then fix it when you merge your changes?<br></blockquote><div><br></div><div style>I could feasibly get it done in the next few weeks, the changes aren&#39;t bug, I just</div>
<div style>have to avoid regressions on either side (kernel or busy box). </div><div style><br></div><div style>That being said, the interface to the SRC_URI is the same for the two, so if we are</div><div style>ok with me arriving and removing the in-recipe support, I guess I can&#39;t object too</div>
<div style>much :) The only risk is that if anyone starts using this first support immediately, </div><div style>I do risk regressing their use case, where if it never goes in, that won&#39;t happen.</div><div style><br></div>
<div style>Cheers,</div><div style><br></div><div style>Bruce</div><div style><br></div><div style><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Sau!<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
To be clear, I&#39;m not talking about the entire kern-tools here, just the<br>
config parts.<br>
<br>
Cheers,<br>
<br>
Bruce<br>
<br>
<br>
    [YOCTO #3379]<br>
<br>
    Signed-off-by: Chen Qi &lt;<a href="mailto:Qi.Chen@windriver.com" target="_blank">Qi.Chen@windriver.com</a><br></div>
    &lt;mailto:<a href="mailto:Qi.Chen@windriver.com" target="_blank">Qi.Chen@windriver.com</a>&gt;<u></u>&gt;<div><div class="h5"><br>
    ---<br>
      meta/recipes-core/busybox/<u></u>busybox.inc |   45<br>
    ++++++++++++++++++++++++++++++<u></u>+++<br>
      1 file changed, 45 insertions(+)<br>
<br>
    diff --git a/meta/recipes-core/busybox/<u></u>busybox.inc<br>
    b/meta/recipes-core/busybox/<u></u>busybox.inc<br>
    index 972e7d0..66044f8 100644<br>
    --- a/meta/recipes-core/busybox/<u></u>busybox.inc<br>
    +++ b/meta/recipes-core/busybox/<u></u>busybox.inc<br>
    @@ -112,8 +112,53 @@ do_prepare_config () {<br>
             fi<br>
      }<br>
<br>
    +# returns all the elements from the src uri that are .cfg files<br>
    +def find_cfgs(d):<br>
    +    sources=src_patches(d, True)<br>
    +    sources_list=[]<br>
    +    for s in sources:<br>
    +        if s.endswith(&#39;.cfg&#39;):<br>
    +            sources_list.append(s)<br>
    +<br>
    +    return sources_list<br>
    +<br>
    +# Merge config fragments<br>
    +# All config fragments for busybox should end with .cfg<br>
    +do_merge_config() {<br>
    +        SED_CONFIG_EXP=&quot;s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]<u></u>*\)[=<br>
    ].*/\2/p&quot;<br>
    +        MERGE_LIST=&quot;${@&quot; &quot;.join(find_cfgs(d))}&quot;<br>
    +        if [ -n &quot;$MERGE_LIST&quot; ]; then<br>
    +                # Make a temp file, merge .config and .cfg files<br>
    into it<br>
    +                TMP_FILE=`mktemp .tmp.config.XXXXXXXX`<br>
    +                cp .config $TMP_FILE<br>
    +                for MERGE_FILE in $MERGE_LIST; do<br>
    +                        CFG_LIST=`sed -n &quot;${SED_CONFIG_EXP}&quot;<br>
    $MERGE_FILE`<br>
    +                        for CFG in $CFG_LIST ; do<br>
    +                                grep -q -w $CFG $TMP_FILE<br>
    +                                if [ $? -eq 0 ] ; then<br>
    +                                        PREV_VAL=`grep -w $CFG<br>
    $TMP_FILE`<br>
    +                                        NEW_VAL=`grep -w $CFG<br>
    $MERGE_FILE`<br>
    +                                        if [ &quot;x$PREV_VAL&quot; !=<br>
    &quot;x$NEW_VAL&quot; ] ; then<br>
    +                                                echo Value of $CFG<br>
    is redefined by fragment $MERGE_FILE:<br>
    +                                                echo Previous<br>
      value: $PREV_VAL<br>
    +                                                echo New value:<br>
       $NEW_VAL<br>
    +                                                echo<br>
    +                                        fi<br>
    +                                        sed -i &quot;/$CFG[ =]/d&quot; $TMP_FILE<br>
    +                                fi<br>
    +                        done<br>
    +                        echo &gt;&gt; $TMP_FILE<br>
    +                        cat $MERGE_FILE &gt;&gt; $TMP_FILE<br>
    +                done<br>
    +                # Copy the temp file to .config, do some cleanup<br>
    +               cp $TMP_FILE .config<br>
    +               rm $TMP_FILE<br>
    +        fi<br>
    +}<br>
    +<br>
      do_configure () {<br>
             do_prepare_config<br>
    +       do_merge_config<br>
             cml1_do_configure<br>
      }<br>
<br>
    --<br>
    1.7.9.5<br>
<br>
<br>
    ______________________________<u></u>_________________<br>
    Openembedded-core mailing list<br>
    <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.<u></u>openembedded.org</a><br></div></div>
    &lt;mailto:<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@<u></u>lists.openembedded.org</a>&gt;<div class="im"><br>
    <a href="http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core" target="_blank">http://lists.linuxtogo.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openembedded-core</a><br>
<br>
<br>
<br>
<br>
--<br>
&quot;Thou shalt not follow the NULL pointer, for chaos and madness await<br>
thee at its end&quot;<br>
<br>
<br>
______________________________<u></u>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.<u></u>openembedded.org</a><br>
<a href="http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core" target="_blank">http://lists.linuxtogo.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openembedded-core</a><br>
<br>
</div></blockquote>
</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>