summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/kernel-yocto.bbclass33
1 files changed, 21 insertions, 12 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 5bc627066e..41d8620e67 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -131,7 +131,7 @@ do_kernel_metadata() {
else
cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig
fi
- sccs="${WORKDIR}/defconfig"
+ in_tree_defconfig="${WORKDIR}/defconfig"
else
bbfatal "A KBUILD_DEFCONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree"
fi
@@ -153,14 +153,24 @@ do_kernel_metadata() {
patches="${@" ".join(find_patches(d,''))}"
feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}"
- # a quick check to make sure we don't have duplicate defconfigs
- # If there's a defconfig in the SRC_URI, did we also have one from
- # the KBUILD_DEFCONFIG processing above ?
- if [ -n "$sccs" ]; then
- # we did have a defconfig from above. remove any that might be in the src_uri
- sccs_from_src_uri=$(echo $sccs_from_src_uri | awk '{ if ($0!="defconfig") { print $0 } }' RS=' ')
+ # a quick check to make sure we don't have duplicate defconfigs If
+ # there's a defconfig in the SRC_URI, did we also have one from the
+ # KBUILD_DEFCONFIG processing above ?
+ src_uri_defconfig=$(echo $sccs_from_src_uri | awk '{ if ($0=="defconfig") { print $0 } }' RS=' ')
+ # drop and defconfig's from the src_uri variable, we captured it just above here if it existed
+ sccs_from_src_uri=$(echo $sccs_from_src_uri | awk '{ if ($0!="defconfig") { print $0 } }' RS=' ')
+ if [ -n "$in_tree_defconfig" ]; then
+ sccs_defconfig=$in_tree_defconfig
+ if [ -n "$src_uri_defconfig" ]; then
+ bbwarn "[NOTE]: defconfig was supplied both via KBUILD_DEFCONFIG and SRC_URI. Dropping SRC_URI defconfig"
+ fi
+ else
+ # if we didn't have an in-tree one, make our defconfig the one
+ # from the src_uri. Note: there may not have been one from the
+ # src_uri, so this can be an empty variable.
+ sccs_defconfig=$src_uri_defconfig
fi
- sccs="$sccs $sccs_from_src_uri"
+ sccs="$sccs_from_src_uri"
# check for feature directories/repos/branches that were part of the
# SRC_URI. If they were supplied, we convert them into include directives
@@ -187,11 +197,10 @@ do_kernel_metadata() {
# expand kernel features into their full path equivalents
bsp_definition=$(spp ${includes} --find -DKMACHINE=${KMACHINE} -DKTYPE=${LINUX_KERNEL_TYPE})
if [ -z "$bsp_definition" ]; then
- echo "$sccs" | grep -q defconfig
- if [ $? -ne 0 ]; then
+ if [ -z "$sccs_defconfig" ]; then
bbfatal_log "Could not locate BSP definition for ${KMACHINE}/${LINUX_KERNEL_TYPE} and no defconfig was provided"
fi
-
+ else
# if the bsp definition has "define KMETA_EXTERNAL_BSP t",
# then we need to set a flag that will instruct the next
# steps to use the BSP as both configuration and patches.
@@ -206,7 +215,7 @@ do_kernel_metadata() {
elements="`echo -n ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}`"
if [ -n "${elements}" ]; then
echo "${bsp_definition}" > ${S}/${meta_dir}/bsp_definition
- scc --force -o ${S}/${meta_dir}:cfg,merge,meta ${includes} ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}
+ scc --force -o ${S}/${meta_dir}:cfg,merge,meta ${includes} $sccs_defconfig $bsp_definition $sccs $patches ${KERNEL_FEATURES}
if [ $? -ne 0 ]; then
bbfatal_log "Could not generate configuration queue for ${KMACHINE}."
fi