summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/kernel-configure.inc
blob: f3d0abee0209e424ed42243c21c8957b97c28cff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
SRC_URI += " file://merge_config.sh "

configure_kernel() {
    # Add debug flavour config elements from fragments
    # Listed in increasing priority order if conflicts are detected.
    #

    #
    #combine features cfgs with defconfig
    #
    addon_features=""
	if [ -n "${2}" ]; then
        for feature in ${2}; do
            addon_features="${addon_features} ${WORKDIR}/${feature}"
        done
    fi

    # Some meta layers like meta-ti use defconfig file to point to a real
    # default config file (use-kernel-config=config_filename) which is found
    # under kernel path (${S}/arch/${archname}/configs/).
    config=`cat ${1} | grep use-kernel-config | cut -d= -f2`
    if [ "x${config}" != "x" ]
    then
        configfilepath=`find ${S}/arch/ -name ${config} -print | head -n 1`
        if [ -f ${configfilepath} ]
        then
            cp ${configfilepath} ${1}
        else
            bbfatal "Specified config file:${config} was not found!"
        fi
    fi

    if [ -e "${S}/scripts/kconfig/merge_config.sh" ]; then
        O=${B} ${S}/scripts/kconfig/merge_config.sh -m ${1} ${addon_features}
    else
        O=${B} ${WORKDIR}/merge_config.sh -m ${1} ${addon_features}
    fi

    mv -f ${B}/.config ${B}/.mconfig

    #
    #in linux kernel 2.6.33, kconfig does not support alldefconfig yet.
    #
    if [ "x${PV}" = "x2.6.33" ]; then
        oe_runmake KCONFIG_ALLCONFIG=${B}/.mconfig O=${B} allnoconfig
    else
        oe_runmake KCONFIG_ALLCONFIG=${B}/.mconfig O=${B} alldefconfig
    fi
}