diff options
author | Denys Dmytriyenko <denys@ti.com> | 2014-04-26 05:41:00 +0000 |
---|---|---|
committer | Denys Dmytriyenko <denys@ti.com> | 2014-05-06 18:08:09 -0400 |
commit | 11cef2ccb38357edd353b4cbd8b3b20c6870e405 (patch) | |
tree | 2d307fed5106096602ad01b60e0c73df06a11a23 | |
parent | ceb91a69d1b647a8d35874f3ad2bc7c03063b92c (diff) | |
download | meta-ti-11cef2ccb38357edd353b4cbd8b3b20c6870e405.tar.gz |
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@ti.com>
Reviewed-by: Chase Maupin <chase.maupin@ti.com>
-rw-r--r-- | 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 ed3bce2b..4277f26e 100644 --- a/recipes-kernel/linux/setup-defconfig.inc +++ b/recipes-kernel/linux/setup-defconfig.inc | |||
@@ -5,28 +5,32 @@ KERNEL_LOCALVERSION ?= "" | |||
5 | # Check the defconfig file and see if it points to an in kernel | 5 | # Check the defconfig file and see if it points to an in kernel |
6 | # defconfig that should be used, or if it is a complete config file | 6 | # defconfig that should be used, or if it is a complete config file |
7 | 7 | ||
8 | addtask setup_defconfig before do_configure after do_patch | ||
9 | do_setup_defconfig() { | ||
10 | # Always copy the defconfig file to .config to keep consistency | ||
11 | # between the case where there is a real config and the in kernel | ||
12 | # tree config | ||
13 | cp ${WORKDIR}/defconfig ${S}/.config | ||
14 | } | ||
15 | |||
16 | # define our own do_configure that will: | 8 | # define our own do_configure that will: |
17 | # 1. Check the .config file and see if string use-kernel-config= is present | 9 | # 1. Check the .config file and see if string use-kernel-config= is present |
18 | # 2. If the use-kernel-config string is present parse out the config to use | 10 | # 2. If the use-kernel-config string is present parse out the config to use |
19 | # and run make ${config} | 11 | # and run make $config |
20 | # 3. else run yes '' | oe_runmake oldconfig like the default do_configure | 12 | # 3. else run yes '' | oe_runmake oldconfig like the default do_configure |
21 | # does | 13 | # does |
22 | do_configure() { | 14 | do_configure() { |
15 | # Always copy the defconfig file to .config to keep consistency | ||
16 | # between the case where there is a real config and the in kernel | ||
17 | # tree config | ||
18 | cp ${WORKDIR}/defconfig ${S}/.config | ||
19 | |||
23 | echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion | 20 | echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion |
24 | echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion | 21 | echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion |
25 | config=`cat ${S}/.config | grep use-kernel-config | cut -d= -f2` | 22 | config=`cat ${S}/.config | grep use-kernel-config | cut -d= -f2` |
26 | if [ "x${config}" != "x" ] | 23 | if [ ! -z "$config" ] |
27 | then | 24 | then |
28 | oe_runmake ${config} | 25 | oe_runmake $config |
29 | else | 26 | else |
30 | yes '' | oe_runmake oldconfig | 27 | yes '' | oe_runmake oldconfig |
31 | fi | 28 | fi |
29 | |||
30 | # check for fragments | ||
31 | if [ ! -z "${KERNEL_CONFIG_FRAGMENTS}" ] | ||
32 | then | ||
33 | ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${S} ${S}/.config ${KERNEL_CONFIG_FRAGMENTS} 1>&2 ) | ||
34 | yes '' | oe_runmake oldconfig | ||
35 | fi | ||
32 | } | 36 | } |