<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 21, 2017 at 11:00 AM, Peter Kjellerstedt <span dir="ltr">&lt;<a href="mailto:peter.kjellerstedt@axis.com" target="_blank">peter.kjellerstedt@axis.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:openembedded-core-bounces@lists.openembedded.org">openembedded-core-bounces@<wbr>lists.openembedded.org</a><br>
&gt; [mailto:<a href="mailto:openembedded-core-bounces@lists.openembedded.org">openembedded-core-<wbr>bounces@lists.openembedded.org</a><wbr>] On Behalf Of<br>
&gt; Bruce Ashfield<br>
&gt; Sent: den 21 augusti 2017 04:58<br>
&gt; To: <a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@<wbr>linuxfoundation.org</a><br>
&gt; Cc: <a href="mailto:openembedded-core@lists.openembedded.org">openembedded-core@lists.<wbr>openembedded.org</a><br>
&gt; Subject: [OE-core] [PATCH 8/9] kernel-yocto: ensure that only valid<br>
&gt; BSPs are built<br>
&gt;<br>
&gt; There was a bug in the search routines responsible for locating<br>
&gt; BSP definitions which returned a valid match if only the ktype<br>
&gt; matched.<br>
&gt;<br>
&gt; This meant that someone looking for &quot;qemux86foo&quot; (which is an<br>
&gt; invalid definition) would potentially end up building &quot;qemuarm&quot;<br>
&gt; and be none the wiser (until it didn&#39;t boot).<br>
&gt;<br>
&gt; With this fix to the tools search routine, and improved return<br>
&gt; code testing, we will now stop the build and report and error to<br>
&gt; the user.<br>
&gt;<br>
&gt; [YOCTO: #11878]<br>
&gt;<br>
&gt; Signed-off-by: Bruce Ashfield &lt;<a href="mailto:bruce.ashfield@windriver.com">bruce.ashfield@windriver.com</a>&gt;<br>
&gt; ---<br>
&gt;  meta/classes/kernel-yocto.<wbr>bbclass                       | 3 +++<br>
&gt;  meta/recipes-kernel/kern-<wbr>tools/<a href="http://kern-tools-native_git.bb" rel="noreferrer" target="_blank">kern-tools-native_git.bb</a> | 2 +-<br>
&gt;  2 files changed, 4 insertions(+), 1 deletion(-)<br>
&gt;<br>
&gt; diff --git a/meta/classes/kernel-yocto.<wbr>bbclass b/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt; index 1ca0756c4959..3c6df92131bc 100644<br>
&gt; --- a/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt; +++ b/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt; @@ -143,6 +143,9 @@ do_kernel_metadata() {<br>
&gt;<br>
&gt;       # expand kernel features into their full path equivalents<br>
&gt;       bsp_definition=$(spp ${includes} --find -DKMACHINE=${KMACHINE} -DKTYPE=${LINUX_KERNEL_TYPE})<br>
&gt; +     if [ $? -ne 0 ] || [ -z &quot;${bsp_definition}&quot; ]; then<br>
<br>
</div></div>Use $bsp_definition instead of ${bsp_definition} since it is a<br>
shell variable and not a bitbake variable.<br></blockquote><div><br></div><div>I always use ${...}, so I&#39;m going to stay consistent with what is already in</div><div>the file. </div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Actually, after looking at the code in that bbclass, I see this<br>
used for a number of shell variables all over the place. This is<br>
actually bad, and you should rewrite the code to not use ${variable}<br>
for shell variables. The reason this is bad is because these<br>
variables unnecessarily end up in the sstate hash for these functions,<br>
and if someone actually happens to define a bitbake variable with the<br>
same name as one of those shell variables, the result will not be what<br>
is expected...<br></blockquote><div><br></div><div>Not something high on my priority list. It&#39;s been that way since the beginning.</div><div><br></div><div>Cheers,</div><div><br></div><div>Bruce</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
&gt; +             bbfatal_log &quot;Could not locate BSP definiton for ${KMACHINE}/${LINUX_KERNEL_<wbr>TYPE}.&quot;<br>
<br>
</span>Change &quot;definiton&quot; to &quot;definition&quot;.<br>
<span class="im HOEnZb"><br>
&gt; +     fi<br>
&gt;       meta_dir=$(kgit --meta)<br>
&gt;<br>
&gt;       # run1: pull all the configuration fragments, no matter where they come from<br>
&gt; diff --git a/meta/recipes-kernel/kern-<wbr>tools/<a href="http://kern-tools-native_git.bb" rel="noreferrer" target="_blank">kern-tools-native_git.bb</a> b/meta/recipes-kernel/kern-<wbr>tools/<a href="http://kern-tools-native_git.bb" rel="noreferrer" target="_blank">kern-tools-native_git.bb</a><br>
&gt; index 2217a31076a2..4a78b897d34f 100644<br>
&gt; --- a/meta/recipes-kernel/kern-<wbr>tools/<a href="http://kern-tools-native_git.bb" rel="noreferrer" target="_blank">kern-tools-native_git.bb</a><br>
&gt; +++ b/meta/recipes-kernel/kern-<wbr>tools/<a href="http://kern-tools-native_git.bb" rel="noreferrer" target="_blank">kern-tools-native_git.bb</a><br>
&gt; @@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = &quot;file://git/tools/kgit;<wbr>beginline=5;endline=9;md5=<wbr>a6c2fa8aef1b<br>
&gt;<br>
&gt;  DEPENDS = &quot;git-native&quot;<br>
&gt;<br>
&gt; -SRCREV = &quot;<wbr>9cd2b626d652bec10c6bc75275b35b<wbr>fee74d447c&quot;<br>
&gt; +SRCREV = &quot;<wbr>0571411cc033c11df7827508dd7868<wbr>76ce2f8c83&quot;<br>
&gt;  PR = &quot;r12&quot;<br>
&gt;  PV = &quot;0.2+git${SRCPV}&quot;<br>
&gt;<br>
&gt; --<br>
&gt; 2.5.0<br>
<br>
</span><span class="HOEnZb"><font color="#888888">//Peter<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">&quot;Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end&quot;</div>
</div></div>