[OE-core] [PATCH 2/4] kernel-yocto.bbclass: do_kernel_configme: don't use +errexit, merge_config_build.log and fail when /.config wasn't created

Bruce Ashfield bruce.ashfield at gmail.com
Wed Feb 5 03:00:36 UTC 2020


On Tue, Feb 4, 2020 at 9:42 PM Martin Jansa <martin.jansa at gmail.com> wrote:
>
> * for whatever reason, instead of silently continuing to build default kernel config
>
> Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
> ---
>  meta/classes/kernel-yocto.bbclass | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
> index d2796b01bf..8e642cd999 100644
> --- a/meta/classes/kernel-yocto.bbclass
> +++ b/meta/classes/kernel-yocto.bbclass
> @@ -318,8 +318,6 @@ do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}gcc:do_populate_sysroot"
>  do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot"
>  do_kernel_configme[dirs] += "${S} ${B}"
>  do_kernel_configme() {
> -       set +e
> -
>         # translate the kconfig_mode into something that merge_config.sh
>         # understands
>         case ${KCONFIG_MODE} in
> @@ -345,8 +343,9 @@ do_kernel_configme() {
>                 bbfatal_log "Could not find configuration queue (${meta_dir}/config.queue)"
>         fi
>
> -       CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}" CC="${KERNEL_CC}" LD="${KERNEL_LD}" ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} > ${meta_dir}/cfg/merge_config_build.log 2>&1
> -       if [ $? -ne 0 ]; then
> +       CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}" CC="${KERNEL_CC}" LD="${KERNEL_LD}" ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs}
> +

At one point there was a modified merge_config that I used while the
kernel caught up to the functionality that we needed, it didn't return
zero in this scenario. Hence why just checking the return code was
enough.

This makes sense to me, and explains the difference between our runs,
and why my clean oe-core + bitbake test worked as well.

Bruce

> +       if [ $? -ne 0 -o ! -f ${B}/.config ]; then
>                 bbfatal_log "Could not configure ${KMACHINE}-${LINUX_KERNEL_TYPE}"
>         fi
>
> --
> 2.20.1
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


More information about the Openembedded-core mailing list