>From 155e192495663cd9e8e7bc57dbefc4bd1bfed130 Mon Sep 17 00:00:00 2001 From: Markus Schuetterle Date: Tue, 5 Apr 2016 15:03:50 +0200 Subject: [openembedded-core][PATCH] kernel-yocto.bbclass: Fix SRCARCH path for x86 using DEFCONFIG For architecture x86 (i386 or x86_64) the kernel source folder is always: arch/x86/... Therfore a variable $(SRCARCH) is introduced instead of using $(ARCH). But there is another issue: Comparing the "defconfig" from WORKDIR with the "_defconfig" from the source tree, will always fail. Yocto specify the "defconfig" as a copy of ".config", where a Linux Kernel *_defconfig it's not. Signed-off-by: Markus Schuetterle --- meta/classes/kernel-yocto.bbclass | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index f86b3ef..8ba9e7d 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass @@ -79,6 +79,14 @@ do_kernel_metadata() { machine_srcrev="${SRCREV}" fi + # When ARCH is set to i386 or x86_64, we need to map ARCH to the real name of src + # dir (x86) under arch/ of kenrel tree, so that we can find correct source to copy. + if [ "${ARCH}" = "i386" ] || [ "${ARCH}" = "x86_64" ]; then + KERNEL_SRCARCH=x86 + else + KERNEL_SRCARCH=${ARCH} + fi + # In a similar manner to the kernel itself: # # defconfig: $(obj)/conf @@ -98,16 +106,16 @@ do_kernel_metadata() { # precendence. # if [ -n "${KBUILD_DEFCONFIG}" ]; then - if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then + if [ -f "${S}/arch/${KERNEL_SRCARCH}/configs/${KBUILD_DEFCONFIG}" ]; then if [ -f "${WORKDIR}/defconfig" ]; then # If the two defconfig's are different, warn that we didn't overwrite the # one already placed in WORKDIR by the fetcher. - cmp "${WORKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" + cmp "${WORKDIR}/defconfig" "${S}/arch/${KERNEL_SRCARCH}/configs/${KBUILD_DEFCONFIG}" if [ $? -ne 0 ]; then bbwarn "defconfig detected in WORKDIR. ${KBUILD_DEFCONFIG} skipped" fi else - cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig + cp -f ${S}/arch/${KERNEL_SRCARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig sccs="${WORKDIR}/defconfig" fi else -- 1.8.3.1