<br><br>On Saturday, June 2, 2012, Elvis Dowson &lt;<a href="mailto:elvis.dowson@gmail.com">elvis.dowson@gmail.com</a>&gt; wrote:<br>&gt; Hi,<br>&gt;<br>&gt;&gt; On Jun 2, 2012, at 10:36 PM, Elvis Dowson wrote:<br>&gt;&gt;<br>
&gt;&gt;&gt; How can I debug the value of ${TARGET_ARCH} in meta-xilinx/classes/xilinx-boot.class, for the following function:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; do_export_xparam() {<br>&gt;&gt;&gt; bbnote &quot;Replacing xparameters header to match hardware model&quot;<br>
&gt;&gt;&gt; xparam=$1<br>&gt;&gt;&gt; if [ &quot;${TARGET_ARCH}&quot; == &quot;powerpc&quot; ]; then<br>&gt;&gt;&gt;      cpu=&quot;PPC`echo ${TARGET_CPU} | tr &#39;[:lower:]&#39; &#39;[:upper:]&#39;`&quot;<br>&gt;&gt;&gt; else<br>
&gt;&gt;&gt;      cpu=`echo ${TARGET_CPU} | tr &#39;[:lower:]&#39; &#39;[:upper:]&#39;`<br>&gt;&gt;&gt; fi<br>&gt;&gt;&gt; cp ${xparam} ${S}/board/xilinx/${XILINX_BOARD}<br>&gt;&gt;&gt; echo &quot;/*** Cannonical definitions ***/<br>
&gt;&gt;&gt; #define XPAR_PLB_CLOCK_FREQ_HZ XPAR_PROC_BUS_0_FREQ_HZ<br>&gt;&gt;&gt; #define XPAR_CORE_CLOCK_FREQ_HZ XPAR_CPU_${cpu}_CORE_CLOCK_FREQ_HZ<br>&gt;&gt;&gt; #ifndef XPAR_DDR2_SDRAM_MEM_BASEADDR<br>&gt;&gt;&gt; # define XPAR_DDR2_SDRAM_MEM_BASEADDR XPAR_DDR_SDRAM_MPMC_BASEADDR<br>
&gt;&gt;&gt; #endif<br>&gt;&gt;&gt; #define XPAR_PCI_0_CLOCK_FREQ_HZ    0&quot; &gt;&gt; ${S}/board/xilinx/${XILINX_BOARD}/xparameters.h<br>&gt;&gt;&gt; }<br>&gt;&gt;<br>&gt;&gt; In the above code ${TARGET_ARCH} always evaluates to &quot;powerpc&quot;. I just inserted ${TARGET_ARCH} in the echo statements, and saw the value in the file.<br>
&gt;&gt;<br>&gt;&gt; Now what I can&#39;t seem to figure out is why, for the following if condition, the first branch isn&#39;t being take; the else branch is always evaluated, and the value for cpu is always set to &quot;440&quot; instead of &quot;PPC440&quot;<br>
&gt;&gt;<br>&gt;&gt; if [ &quot;${TARGET_ARCH}&quot; == &quot;powerpc&quot; ]; then<br>&gt;&gt;       cpu=&quot;PPC`echo ${TARGET_CPU} | tr &#39;[:lower:]&#39; &#39;[:upper:]&#39;`&quot;<br>&gt;&gt; else<br>&gt;&gt;       cpu=&quot;`echo ${TARGET_CPU} | tr &#39;[:lower:]&#39; &#39;[:upper:]&#39;`&quot;<br>
&gt;&gt; fi<br>&gt;<br>&gt; Changing it to use a single = , instead of == solved it, but it would help if someone could explain why. From the link below<br>&gt; <a href="http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html">http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html</a><br>
&gt; apparently, using a &quot;=&quot; is for strict posix compilance.<br>&gt;<br>&gt; but I fail to see why when ${TARGET_ARCH} evaluates to &quot;powerpc&quot;, and I do a string comparision if [ &quot;${TARGET_ARCH}&quot; == &quot;powerpc&quot; ] it evaluates to false, and if [ &quot;${TARGET_ARCH}&quot; = &quot;powerpc&quot; ] evaluates to true.<br>
<br><br>What&#39;s your default she I guess its not bash<br>&gt;<br>&gt; Best regards,<br>&gt;<br>&gt; Elvis Dowson<br>&gt; _______________________________________________<br>&gt; Openembedded-core mailing list<br>&gt; <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
&gt; <a href="http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core">http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core</a><br>&gt;