[meta-ti] Denys Dmytriyenko : setup-defconfig.inc: implement config fragments by using in-kernel script

Arago Project git git at arago-project.org
Tue May 6 15:26:30 PDT 2014


Module: meta-ti
Branch: dora
Commit: 11cef2ccb38357edd353b4cbd8b3b20c6870e405
URL:    http://arago-project.org/git/meta-ti.git?a=commit;h=11cef2ccb38357edd353b4cbd8b3b20c6870e405

Author: Denys Dmytriyenko <denys at ti.com>
Date:   Sat Apr 26 05:41:00 2014 +0000

setup-defconfig.inc: implement config fragments by using in-kernel script

* Use in-kernel merge_config.sh script and KERNEL_CONFIG_FRAGMENTS list
* Move copying provided defconfig from own task to do_configure() for atomicity
* Don't use curly brackets for shell variables to avoid conflict with Bitbake

Signed-off-by: Denys Dmytriyenko <denys at ti.com>
Reviewed-by: Chase Maupin <chase.maupin at ti.com>

---

 recipes-kernel/linux/setup-defconfig.inc |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/recipes-kernel/linux/setup-defconfig.inc b/recipes-kernel/linux/setup-defconfig.inc
index ed3bce2..4277f26 100644
--- a/recipes-kernel/linux/setup-defconfig.inc
+++ b/recipes-kernel/linux/setup-defconfig.inc
@@ -5,28 +5,32 @@ KERNEL_LOCALVERSION ?= ""
 # Check the defconfig file and see if it points to an in kernel
 # defconfig that should be used, or if it is a complete config file
 
-addtask setup_defconfig before do_configure after do_patch
-do_setup_defconfig() {
-    # Always copy the defconfig file to .config to keep consistency
-    # between the case where there is a real config and the in kernel
-    # tree config
-    cp ${WORKDIR}/defconfig ${S}/.config
-}
-
 # define our own do_configure that will:
 #   1. Check the .config file and see if string use-kernel-config= is present
 #   2. If the use-kernel-config string is present parse out the config to use
-#      and run make ${config}
+#      and run make $config
 #   3. else run yes '' | oe_runmake oldconfig like the default do_configure
 #      does
 do_configure() {
+    # Always copy the defconfig file to .config to keep consistency
+    # between the case where there is a real config and the in kernel
+    # tree config
+    cp ${WORKDIR}/defconfig ${S}/.config
+
     echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
     echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion
     config=`cat ${S}/.config | grep use-kernel-config | cut -d= -f2`
-    if [ "x${config}" != "x" ]
+    if [ ! -z "$config" ]
     then
-        oe_runmake ${config}
+        oe_runmake $config
     else
         yes '' | oe_runmake oldconfig
     fi
+
+    # check for fragments
+    if [ ! -z "${KERNEL_CONFIG_FRAGMENTS}" ]
+    then
+        ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${S} ${S}/.config ${KERNEL_CONFIG_FRAGMENTS} 1>&2 )
+        yes '' | oe_runmake oldconfig
+    fi
 }



More information about the meta-ti mailing list