[yocto] call custom sh script in do_compile

Mircea Gliga mircea.gliga at vitheia.com
Wed Dec 20 01:37:10 PST 2017


I'm trying to figure the proper way that the script *should* expect 
parameters...
Some excerpt:

function buildConfiguration {
     CONFIGURATION=${1}
     BINARY_TYPE=${2}
     MACHINE=${3}
     DTB=${4}
     KEY_DIR=${5}
     MAKE_OPTIONS="-j 8 VERBOSE=1 V=1"
     MAKE="make"
     echo ""
     echo "compiling u-boot configuration ${CONFIGURATION} ${DTB} 
version: ${UBOOT_BUILD_VERSION}"

     ${MAKE} ${MAKE_OPTIONS} HOSTCC="$HOSTCC"  clean VERBOSE=1
     ${MAKE} ${MAKE_OPTIONS} VERBOSE=1 HOSTCC="$HOSTCC" ${CONFIGURATION} 
VERBOSE=1
     ${MAKE} ${MAKE_OPTIONS} HOSTCC="$HOSTCC"  tools VERBOSE=1
     if [ "${DTB}" != "" ]; then
         compileDts ../arch/arm/dts/at91-${MACHINE} ${KEY_DIR}
     fi

     ${MAKE} ${MAKE_OPTIONS} HOSTCC="$HOSTCC" VERBOSE=1

     mkdir -p ${3}/binaries/
     mv u-boot${DTB}.bin 
${3}/binaries/${MACHINE}-u-boot-${BINARY_TYPE}${DTB}.bin
}


buildConfiguration first_defconfig   "debug"   "first" "-dtb" "prod_keys"
buildConfiguration second_defconfig   "loader"   "first" "-dtb"  ""
buildConfiguration [...]
buildConfiguration [...]


On 20/12/17 11:20, Burton, Ross wrote:
> On 20 December 2017 at 09:08, Mircea Gliga <mircea.gliga at vitheia.com 
> <mailto:mircea.gliga at vitheia.com>> wrote:
>
>     Hello
>
>     I have a build.sh script used to build outside yocto, after
>     sourcing the build environment.
>     I want to use the same build.sh script inside the recipe, in the
>     do_compile task, something like:
>
>     do_compile () {
>
>      ./build.sh ${MACHINE}
>     }
>
>     The build.sh script eventually calls make for several targets,
>     release debug etc...
>     The idea with this script is to be used both inside yocto and
>     outside (after sourcing
>     build/tmp/environment-setup-cortexa5hf-neon-poky-linux-gnueabi),
>     by reusing the code.
>
>     What is the proper way to use a custom shell script to build things ?
>     How to pass info from oe_runmake/EXTRA_OEMAKE ?
>
>
> This depends on how build.sh expects to be given extra make arguments.
>
> Ross

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20171220/0d625d1d/attachment.html>


More information about the yocto mailing list