#!/bin/bash set -ex export parent_workspace="/mnt/ci_build/workspace/linux-lng-preempt-rt" export reference_git="${parent_workspace}/reference-git" export linux_git="${linux_git:-git://git.linaro.org/kernel/linux-linaro-lng.git}" export linux_branch_version="${linux_branch_version:-"v3.14.x"}" export linux_branch="${linux_branch:-"linux-lng-preempt-rt-${linux_branch_version}"}" endian=${endian:-le} TC_RELEASE="${TC_RELEASE:-14.09}" GCC_VERSION="${GCC_VERSION:-4.9}" export ARCH=arm if [ -z "${WORKSPACE}" ]; then # Local build export hwpack=${hwpack:-arndale} export parent_workspace=`pwd` export reference_git="${parent_workspace}/reference-git" export WORKSPACE="${parent_workspace}/workspace" export BUILD_NUMBER=1 mkdir -p ${WORKSPACE} cd ${WORKSPACE} fi trap cleanup_exit INT TERM EXIT cleanup_exit() { cd ${WORKSPACE} rm -rf lci-build-tools rm -rf builddir* } test -d ${reference_git} || git clone --depth 1 -b $linux_branch $linux_git ${reference_git} cp -a ${reference_git}/* ${reference_git}/.git* . export use_config_fragment=1 export MAKE_DTBS=true export toolchain_url="http://releases.linaro.org/${TC_RELEASE}/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-20${TC_RELEASE}_linux.tar.xz" export rootfs_arch="armv7a" case "${hwpack}" in arndale) export hwpack_type="arndale" export board_types="lng-arndale" export kernel_flavour="arndale" export conf_filenames="linaro/configs/linaro-base.conf linaro/configs/distribution.conf linaro/configs/hugepage.conf linaro/configs/preempt-rt.conf linaro/configs/ovs.conf linaro/configs/kvm-host.conf linaro/configs/no_hz_full.conf linaro/configs/arndale.conf" export device_type="lng-arndale" lmc_dev="arndale" ;; arndale-be) export hwpack_type="arndale" export board_types="lng-arndale" export kernel_flavour="arndale" export conf_filenames="linaro/configs/linaro-base.conf linaro/configs/distribution.conf linaro/configs/hugepage.conf linaro/configs/preempt-rt.conf linaro/configs/ovs.conf linaro/configs/kvm-host.conf linaro/configs/no_hz_full.conf linaro/configs/arndale.conf linaro/configs/bigendian.conf" export device_type="lng-arndale" export rootfs_arch="armv7ab" lmc_dev="arndale" endian="be" ;; vexpress64) export hwpack_type="vexpress64" export board_types="rtsm_foundation-armv8" export kernel_flavour="vexpress64" export conf_filenames="linaro/configs/linaro-base.conf linaro/configs/linaro-base64.conf linaro/configs/distribution.conf linaro/configs/preempt-rt.conf linaro/configs/ovs.conf linaro/configs/kvm-host.conf linaro/configs/no_hz_full.conf linaro/configs/vexpress64.conf" export device_type="rtsm_foundation-armv8" export ARCH="arm64" export toolchain_url="https://releases.linaro.org/${TC_RELEASE}/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-20${TC_RELEASE}_linux.tar.xz" export rootfs_arch="armv8" export make_bootwrapper=false lmc_dev="fastmodel" ;; esac export tcbindir="$HOME/$ARCH-tc-${TC_RELEASE}/bin" mkdir -p $(dirname ${tcbindir}) git clone git://git.linaro.org/ci/lci-build-tools.git bash -x lci-build-tools/jenkins_kernel_build_inst cp -a builddir-*-${kernel_flavour}/.config kernel_config_${hwpack} # Get rootfs rm -f linaro-image-lng-generic*.tar.gz export ROOTFS_BUILD_NUMBER=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/openembedded-${rootfs_arch}-rootfs/gcc_version=${GCC_VERSION},label=build,rootfs=lng/lastSuccessfulBuild/buildNumber` export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/openembedded-${rootfs_arch}-rootfs/gcc_version=${GCC_VERSION},label=build,rootfs=lng/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` export ROOTFS_BUILD_URL="http://snapshots.linaro.org/openembedded/images/lng-${rootfs_arch}-gcc-${GCC_VERSION}/${ROOTFS_BUILD_NUMBER}/linaro-image-lng-generic${rootfs_arch}-${ROOTFS_BUILD_TIMESTAMP}-${ROOTFS_BUILD_NUMBER}.rootfs.tar.gz" wget --progress=dot -e dotbytes=2M ${ROOTFS_BUILD_URL} # Create pre-built image(s) linaro-media-create --dev ${lmc_dev} --output-directory ${WORKSPACE} --image-size 3G --binary linaro-image-lng-generic${rootfs_arch}-${ROOTFS_BUILD_TIMESTAMP}-${ROOTFS_BUILD_NUMBER}.rootfs.tar.gz --hwpack hwpack_linaro-${hwpack_type}*.tar.gz --hwpack-force # Compress image(s) mv sd.img ${hwpack}-lng-sd.img gzip -9 ${hwpack}-lng-sd.img # Create metadata to send to LAVA cat << EOF > metadata.json { "linux.hash":"$(git log -n1 --pretty=format:%h)", "hwpack.endian":"${endian}" } EOF cat << EOF > post_build_lava_parameters HWPACK_JOB_NAME=${JOB_NAME} HWPACK_BUILD_NUMBER=${BUILD_NUMBER} HWPACK_FILE_NAME=`ls hwpack_linaro-${hwpack_type}*.tar.gz` IMAGE_URL=https://snapshots.linaro.org/kernel-hwpack/linux-lng-preempt-rt-${hwpack}/${BUILD_NUMBER}/${hwpack}-lng-sd.img.gz BUNDLE_STREAM_NAME=/public/team/linaro/ci-linux-lng-preempt-rt/ LAVA_TEST_PLAN=nohz-isolation ltp-realtime ltp kvm DEVICE_TYPE=${board_types} DISTRIBUTION=openembedded METADATA_URL=${JOB_URL}/ws/metadata.json EOF cat << EOF > BUILD-INFO.txt Format-Version: 0.5 Files-Pattern: * License-Type: open EOF