| Summary: | Add config fragment support to busybox | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Paul Eggleton <bluelightning> |
| Component: | core | Assignee: | Chen Qi <Qi.Chen> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Low | CC: | bjst, dvhart, meta.mr.watcher, meta.watcher, Qi.Chen, yi.zhao |
| Version: | 1.4 | ||
| Target Milestone: | 1.4 M5 | ||
| Hardware: | All | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Paul Eggleton
2012-11-02 09:29:16 UTC
Is it something like adding a menuconfig support for it? 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). Change Milestone to 1.4M5 Both the implementation and the use case are very similar to yocto kernel's config fragments. 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. 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} = "${PN}-syslog ${PN}-udhcpc"
inherit cml1 update-rc.d
+do_config[depends] = "kern-tools-native:do_populate_sysroot"
+
# internal helper
def busybox_cfg(feature, features, tokens, cnf, rem):
if type(tokens) == type(""):
@@ -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('.cfg'):
+ sources_list.append(s)
+
+ return sources_list
+
do_configure () {
do_prepare_config
+ merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
cml1_do_configure
}
Is it enough?
Thanks,
Chen Qi
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? merged into poky/master: 56dc1720caa48344238d352c7b6e9b0f0d41aa54 http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=bbcd8b344598850ea2c8d3ad375c519713581fde 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 "bitbake busybox" 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 "bitbake core-image-minimal" 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 -> /bin/busybox root@qemuarm:~# |