<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 29, 2016 at 10:46 AM, Bruce Ashfield <span dir="ltr"><<a href="mailto:bruce.ashfield@gmail.com" target="_blank">bruce.ashfield@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Aug 29, 2016 at 10:05 AM, Ioan-Adrian Ratiu <span dir="ltr"><<a href="mailto:adrian.ratiu@ni.com" target="_blank">adrian.ratiu@ni.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>On Mon, 29 Aug 2016, Bruce Ashfield <<a href="mailto:bruce.ashfield@gmail.com" target="_blank">bruce.ashfield@gmail.com</a>> wrote:<br>
</span><span>> On Mon, Aug 29, 2016 at 5:19 AM, Ioan-Adrian Ratiu <<a href="mailto:adrian.ratiu@ni.com" target="_blank">adrian.ratiu@ni.com</a>><br>
> wrote:<br>
><br>
>> do_kernel_configme calls merge_config.sh (installed in the sysroot by<br>
>> the kern-tools-native recipe) which calls make to fill in any missing<br>
>> symbols from the resulting merged config.<br>
><br>
><br>
> That's not what it does ... but that isn't important.<br>
><br>
><br>
>><br>
>> This errors out on my system because of sysroot poisoning [1]. Here is<br>
>> a partial output from my .kernel-meta/cfg/merge_config_<wbr>build.log (this<br>
>> file is created in do_kernel_configme() while callig merge_config.sh):<br>
>><br>
</span><span>>> make[1]: Entering directory '/media/adi/ssd/nilrt-master/<br>
>> build/tmp-glibc/work/x64-nilrt<wbr>-linux/linux-nilrt/4.1+<br>
>> gitAUTOINC+a7e53ecc27-r0/linux<wbr>-x64-standard-build'<br>
>> HOSTCC scripts/basic/fixdep<br>
>> /media/adi/ssd/nilrt-master/bu<wbr>ild/tmp-glibc/work-shared/<br>
</span><span>>> x64/kernel-source/scripts/basi<wbr>c/fixdep.c:106:23: fatal error:<br>
>> sys/types.h: No such file or directory<br>
>> compilation terminated.<br>
>> make[2]: *** [/media/adi/ssd/nilrt-master/b<wbr>uild/tmp-glibc/work-shared/<br>
>> x64/kernel-source/scripts/basi<wbr>c/Makefile:22: scripts/basic/x86_64-nilrt-lin<wbr>ux-fixdep]<br>
>> Error 1<br>
>><br>
><br>
> This just means that we are missing a dependency. Everything that<br>
> merge_config<br>
> needs should be already in place before it runs, i.e. do_kernel_metadata<br>
> should<br>
> have already run and built any host tools that it needs.<br>
><br>
> How are you managing to trigger this error ? I've done plenty of builds,<br>
> and haven't<br>
> seen this one before.<br>
<br>
</span>Maybe some context is in order for how I build the kernel. I'm using a<br>
custom kernel recipe which inherits from linux-yocto.inc. My kernel<br>
tree contains a defconfig which is passed to OE in my kernel recipe<br>
using KBUILD_DEFCONFIG and KCONFIG_MODE="--alldefconfig".<br></blockquote><div><br></div></div></div><div>And that would be the difference, which is what I was looking for. The tools<br></div><div>are always built for the linux-yocto path, hence why I can never reproduce<br></div><div>the issue.<br><br></div><div>I can take the kernel-yocto patch and queue it, but I'm going to leave merge_config<br></div><div>untouched, since that change can go via the kernel path.<span class=""><font color="#888888"><br></font></span></div></div></div></div></blockquote><div><br></div><div>And you can see where I've queued this in my poky-contrib zedd/kernel branch.<br></div><div>It will go out with my queue the introduced 4.8 as a new kernel. I tweaked the<br></div><div>commit log a bit, but is is otherwise unchanged.<br></div><div><br><a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=zedd/kernel">http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=zedd/kernel</a><br><br></div><div>Cheers,<br><br></div><div>Bruce<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span class=""><font color="#888888"><br></font></span></div><span class=""><font color="#888888"><div>Bruce<br></div></font></span><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I have no configuration fragments.<br>
<br>
As expected I need the merge_configs script to automatically fill in any<br>
missing CONFIG symbols before building the kernel and this is where it<br>
fails because the sysroot is poisoned since 2014.<br>
<div><div><br>
><br>
> Bruce<br>
><br>
><br>
>><br>
>> This issue is hard to debug because merge_config.sh does NOT check the<br>
>> error output of its make call (this is added in the second patch) and<br>
>> even though make errors out, the build continues as if nothing happened<br>
>> and compiles a kernel with garbage configs (the .config generated by<br>
>> do_kernel_configme is empty and gets filled later) which doesn't boot.<br>
>><br>
>> Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh<br>
>> fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make<br>
>> uses it to correctly compile & fill all missing kernel config options.<br>
>><br>
>> [1] <a href="http://lists.openembedded.org/pipermail/openembedded-core/" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>pipermail/openembedded-core/</a><br>
>> 2014-October/098253.html<br>
>><br>
>> Signed-off-by: Ioan-Adrian Ratiu <<a href="mailto:adrian.ratiu@ni.com" target="_blank">adrian.ratiu@ni.com</a>><br>
>> ---<br>
>> meta/classes/kernel-yocto.bbcl<wbr>ass | 2 +-<br>
>> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
>><br>
>> diff --git a/meta/classes/<a href="http://kernel-yocto.bb">kernel-yocto.bb</a><wbr>class<br>
>> b/meta/classes/<a href="http://kernel-yocto.bb">kernel-yocto.bb</a><wbr>class<br>
>> index 8650e55..4397a9d 100644<br>
>> --- a/meta/classes/<a href="http://kernel-yocto.bb">kernel-yocto.bb</a><wbr>class<br>
>> +++ b/meta/classes/<a href="http://kernel-yocto.bb">kernel-yocto.bb</a><wbr>class<br>
>> @@ -249,7 +249,7 @@ do_kernel_configme() {<br>
>> bbfatal_log "Could not find configuration queue<br>
>> (${meta_dir}/config.queue)"<br>
>> fi<br>
>><br>
>> - ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} ><br>
>> ${meta_dir}/cfg/merge_config_b<wbr>uild.log 2>&1<br>
>> + CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" ARCH=${ARCH}<br>
>> merge_config.sh -O ${B} ${config_flags} ${configs} ><br>
>> ${meta_dir}/cfg/merge_config_b<wbr>uild.log 2>&1<br>
>> if [ $? -ne 0 ]; then<br>
>> bbfatal_log "Could not configure<br>
>> ${KMACHINE}-${LINUX_KERNEL_TYP<wbr>E}"<br>
>> fi<br>
>> --<br>
>> 2.9.3<br>
>><br>
>><br>
><br>
><br>
> --<br>
> "Thou shalt not follow the NULL pointer, for chaos and madness await thee<br>
> at its end"<br>
</div></div></blockquote></div></div></div><div><div class="h5"><br><br clear="all"><br>-- <br><div data-smartmail="gmail_signature">"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"</div>
</div></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"</div>
</div></div>