All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
To: Bruce Ashfield <bruce.ashfield@gmail.com>
Cc: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] kernel-yocto: do_kernel_configme: Fix silent sysroot poisoning error
Date: Mon, 29 Aug 2016 17:05:44 +0300	[thread overview]
Message-ID: <87fupnvfev.fsf@ni.com> (raw)
In-Reply-To: <CADkTA4PF0Qws1rcdfZ=UU12quLjPZnfXPjqf8vq23Ytemd6enQ@mail.gmail.com>

On Mon, 29 Aug 2016, Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> On Mon, Aug 29, 2016 at 5:19 AM, Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
> wrote:
>
>> do_kernel_configme calls merge_config.sh (installed in the sysroot by
>> the kern-tools-native recipe) which calls make to fill in any missing
>> symbols from the resulting merged config.
>
>
> That's not what it does ... but that isn't important.
>
>
>>
>> This errors out on my system because of sysroot poisoning [1]. Here is
>> a partial output from my .kernel-meta/cfg/merge_config_build.log (this
>> file is created in do_kernel_configme() while callig merge_config.sh):
>>
>> make[1]: Entering directory '/media/adi/ssd/nilrt-master/
>> build/tmp-glibc/work/x64-nilrt-linux/linux-nilrt/4.1+
>> gitAUTOINC+a7e53ecc27-r0/linux-x64-standard-build'
>>   HOSTCC  scripts/basic/fixdep
>> /media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/
>> x64/kernel-source/scripts/basic/fixdep.c:106:23: fatal error:
>> sys/types.h: No such file or directory
>> compilation terminated.
>> make[2]: *** [/media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/
>> x64/kernel-source/scripts/basic/Makefile:22: scripts/basic/x86_64-nilrt-linux-fixdep]
>> Error 1
>>
>
> This just means that we are missing a dependency. Everything that
> merge_config
> needs should be already in place before it runs, i.e. do_kernel_metadata
> should
> have already run and built any host tools that it needs.
>
> How are you managing to trigger this error ? I've done plenty of builds,
> and haven't
> seen this one before.

Maybe some context is in order for how I build the kernel. I'm using a
custom kernel recipe which inherits from linux-yocto.inc. My kernel
tree contains a defconfig which is passed to OE in my kernel recipe
using KBUILD_DEFCONFIG and KCONFIG_MODE="--alldefconfig".

I have no configuration fragments.

As expected I need the merge_configs script to automatically fill in any
missing CONFIG symbols before building the kernel and this is where it
fails because the sysroot is poisoned since 2014.

>
> Bruce
>
>
>>
>> This issue is hard to debug because merge_config.sh does NOT check the
>> error output of its make call (this is added in the second patch) and
>> even though make errors out, the build continues as if nothing happened
>> and compiles a kernel with garbage configs (the .config generated by
>> do_kernel_configme is empty and gets filled later) which doesn't boot.
>>
>> Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh
>> fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make
>> uses it to correctly compile & fill all missing kernel config options.
>>
>> [1] http://lists.openembedded.org/pipermail/openembedded-core/
>> 2014-October/098253.html
>>
>> Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
>> ---
>>  meta/classes/kernel-yocto.bbclass | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/kernel-yocto.bbclass
>> b/meta/classes/kernel-yocto.bbclass
>> index 8650e55..4397a9d 100644
>> --- a/meta/classes/kernel-yocto.bbclass
>> +++ b/meta/classes/kernel-yocto.bbclass
>> @@ -249,7 +249,7 @@ do_kernel_configme() {
>>                 bbfatal_log "Could not find configuration queue
>> (${meta_dir}/config.queue)"
>>         fi
>>
>> -       ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} >
>> ${meta_dir}/cfg/merge_config_build.log 2>&1
>> +       CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" ARCH=${ARCH}
>> merge_config.sh -O ${B} ${config_flags} ${configs} >
>> ${meta_dir}/cfg/merge_config_build.log 2>&1
>>         if [ $? -ne 0 ]; then
>>                 bbfatal_log "Could not configure
>> ${KMACHINE}-${LINUX_KERNEL_TYPE}"
>>         fi
>> --
>> 2.9.3
>>
>>
>
>
> -- 
> "Thou shalt not follow the NULL pointer, for chaos and madness await thee
> at its end"


  parent reply	other threads:[~2016-08-29 14:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29  9:19 [PATCH] kernel-yocto: do_kernel_configme: Fix silent sysroot poisoning error Ioan-Adrian Ratiu
2016-08-29 12:10 ` Bruce Ashfield
2016-08-29 13:14   ` Ioan-Adrian Ratiu
2016-08-29 13:23     ` Bruce Ashfield
2016-08-29 13:51       ` Ioan-Adrian Ratiu
2016-08-29 14:44         ` Bruce Ashfield
2016-08-29 14:05   ` Ioan-Adrian Ratiu [this message]
2016-08-29 14:46     ` Bruce Ashfield
2016-08-29 15:01       ` Bruce Ashfield
2016-08-29 15:34       ` Ioan-Adrian Ratiu
2016-08-29 15:39         ` Bruce Ashfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fupnvfev.fsf@ni.com \
    --to=adrian.ratiu@ni.com \
    --cc=bruce.ashfield@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.