build.sh: add support to build kernel version 3.x

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2013-10-08 14:15:43 +02:00
parent 4d0244409c
commit a04ea9af59
1 changed files with 61 additions and 38 deletions

View File

@ -37,6 +37,12 @@ SOURCE_MIRROR_URL ?= \"http://build-linux.digi.com/yocto/downloads/\"
INHERIT += \"own-mirrors\"
"
KERNEL_3X_CFG="
# Build Linux 3.10 and U-Boot 2013.01
PREFERRED_VERSION_linux-dey = \"3.10\"
PREFERRED_VERSION_u-boot-dey = \"2013.01\"
"
REPO="$(which repo)"
error() {
@ -90,6 +96,17 @@ done<<-_EOF_
wr21 -
_EOF_
# Support Linux-3.x and U-Boot 2013.x
while read _pl _ker; do
eval "${_pl}_ker=\"${_ker}\""
done<<-_EOF_
ccardimx28js y
ccimx51js n
ccimx53js n
cpx2 n
wr21 n
_EOF_
YOCTO_IMGS_DIR="${WORKSPACE}/images"
YOCTO_INST_DIR="${WORKSPACE}/digi-yocto-sdk.$(echo ${DY_REVISION} | tr '/' '_')"
YOCTO_PROJ_DIR="${WORKSPACE}/projects"
@ -123,43 +140,49 @@ fi
rm -rf ${YOCTO_IMGS_DIR} ${YOCTO_PROJ_DIR}
for platform in ${DY_PLATFORMS}; do
eval platform_variants="\${${platform}_var}"
for variant in ${platform_variants}; do
_this_prj_dir="${YOCTO_PROJ_DIR}/${platform}"
_this_img_dir="${YOCTO_IMGS_DIR}/${platform}"
if [ "${variant}" != "DONTBUILDVARIANTS" ]; then
_this_prj_dir="${YOCTO_PROJ_DIR}/${platform}_${variant}"
_this_img_dir="${YOCTO_IMGS_DIR}/${platform}_${variant}"
_this_var_arg="-v ${variant}"
[ "${variant}" = "-" ] && _this_var_arg="-v \\"
fi
mkdir -p ${_this_img_dir} ${_this_prj_dir}
if pushd ${_this_prj_dir}; then
# Configure and build the project in a sub-shell to avoid
# mixing environments between different platform's projects
(
export TEMPLATECONF="${TEMPLATECONF:+${TEMPLATECONF}/${platform}}"
. ${YOCTO_INST_DIR}/mkproject.sh -p ${platform} ${_this_var_arg}
# Set a common DL_DIR and SSTATE_DIR for all platforms
sed -i -e "/^#DL_DIR ?=/cDL_DIR ?= \"${YOCTO_PROJ_DIR}/downloads\"" \
-e "/^#SSTATE_DIR ?=/cSSTATE_DIR ?= \"${YOCTO_PROJ_DIR}/sstate-cache\"" \
conf/local.conf
# Set the DISTRO and remove 'meta-digi-dey' layer if distro is not DEY based
sed -i -e "/^DISTRO ?=/cDISTRO ?= \"${DY_DISTRO}\"" conf/local.conf
if ! echo "${DY_DISTRO}" | grep -qs "dey"; then
sed -i -e '/meta-digi-dey/d' conf/bblayers.conf
fi
if [ "${DY_USE_MIRROR}" = "true" ]; then
sed -i -e "s,^#DIGI_INTERNAL_GIT,DIGI_INTERNAL_GIT,g" conf/local.conf
printf "${DIGI_PREMIRROR_CFG}" >> conf/local.conf
fi
[ "${DY_RM_WORK}" = "true" ] && printf "\nINHERIT += \"rm_work\"\n" >> conf/local.conf
for target in ${DY_TARGET}; do
printf "\n[INFO] Building the $target target.\n"
time bitbake ${target}
done
)
copy_images ${_this_img_dir}
popd
fi
eval platform_kernel3x="\${${platform}_ker%n}"
for kernel_ver in "" ${platform_kernel3x:+-3x}; do
for variant in ${platform_variants}; do
_this_prj_dir="${YOCTO_PROJ_DIR}/${platform}${kernel_ver}"
_this_img_dir="${YOCTO_IMGS_DIR}/${platform}${kernel_ver}"
if [ "${variant}" != "DONTBUILDVARIANTS" ]; then
_this_prj_dir="${YOCTO_PROJ_DIR}/${platform}${kernel_ver}_${variant}"
_this_img_dir="${YOCTO_IMGS_DIR}/${platform}${kernel_ver}_${variant}"
_this_var_arg="-v ${variant}"
[ "${variant}" = "-" ] && _this_var_arg="-v \\"
fi
mkdir -p ${_this_img_dir} ${_this_prj_dir}
if pushd ${_this_prj_dir}; then
# Configure and build the project in a sub-shell to avoid
# mixing environments between different platform's projects
(
export TEMPLATECONF="${TEMPLATECONF:+${TEMPLATECONF}/${platform}}"
. ${YOCTO_INST_DIR}/mkproject.sh -p ${platform} ${_this_var_arg}
# Set a common DL_DIR and SSTATE_DIR for all platforms
sed -i -e "/^#DL_DIR ?=/cDL_DIR ?= \"${YOCTO_PROJ_DIR}/downloads\"" \
-e "/^#SSTATE_DIR ?=/cSSTATE_DIR ?= \"${YOCTO_PROJ_DIR}/sstate-cache\"" \
conf/local.conf
# Set the DISTRO and remove 'meta-digi-dey' layer if distro is not DEY based
sed -i -e "/^DISTRO ?=/cDISTRO ?= \"${DY_DISTRO}\"" conf/local.conf
if ! echo "${DY_DISTRO}" | grep -qs "dey"; then
sed -i -e '/meta-digi-dey/d' conf/bblayers.conf
fi
if [ "${DY_USE_MIRROR}" = "true" ]; then
sed -i -e "s,^#DIGI_INTERNAL_GIT,DIGI_INTERNAL_GIT,g" conf/local.conf
printf "${DIGI_PREMIRROR_CFG}" >> conf/local.conf
fi
if [ -n "${kernel_ver}" ]; then
printf "${KERNEL_3X_CFG}" >> conf/local.conf
fi
[ "${DY_RM_WORK}" = "true" ] && printf "\nINHERIT += \"rm_work\"\n" >> conf/local.conf
for target in ${DY_TARGET}; do
printf "\n[INFO] Building the $target target.\n"
time bitbake ${target}
done
)
copy_images ${_this_img_dir}
popd
fi
done
done
done