build.sh: allow to define per platform bitbake image target

Instead of having one default image target for all platforms allow to
define this per platform.

This is needed because for example for the 'ccimx6ulstarter' we want to
define a default command line image instead of a QT-based one.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2016-06-20 19:15:58 +02:00
parent e2fb845970
commit 7db92fc476
1 changed files with 12 additions and 8 deletions

View File

@ -70,7 +70,9 @@ copy_images() {
else else
cp -r tmp/deploy/images ${1}/ cp -r tmp/deploy/images ${1}/
if [ "${DY_BUILD_TCHAIN}" = "true" ]; then if [ "${DY_BUILD_TCHAIN}" = "true" ]; then
cp -r tmp/deploy/sdk ${1}/ if [ -d tmp/deploy/sdk ]; then
cp -r tmp/deploy/sdk ${1}/
fi
fi fi
fi fi
@ -116,7 +118,6 @@ purge_sstate() {
[ -z "${WORKSPACE}" ] && error "WORKSPACE not specified" [ -z "${WORKSPACE}" ] && error "WORKSPACE not specified"
# Set default settings if Jenkins does not do it # Set default settings if Jenkins does not do it
[ -z "${DY_TARGET}" ] && DY_TARGET="dey-image-qt"
[ -z "${DY_DISTRO}" ] && DY_DISTRO="dey" [ -z "${DY_DISTRO}" ] && DY_DISTRO="dey"
# If DY_BUILD_TCHAIN is unset, set it for release jobs # If DY_BUILD_TCHAIN is unset, set it for release jobs
@ -127,8 +128,8 @@ if [ -z "${DY_FB_IMAGE}" ] && echo ${JOB_NAME} | grep -qs 'dey.*fb'; then
DY_FB_IMAGE="true" DY_FB_IMAGE="true"
fi fi
# Per-platform variants # Per-platform data
while read _pl _var; do while read _pl _var _tgt; do
# DY_BUILD_VARIANTS comes from Jenkins environment: # DY_BUILD_VARIANTS comes from Jenkins environment:
# 'false': don't build variants (only the default) # 'false': don't build variants (only the default)
# <empty>: build all the variants supported by the platform # <empty>: build all the variants supported by the platform
@ -140,11 +141,13 @@ while read _pl _var; do
_var="${DY_BUILD_VARIANTS}" _var="${DY_BUILD_VARIANTS}"
fi fi
fi fi
[ -n "${DY_TARGET}" ] && _tgt="${DY_TARGET}" || true
eval "${_pl}_var=\"${_var}\"" eval "${_pl}_var=\"${_var}\""
eval "${_pl}_tgt=\"${_tgt}\""
done<<-_EOF_ done<<-_EOF_
ccardimx28js - e w wb web web1 ccardimx28js - e w wb web web1 dey-image-qt
ccimx6sbc DONTBUILDVARIANTS ccimx6sbc DONTBUILDVARIANTS dey-image-qt
ccimx6ulstarter DONTBUILDVARIANTS ccimx6ulstarter DONTBUILDVARIANTS core-image-base
_EOF_ _EOF_
YOCTO_IMGS_DIR="${WORKSPACE}/images" YOCTO_IMGS_DIR="${WORKSPACE}/images"
@ -181,6 +184,7 @@ fi
rm -rf ${YOCTO_IMGS_DIR} ${YOCTO_PROJ_DIR} rm -rf ${YOCTO_IMGS_DIR} ${YOCTO_PROJ_DIR}
for platform in ${DY_PLATFORMS}; do for platform in ${DY_PLATFORMS}; do
eval platform_variants="\${${platform}_var}" eval platform_variants="\${${platform}_var}"
eval platform_targets="\${${platform}_tgt}"
for variant in ${platform_variants}; do for variant in ${platform_variants}; do
_this_prj_dir="${YOCTO_PROJ_DIR}/${platform}" _this_prj_dir="${YOCTO_PROJ_DIR}/${platform}"
_this_img_dir="${YOCTO_IMGS_DIR}/${platform}" _this_img_dir="${YOCTO_IMGS_DIR}/${platform}"
@ -217,7 +221,7 @@ for platform in ${DY_PLATFORMS}; do
if [ "${DY_FB_IMAGE}" = "true" ]; then if [ "${DY_FB_IMAGE}" = "true" ]; then
printf "${X11_REMOVAL_CFG}" >> conf/local.conf printf "${X11_REMOVAL_CFG}" >> conf/local.conf
fi fi
for target in ${DY_TARGET}; do for target in ${platform_targets}; do
printf "\n[INFO] Building the ${target} target.\n" printf "\n[INFO] Building the ${target} target.\n"
time bitbake ${target} time bitbake ${target}
# Build the toolchain for DEY images # Build the toolchain for DEY images