<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 24, 2016, at 5:55 AM, Bruce Ashfield <<a href="mailto:bruce.ashfield@gmail.com" class="">bruce.ashfield@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><br class="Apple-interchange-newline"><br class=""><div class="gmail_quote">On Thu, Nov 24, 2016 at 5:32 AM, Mike Looijmans<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:mike.looijmans@topic.nl" target="_blank" class="">mike.looijmans@topic.nl</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><span class="">On 24-11-16 11:10, Mike Looijmans wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">I'm currently experiencing a problem with "defconfig" files and the kernel.<br class=""><br class="">In short, when I make a change to the "defconfig" file, the kernel is rebuilt<br class="">(which is correct), but the resulting kernel has been built using the old<br class="">defconfig from a previous build, instead of the new one.<br class=""><br class="">The kernel recipe just contains "<a href="file://defconfig" class="">file://defconfig</a>" in its SRC_URI. The<br class="">defconfig file is in the project's overlay.<br class=""><br class="">For example, I have a kernel with "CONFIG_DEVMEM" disabled:<br class=""><br class=""># gunzip < /proc/config.gz | grep DEVMEM<br class=""># CONFIG_DEVMEM is not set<br class=""><br class="">Now, I change the defconfig to contain CONFIG_DEVMEM=y and build the image.<br class="">The result:<br class=""><br class=""># gunzip < /proc/config.gz | grep DEVMEM<br class=""># CONFIG_DEVMEM is not set<br class=""><br class="">So the change did not make it into the actual kernel, even though the kernel<br class="">was rebuild as a result of the change.<br class=""><br class="">I run "bitbake -c cleansstate virtual/kernel" and build the image again:<br class=""><br class=""># gunzip < /proc/config.gz | grep DEVMEM<br class="">CONFIG_DEVMEM=y<br class=""><br class="">After cleaning, the result is correct and the new defconfig is active.<br class=""><br class="">I'm trying to figure out how this can happen, any help is welcome...<br class=""></blockquote><br class=""></span>What seems to be the problem is this code in kernel.bbclass:<br class=""><br class=""> <span class="Apple-converted-space"> </span># Copy defconfig to .config if .config does not exist. This allows<br class=""> <span class="Apple-converted-space"> </span># recipes to manage the .config themselves in do_configure_prepend().<br class=""> <span class="Apple-converted-space"> </span>if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then<br class=""> <span class="Apple-converted-space"> </span>cp "${WORKDIR}/defconfig" "${B}/.config"<br class=""> <span class="Apple-converted-space"> </span>fi<br class=""><br class="">This keeps any existing ".config" file if it happens to still be in the $B path, which is the case if you're rebuilding a kernel.<br class=""><br class="">I see two possible ways to fix this.<br class=""><br class="">1) During "cleanup" also remove the .config file in the build dir. However, the build dir is probably kept alive for a reason? I also can't figure out how that "cleanup" is being done.<br class=""><br class=""><br class="">2) Remove the second part of the "if" statement, so it becomes:<br class=""><br class=""> <span class="Apple-converted-space"> </span># Copy defconfig to .config if "defconfig" exists. This allows<br class=""> <span class="Apple-converted-space"> </span># recipes to manage the .config themselves in do_configure_prepend().<br class=""> <span class="Apple-converted-space"> </span>if [ -f "${WORKDIR}/defconfig" ]; then<br class=""> <span class="Apple-converted-space"> </span>cp "${WORKDIR}/defconfig" "${B}/.config"<br class=""> <span class="Apple-converted-space"> </span>fi<br class=""><br class="">I've tested that, and it solves my problem. However, it will probably break other people's config mangling?<div class="HOEnZb"><div class="h5"><br class=""></div></div></blockquote><br class=""></div><div class="gmail_quote">Yep, in particular all the fragment processing which has the capability of starting<br class=""></div><div class="gmail_quote">with a defconfig and then apply fragments from any number of other places. When<br class=""></div><div class="gmail_quote">that task completes, a full .config is in ${B}. If that statement comes along and<br class=""></div><div class="gmail_quote">clobbers the .config …</div></div></div></div></blockquote><div><br class=""></div><div>so you either assume that .config is valid once generated or you dont. When a configure task</div><div>is triggered it should recreate .config everytime. </div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><br class=""></div><div class="gmail_quote">I'm actually working in the 2.3 release cycle to make the fragment processing<br class=""></div><div class="gmail_quote">be available to all kernels, which will likely solve this problem .. but we can't<span class="Apple-converted-space"> </span><br class=""></div><div class="gmail_quote">wait for that.<br class=""></div><div class="gmail_quote"><br class=""></div><div class="gmail_quote"></div><div class="gmail_quote">So I'm hoping that there's a way to make the behaviour cover both use cases.</div><div class="gmail_quote"><br class=""></div><div class="gmail_quote">Maybe someone with more bitbake knowledge can point out a way that can<br class=""></div><div class="gmail_quote">detect if the task is being run due to a change in the task signature.<span class="Apple-converted-space"> </span><br class=""><br class="">Since if you've modified the defconfig, the task is being re-run for that change<br class="">and at that point we could safely remove the .config (versus forcing it on the<br class=""></div><div class="gmail_quote">clean step).<br class=""><br class=""></div><div class="gmail_quote">Bruce<br class=""></div><div class="gmail_quote"><br class=""><br class=""></div><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="HOEnZb"><div class="h5"><br class=""><br class="">Kind regards,<br class=""><br class="">Mike Looijmans<br class="">System Expert<br class=""><br class="">TOPIC Products<br class="">Materiaalweg 4, NL-5681 RJ Best<br class="">Postbus 440, NL-5680 AK Best<br class="">Telefoon:<span class="Apple-converted-space"> </span><a href="tel:%2B31%20%280%29%20499%2033%2069%2079" value="+31499336979" target="_blank" class="">+31 (0) 499 33 69 79</a><br class="">E-mail:<span class="Apple-converted-space"> </span><a href="mailto:mike.looijmans@topicproducts.com" target="_blank" class="">mike.looijmans@topicproducts.c<wbr class="">om</a><br class="">Website:<span class="Apple-converted-space"> </span><a href="http://www.topicproducts.com/" rel="noreferrer" target="_blank" class="">www.topicproducts.com</a><br class=""><br class="">Please consider the environment before printing this e-mail<br class=""><br class=""><br class=""><br class=""><br class=""><br class="">--<span class="Apple-converted-space"> </span><br class="">______________________________<wbr class="">_________________<br class="">Openembedded-core mailing list<br class=""><a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank" class="">Openembedded-core@lists.openem<wbr class="">bedded.org</a><br class=""><a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank" class="">http://lists.openembedded.org/<wbr class="">mailman/listinfo/openembedded-<wbr class="">core</a><br class=""></div></div></blockquote></div><br class=""><br clear="all" class=""><br class="">--<span class="Apple-converted-space"> </span><br class=""><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><span style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">--<span class="Apple-converted-space"> </span></span><br style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Openembedded-core mailing list</span><br style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:Openembedded-core@lists.openembedded.org" style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Openembedded-core@lists.openembedded.org</a><br style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" style="font-family: Times-Roman; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a></div></blockquote></div><br class=""></body></html>