<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>3379</bug_id>
          
          <creation_ts>2012-11-02 09:29:16 +0000</creation_ts>
          <short_desc>Add config fragment support to busybox</short_desc>
          <delta_ts>2013-03-01 06:29:35 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.4</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.4 M5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Chen Qi">Qi.Chen</assigned_to>
          <cc>bjst</cc>
    
    <cc>dvhart</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>yi.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>27187</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-11-02 09:29:16 +0000</bug_when>
    <thetext>We&apos;ve discussed a few times the possibility of adding config fragments to busybox for more easily enabling blocks of functionality (as we can with the kernel). Here&apos;s one reference:

http://lists.linuxtogo.org/pipermail/openembedded-core/2012-January/016217.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27225</commentid>
    <comment_count>1</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2012-11-05 10:46:06 +0000</bug_when>
    <thetext>Is it something like adding a menuconfig support for it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27957</commentid>
    <comment_count>2</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-12-04 15:23:39 +0000</bug_when>
    <thetext>Not really, no - this is about adding config fragments like we have for the linux-yocto kernel recipe so you can e.g. enable a number of options by adding a file containing just those options to SRC_URI (and not the whole defconfig).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29118</commentid>
    <comment_count>3</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-01-24 02:36:36 +0000</bug_when>
    <thetext>Change Milestone to 1.4M5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29441</commentid>
    <comment_count>4</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-02-01 09:11:43 +0000</bug_when>
    <thetext>Both the implementation and the use case are very similar to yocto kernel&apos;s config fragments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29461</commentid>
    <comment_count>5</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-02-01 16:11:01 +0000</bug_when>
    <thetext>Chen Qi,

This should involve copying the mergeconfig script from the upstream Linux kernel into busybox and using config fragments identical in format to those in the linux-yocto kernel to assemble a final config. Additional tooling may be desired around that, but for now we should be keeping it simple and sticking to mergeconfig.

mergeconfig is now used by the yocto kernel tools as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29511</commentid>
    <comment_count>6</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-02-05 06:44:39 +0000</bug_when>
    <thetext>Hi Darren,

Thank you for reminding me of this.
I just implemented a short patch using this method.

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 972e7d0..6ed5e09 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -37,6 +37,8 @@ RRECOMMENDS_${PN} = &quot;${PN}-syslog ${PN}-udhcpc&quot;
 
 inherit cml1 update-rc.d
 
+do_config[depends] = &quot;kern-tools-native:do_populate_sysroot&quot;
+
 # internal helper
 def busybox_cfg(feature, features, tokens, cnf, rem):
        if type(tokens) == type(&quot;&quot;):
@@ -112,8 +114,19 @@ do_prepare_config () {
        fi
 }
 
+# returns all the elements from the src uri that are .cfg files
+def find_cfgs(d):
+    sources=src_patches(d, True)
+    sources_list=[]
+    for s in sources:
+        if s.endswith(&apos;.cfg&apos;):
+            sources_list.append(s)
+
+    return sources_list
+
 do_configure () {
        do_prepare_config
+       merge_config.sh -m .config ${@&quot; &quot;.join(find_cfgs(d))}
        cml1_do_configure
 }
 
Is it enough?

Thanks,
Chen Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29539</commentid>
    <comment_count>7</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-02-05 18:30:52 +0000</bug_when>
    <thetext>I would rather see merge_config.sh patched into busybox than make busybox depend on kern-tools-native. It is a VERY simple shell script (which I wrote a lot of) so the dependency is overkill. 

This is a good start, but ultimately we need to add the fragments for all the nasty configure logic in the existing recipe as well.

Did you perform any testing here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29902</commentid>
    <comment_count>8</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-02-18 06:07:49 +0000</bug_when>
    <thetext>merged into poky/master: 56dc1720caa48344238d352c7b6e9b0f0d41aa54

http://git.openembedded.org/?p=openembedded-core.git&amp;a=commit;h=bbcd8b344598850ea2c8d3ad375c519713581fde</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30309</commentid>
    <comment_count>9</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2013-03-01 06:29:35 +0000</bug_when>
    <thetext>Verified with master branch: 0bedc0b80d9b46cbbf4a2c5e120a6aa52cbc7c2e

Steps:
1. Add a new cal.cfg file to meta/recipes-core/busybox/busybox-1.20.2/
$ cat cal.cfg 
CONFIG_CAL=y

2. Run &quot;bitbake busybox&quot;
Check the build/tmp/work/armv5te-poky-linux-gnueabi/busybox/1.20.2-r5/busybox-1.20.2/.config file.
The CONFIG_CAL should be set to y.

3. Run &quot;bitbake core-image-minimal&quot;
Boot up the image, the cal command should be exist.
root@qemuarm:~# which cal
/usr/bin/cal
root@qemuarm:~# ls -l /usr/bin/cal 
lrwxrwxrwx    1 root     root            12 Mar  1 06:17 /usr/bin/cal -&gt; /bin/busybox
root@qemuarm:~#</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>