From a9d36bf24f349f046e9b65ccf4af3352c4dedabf Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Tue, 5 Feb 2013 14:36:40 +0800
Subject: [PATCH] busybox: add config fragments

Add config fragments to busybox.

The implementation makes use of merge_config.sh script in kern-tools-native.
The use case is similar to the yocto kernel's configuration fragments.

[YOCTO #3379]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/busybox/busybox.inc |   13 +++++++++++++
 1 file changed, 13 insertions(+)

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
 }
 
-- 
1.7.9.5

