diff options
author | Denys Dmytriyenko <denys@ti.com> | 2015-01-06 05:31:57 +0000 |
---|---|---|
committer | Denys Dmytriyenko <denys@ti.com> | 2015-01-08 12:00:17 -0500 |
commit | abdbb75fb09037f85ab8b653dd5900a33f382e84 (patch) | |
tree | c7d99afff78f27ba73f363ab3fa81bb574fecb90 /recipes-kernel | |
parent | a44e87ab512244f2801db2c938ae0334958751c5 (diff) | |
download | meta-ti-abdbb75fb09037f85ab8b653dd5900a33f382e84.tar.gz |
setup-defconfig: support combined defconfig with listed config fragments
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-kernel')
-rw-r--r-- | recipes-kernel/linux/linux-ti-staging-3.14/defconfig | 2 | ||||
-rw-r--r-- | recipes-kernel/linux/linux-ti-staging_3.14.bb | 8 | ||||
-rw-r--r-- | recipes-kernel/linux/setup-defconfig.inc | 64 |
3 files changed, 44 insertions, 30 deletions
diff --git a/recipes-kernel/linux/linux-ti-staging-3.14/defconfig b/recipes-kernel/linux/linux-ti-staging-3.14/defconfig index 926b35a5..990e7f79 100644 --- a/recipes-kernel/linux/linux-ti-staging-3.14/defconfig +++ b/recipes-kernel/linux/linux-ti-staging-3.14/defconfig | |||
@@ -1 +1 @@ | |||
use-kernel-config=omap2plus_defconfig | use-combined-config=ti_config_fragments/defconfig_fragment | ||
diff --git a/recipes-kernel/linux/linux-ti-staging_3.14.bb b/recipes-kernel/linux/linux-ti-staging_3.14.bb index 61989c31..2e89aced 100644 --- a/recipes-kernel/linux/linux-ti-staging_3.14.bb +++ b/recipes-kernel/linux/linux-ti-staging_3.14.bb | |||
@@ -44,18 +44,14 @@ S = "${WORKDIR}/git" | |||
44 | 44 | ||
45 | BRANCH = "ti-linux-3.14.y" | 45 | BRANCH = "ti-linux-3.14.y" |
46 | 46 | ||
47 | SRCREV = "f93aba31cfc224ed7ea414d1b7ab988808d764ba" | 47 | SRCREV = "4311f726041145161621593e5d67f106913c0f28" |
48 | PV = "3.14.26" | 48 | PV = "3.14.26" |
49 | 49 | ||
50 | # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild | 50 | # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild |
51 | MACHINE_KERNEL_PR_append = "b+gitr${SRCPV}" | 51 | MACHINE_KERNEL_PR_append = "c+gitr${SRCPV}" |
52 | PR = "${MACHINE_KERNEL_PR}" | 52 | PR = "${MACHINE_KERNEL_PR}" |
53 | 53 | ||
54 | KERNEL_CONFIG_DIR = "${S}/ti_config_fragments" | 54 | KERNEL_CONFIG_DIR = "${S}/ti_config_fragments" |
55 | KERNEL_CONFIG_FRAGMENTS = "${KERNEL_CONFIG_DIR}/baseport.cfg ${KERNEL_CONFIG_DIR}/all_valid_socs.cfg \ | ||
56 | ${KERNEL_CONFIG_DIR}/power.cfg ${KERNEL_CONFIG_DIR}/connectivity.cfg \ | ||
57 | ${KERNEL_CONFIG_DIR}/ipc.cfg ${KERNEL_CONFIG_DIR}/audio_display.cfg \ | ||
58 | ${KERNEL_CONFIG_DIR}/wlan.cfg" | ||
59 | 55 | ||
60 | KERNEL_CONFIG_FRAGMENTS_append_ti33x = " ${KERNEL_CONFIG_DIR}/am33xx_only.cfg" | 56 | KERNEL_CONFIG_FRAGMENTS_append_ti33x = " ${KERNEL_CONFIG_DIR}/am33xx_only.cfg" |
61 | KERNEL_CONFIG_FRAGMENTS_append_ti43x = " ${KERNEL_CONFIG_DIR}/am43xx_only.cfg" | 57 | KERNEL_CONFIG_FRAGMENTS_append_ti43x = " ${KERNEL_CONFIG_DIR}/am43xx_only.cfg" |
diff --git a/recipes-kernel/linux/setup-defconfig.inc b/recipes-kernel/linux/setup-defconfig.inc index dbfd0d4a..74689290 100644 --- a/recipes-kernel/linux/setup-defconfig.inc +++ b/recipes-kernel/linux/setup-defconfig.inc | |||
@@ -4,13 +4,9 @@ KERNEL_LOCALVERSION ?= "" | |||
4 | 4 | ||
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 | # Or if it points to a combined defconfig that lists both in kernel | ||
8 | # defconfig and associated config fragments. | ||
7 | 9 | ||
8 | # define our own do_configure that will: | ||
9 | # 1. Check the .config file and see if string use-kernel-config= is present | ||
10 | # 2. If the use-kernel-config string is present parse out the config to use | ||
11 | # and run make $config | ||
12 | # 3. else run yes '' | oe_runmake oldconfig like the default do_configure | ||
13 | # does | ||
14 | do_configure() { | 10 | do_configure() { |
15 | # Always copy the defconfig file to .config to keep consistency | 11 | # Always copy the defconfig file to .config to keep consistency |
16 | # between the case where there is a real config and the in kernel | 12 | # between the case where there is a real config and the in kernel |
@@ -19,40 +15,62 @@ do_configure() { | |||
19 | 15 | ||
20 | echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion | 16 | echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion |
21 | echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion | 17 | echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion |
18 | |||
19 | # First, check if pointing to a combined config with config fragments | ||
20 | config=`cat ${S}/.config | grep use-combined-config | cut -d= -f2` | ||
21 | if [ -n "$config" ] | ||
22 | then | ||
23 | cp $config ${S}/.config | ||
24 | fi | ||
25 | |||
26 | # Second, extract any config fragments listed in the defconfig | ||
27 | config=`cat ${S}/.config | grep config-fragment | cut -d= -f2` | ||
28 | if [ -n "$config" ] | ||
29 | then | ||
30 | configfrags="" | ||
31 | for f in $config | ||
32 | do | ||
33 | # Check if the config fragment is available | ||
34 | if [ ! -e "$f" ] | ||
35 | then | ||
36 | echo "Could not find kernel config fragment $f" | ||
37 | exit 1 | ||
38 | else | ||
39 | # Sanitize config fragment files to be relative to sources | ||
40 | configfrags+=" ${S}/$f" | ||
41 | fi | ||
42 | done | ||
43 | fi | ||
44 | |||
45 | # Third, check if pointing to a known in kernel defconfig | ||
22 | config=`cat ${S}/.config | grep use-kernel-config | cut -d= -f2` | 46 | config=`cat ${S}/.config | grep use-kernel-config | cut -d= -f2` |
23 | if [ ! -z "$config" ] | 47 | if [ -n "$config" ] |
24 | then | 48 | then |
25 | oe_runmake $config | 49 | oe_runmake $config |
26 | else | 50 | else |
27 | yes '' | oe_runmake oldconfig | 51 | yes '' | oe_runmake oldconfig |
28 | fi | 52 | fi |
29 | 53 | ||
30 | # Check for kernel config fragments. The assumption is that the config | 54 | # Fourth, handle config fragments specified in the recipe |
31 | # fragment will be specified with the absolute path. For example: | 55 | # The assumption is that the config fragment will be specified with the absolute path. |
32 | # * ${WORKDIR}/config1.cfg | 56 | # E.g. ${WORKDIR}/config1.cfg or ${S}/config2.cfg |
33 | # * ${S}/config2.cfg | 57 | if [ -n "${KERNEL_CONFIG_FRAGMENTS}" ] |
34 | # Iterate through the list of configs and make sure that you can find | ||
35 | # each one. If not then error out. | ||
36 | # NOTE: If you want to override a configuration that is kept in the kernel | ||
37 | # with one from the OE meta data then you should make sure that the | ||
38 | # OE meta data version (i.e. ${WORKDIR}/config1.cfg) is listed | ||
39 | # after the in kernel configuration fragment. | ||
40 | # Check if any config fragments are specified. | ||
41 | if [ ! -z "${KERNEL_CONFIG_FRAGMENTS}" ] | ||
42 | then | 58 | then |
43 | for f in ${KERNEL_CONFIG_FRAGMENTS} | 59 | for f in ${KERNEL_CONFIG_FRAGMENTS} |
44 | do | 60 | do |
45 | # Check if the config fragment was copied into the WORKDIR from | 61 | # Check if the config fragment is available |
46 | # the OE meta data | ||
47 | if [ ! -e "$f" ] | 62 | if [ ! -e "$f" ] |
48 | then | 63 | then |
49 | echo "Could not find kernel config fragment $f" | 64 | echo "Could not find kernel config fragment $f" |
50 | exit 1 | 65 | exit 1 |
51 | fi | 66 | fi |
52 | done | 67 | done |
68 | fi | ||
53 | 69 | ||
54 | # Now that all the fragments are located merge them. | 70 | # Now that all the fragments are located merge them |
55 | ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${S} ${S}/.config ${KERNEL_CONFIG_FRAGMENTS} 1>&2 ) | 71 | if [ -n "${KERNEL_CONFIG_FRAGMENTS}" -o -n "$configfrags" ] |
72 | then | ||
73 | ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${S} ${S}/.config $configfrags ${KERNEL_CONFIG_FRAGMENTS} 1>&2 ) | ||
56 | yes '' | oe_runmake oldconfig | 74 | yes '' | oe_runmake oldconfig |
57 | fi | 75 | fi |
58 | } | 76 | } |