[yocto] Sourcing a shell script within a bbclass

Elvis Dowson elvis.dowson at gmail.com
Mon Jun 25 09:45:02 PDT 2012


Hi,

On Jun 25, 2012, at 7:10 PM, McClintock Matthew-B29882 wrote:

>> 
>> For the following code snippet:
>> 
>> if   [ "${XILINX_VER}" \> "14" ]; then
>> bbnote "XILINX_VER ${XILINX_VER}, script location
>> ${XILINX_LOC}/${EDK_SCRIPT}"
>> source ${XILINX_LOC}/${EDK_SCRIPT} ${XILINX_LOC}
>> fi
> 
> ubuntu likes the . operator
> 
>> . ${XILINX_LOC}/${EDK_SCRIPT} ${XILINX_LOC}
> 
> -M
> 
>> if I replace the source keyword with a . (dot)
>> 
>> if   [ "${XILINX_VER}" \> "14" ]; then
>> bbnote "XILINX_VER ${XILINX_VER}, script location
>> ${XILINX_LOC}/${EDK_SCRIPT}"
>> . ${XILINX_LOC}/${EDK_SCRIPT} ${XILINX_LOC}
>> fi
>> 
>> it executes the scripts but gives the following error:
>> 
>> NOTE: XILINX_VER 14.1, script location
>> /tool/xilinx/14.1/ISE_DS/settings64.sh
>> /tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/run.do_deploy.7879:
>> 12: [:
>> /tool/yocto/poky/build/tmp/work/ppc440-poky-linux/u-boot-xilinx-v2012.04.01-r16/temp/run.do_deploy.7879:
>> unexpected operator
>> . /tool/xilinx/14.1/ISE_DS/common/.settings64.sh
>> /tool/xilinx/14.1/ISE_DS/common
>> . /tool/xilinx/14.1/ISE_DS/EDK/.settings64.sh /tool/xilinx/14.1/ISE_DS/EDK
>> . /tool/xilinx/14.1/ISE_DS/common/CodeSourcery/.settings64.sh
>> /tool/xilinx/14.1/ISE_DS/common/CodeSourcery
>> . /tool/xilinx/14.1/ISE_DS/PlanAhead/.settings64.sh
>> /tool/xilinx/14.1/ISE_DS/PlanAhead
>> . /tool/xilinx/14.1/ISE_DS/../../Vivado/2012.1/.settings64.sh
>> /tool/xilinx/14.1/ISE_DS/../../Vivado/2012.1
>> . /tool/xilinx/14.1/ISE_DS/ISE/.settings64.sh /tool/xilinx/14.1/ISE_DS/ISE
>> . /tool/xilinx/14.1/ISE_DS/SysGen/.settings64.sh
>> /tool/xilinx/14.1/ISE_DS/SysGen

As you can see, I tried the . (dot) operator. The settings64.sh script from Xilinx, when run stand-alone runs perfectly fine in Dash, so I don't think there is any bashism there. The problem is with the yocto build system I think, because it gives a unexpected error message as show above.

Best regards,

Elvis Dowson




More information about the yocto mailing list