aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2015-03-24 14:57:49 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-24 22:51:07 +0000
commit5f5595eebeb81be7e824d998228e4ef9f0bfac7d (patch)
treecece079e3a2a2fd6b0f32a84a2866322c699362c
parent6cc1315b77bbdcc8f3a0d1e3132ad79ebbeeb2de (diff)
downloadopenembedded-core-5f5595eebeb81be7e824d998228e4ef9f0bfac7d.zip
openembedded-core-5f5595eebeb81be7e824d998228e4ef9f0bfac7d.tar.gz
openembedded-core-5f5595eebeb81be7e824d998228e4ef9f0bfac7d.tar.bz2
kernel-yocto: allow in-tree defconfigs
In a similar manner to the kernel itself, which does the following to bring a defconfig into the configuration: defconfig: $(obj)/conf ifeq ($(KBUILD_DEFCONFIG),) $< --defconfig $(Kconfig) else @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) endif We do the same with the linux-yocto configuration processing. If a defconfig is specified via the KBUILD_DEFCONFIG variable, we copy it from the source tree, into a common location and normalized "defconfig" name, where the rest of the process will include and incorporate it into the configuration process. If the fetcher has already placed a defconfig in WORKDIR (from the SRC_URI), we don't overwrite it, but instead warn the user that SRC_URI defconfigs take precedence. [YOCTO: #7474] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/kernel-yocto.bbclass39
1 files changed, 37 insertions, 2 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 1e226a5..14551a2 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -56,6 +56,7 @@ def get_machine_branch(d, default):
return default
do_kernel_metadata() {
+ set +e
cd ${S}
export KMETA=${KMETA}
@@ -75,6 +76,41 @@ do_kernel_metadata() {
machine_srcrev="${SRCREV}"
fi
+ # In a similar manner to the kernel itself:
+ #
+ # defconfig: $(obj)/conf
+ # ifeq ($(KBUILD_DEFCONFIG),)
+ # $< --defconfig $(Kconfig)
+ # else
+ # @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
+ # $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
+ # endif
+ #
+ # If a defconfig is specified via the KBUILD_DEFCONFIG variable, we copy it
+ # from the source tree, into a common location and normalized "defconfig" name,
+ # where the rest of the process will include and incoroporate it into the build
+ #
+ # If the fetcher has already placed a defconfig in WORKDIR (from the SRC_URI),
+ # we don't overwrite it, but instead warn the user that SRC_URI defconfigs take
+ # precendence.
+ #
+ if [ -n "${KBUILD_DEFCONFIG}" ]; then
+ if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then
+ if [ -f "${WORKDIR}/defconfig" ]; then
+ # If the two defconfigs are the same, leave the existing one in place
+ cmp "${WORKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}"
+ if [ $? -ne 0 ]; then
+ bbnote "defconfig detected in WORKDIR. ${KBUILD_DEFCONFIG} skipped"
+ else
+ cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig
+ sccs="${WORKDIR}/defconfig"
+ fi
+ fi
+ else
+ bbfatal "A KBUILD_DECONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree"
+ fi
+ fi
+
# if we have a defined/set meta branch we should not be generating
# any meta data. The passed branch has what we need.
if [ -n "${KMETA}" ]; then
@@ -86,11 +122,10 @@ do_kernel_metadata() {
bbfatal "Could not create ${machine_branch}"
fi
- sccs="${@" ".join(find_sccs(d))}"
+ sccs="$sccs ${@" ".join(find_sccs(d))}"
patches="${@" ".join(find_patches(d))}"
feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}"
- set +e
# add any explicitly referenced features onto the end of the feature
# list that is passed to the kernel build scripts.
if [ -n "${KERNEL_FEATURES}" ]; then