#! /bin/bash # Example env variables and its values # kernel_config='omap2plus_defconfig' # export board_types='panda' # kernel_flavour='omap4' # rootfs_type='nano' # # The following three variables: # conf_git # conf_branch # conf_external # # are used to retrieve kernel config fragments from an external source tree # in git.linaro.org. # The URL where the files are taken is built in this way: # http://git.linaro.org/gitweb?p=$conf_git;a=blob_plain;f=linaro/configs/$conf;hb=$conf_branch # conf_git: is the git tree where to look into, like landing-teams/working/arm/kernel.git # conf_branch: is the branch to use, like HEAD # conf_external: is a comma separated list of kernel config file names to retrieve, it is # possible to list also only one file name # # An example of usage of these variables: # conf_git='landing-teams/working/arm/kernel.git' # conf_branch='HEAD' # conf_fragment='android.conf,imx5.conf' set -xe export ARCH=${ARCH:-arm} export default_path="/usr/sbin:/usr/bin:/sbin:/bin" export tcbindir=${tcbindir:-"$HOME/$ARCH-tc/bin"} toolchain_url=${toolchain_url:-} install_custom_toolchain() { test -d ${tcbindir} && return 0 test -z "${toolchain_url}" && return 0 toolchain=`basename ${toolchain_url}` test -f ${toolchain} || curl -sLSO ${toolchain_url} mkdir -p `dirname ${tcbindir}` tar --strip-components=1 -C `dirname ${tcbindir}` -xf ${toolchain} } if [ "${ARCH}" = "arm" ]; then compiler_prefix="arm-linux-gnueabihf-" elif [ "$ARCH" = "arm64" ]; then compiler_prefix="aarch64-linux-gnu-" fi if test -z "$kernel_flavour"; then kernel_flavour='flavour' fi if test -z "$rootfs_type"; then rootfs_type='nano-lava' fi if test -z "$git_web_url"; then git_web_url="unknown" fi if test -z "$hwpack_type"; then submit_job=0 fi if test -z "$submit_job"; then submit_job=1 fi if test -z "$lava_test_plan"; then lava_test_plan="ltp, pwrmgmt" fi if test -z "$git_reset"; then git_reset=false fi if test -z "$make_deb"; then make_deb=true fi if test -z "$make_bootwrapper"; then make_bootwrapper=true fi if test -z "$make_install"; then make_install=false fi if test -z "$make_silent"; then make_silent=false fi if test -z "$make_perf"; then make_perf=false fi install_custom_toolchain if [ "${use_ccache}" = "true" ]; then export CCACHE_DIR="${CCACHE_DIR:-$PWD/ccache}" export PATH="/usr/lib/ccache:$tcbindir:$default_path" export CROSS_COMPILE="ccache ${compiler_prefix}" else export PATH="$tcbindir:$default_path" export CROSS_COMPILE="${compiler_prefix}" fi export make_silent export make_deb export make_perf export make_bootwrapper export make_install export conf_git export conf_branch export conf_external export kernel_config export hwpack_type export board_types export kernel_flavour export rootfs_type export git_web_url export submit_job export lava_test_plan export conf_filenames export gcc_version=`sh $PWD/scripts/gcc-version.sh -p ${compiler_prefix}gcc` export bundle_stream_name=`echo $JOB_NAME | sed -e 's/_.*//' -e 's/\./_/g'` if $git_reset = "true" ; then git reset --hard fi if [ -z "${WORKSPACE}" ]; then # Local build export WORKSPACE=`pwd` export BUILD_NUMBER=1 fi export kernel_version=`make kernelversion` export kernel_release=${kernel_version}-linaro-${kernel_flavour} # deb_pkg_version should increment from 4.x.0-rcy to 4.x.0 export kernel_deb_pkg_version=$(echo ${kernel_release} | sed -e 's/\.0-rc/\.0~rc/') export KERNELVERSION=${kernel_version} export KERNELRELEASE=${kernel_release} export KDEB_SOURCENAME=linux-${kernel_release} export KDEB_PERFNAME=perf-${kernel_release} export KDEB_PKGVERSION=${kernel_deb_pkg_version}-${BUILD_NUMBER} # Below is the list of values that will be used in the json files export KERNEL_GIT=`git config remote.origin.url` export KERNEL_COMMIT=`git log -n1 --pretty=format:%H` . $WORKSPACE/lci-build-tools/jenkins_common_lib #Calling the function build_instructions which includes the kernel build instructions build_instructions