@@ -113,6 +113,14 @@ def get_dirs_with_fragments(d):
return " ".join(extrafiles)
+kbuild_defconfig_exists() {
+ if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then
+ return 0
+ fi
+
+ return 1
+}
+
do_kernel_metadata() {
set +e
@@ -155,7 +163,7 @@ do_kernel_metadata() {
# precendence.
#
if [ -n "${KBUILD_DEFCONFIG}" ]; then
- if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then
+ if $(kbuild_defconfig_exists); then
if [ -f "${UNPACKDIR}/defconfig" ]; then
# If the two defconfig's are different, warn that we overwrote the
# one already placed in UNPACKDIR
@@ -478,8 +486,12 @@ do_kernel_configme() {
config_flags=""
;;
*)
- if [ -f ${UNPACKDIR}/defconfig ]; then
- config_flags="-n"
+ if $(kbuild_defconfig_exists); then
+ config_flags=""
+ else
+ if [ -f ${UNPACKDIR}/defconfig ]; then
+ config_flags="-n"
+ fi
fi
;;
esac
Based on the documentation of KCONFIG_MODE[1], when we use "in-tree" defconfig (the KBUILD_DEFCONFIG is set), then the alldefconfig mode should be used with merge_config.sh. This commit fixes the logic behind setting the flag by checking if the provided defconfig file exists in the linux source tree. [1] https://docs.yoctoproject.org/ref-manual/variables.html#term-KCONFIG_MODE Signed-off-by: Slawomir Stepien <sst@poczta.fm> --- meta/classes-recipe/kernel-yocto.bbclass | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)