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