- job: name: lt-qcom-ubuntu-images-arm64 project-type: freestyle defaults: global logrotate: daysToKeep: 30 numToKeep: 30 properties: - authorization: anonymous: - job-read - job-extended-read - job-workspace linaro-landing-team-qualcomm-personnel: - job-build - job-cancel parameters: - string: name: BUNDLE_STREAM_NAME default: '/public/team/linaro/lt-qualcomm/' - string: name: DEVICE_TYPE default: 'apq8016-sbc' - string: name: LAVA_SERVER default: 'validation.linaro.org/RPC2/' - string: name: OS_FLAVOUR default: 'vivid' - string: name: UBUNTU_VERSION default: '15.04' - string: name: PLATFORM_NAME default: 'qcom-snapdragon-arm64' - string: name: ROOTFS default: 'developer alip' - string: name: DTBS default: 'msm8916-mtp.dtb apq8016-sbc.dtb' - string: name: SERIAL_CONSOLE default: 'ttyMSM0' - string: name: KERNEL_BRANCH default: 'release/qcomlt-4.2' - password: name: PRIVATE_KEY default: ${LT_QUALCOMM_PRIVATE_KEY} disabled: false node: docker-utopic-amd64 display-name: 'Qualcomm Ubuntu based images (arm64)' scm: - git: url: https://git.linaro.org/git/landing-teams/working/qualcomm/kernel.git refspec: +refs/heads/${KERNEL_BRANCH}:refs/remotes/origin/${KERNEL_BRANCH} name: origin branches: - refs/heads/${KERNEL_BRANCH} skip-tag: true shallow-clone: true wipe-workspace: false wrappers: - timestamps - build-name: name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}' builders: - linaro-publish-token: host: builds.96boards.org - shell: | #!/bin/bash set -ex trap cleanup_exit INT TERM EXIT cleanup_exit() { cd ${WORKSPACE} sudo kpartx -dv out/linaro-${OS_FLAVOUR}-*.sd.img || true rm -rf lci-build-tools rm -rf builddir* rm -rf out git clean -fdx } sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list sudo apt-get update sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip libfdt-dev wget -q \ http://repo.linaro.org/ubuntu/linaro-overlay/pool/main/a/android-tools/android-tools-fsutils_4.2.2+git20130218-3ubuntu41+linaro1_amd64.deb \ http://repo.linaro.org/ubuntu/linaro-overlay/pool/main/m/multipath-tools/kpartx_0.5.0-7ubuntu7.1_amd64.deb sudo dpkg -i --force-all *.deb rm -f *.deb # get the boot image tools, and keep track of commit info in the traces git clone git://codeaurora.org/quic/kernel/skales (cd skales && git log -1) export PATH=`pwd`/skales:$PATH export LANG=C export make_bootwrapper=false export make_install=true export kernel_flavour=lt-qcom export kernel_config="defconfig distro.config" export MAKE_DTBS=true export ARCH=arm64 export tcbindir="${HOME}/srv/toolchain/arm64-tc-14.09/bin" export toolchain_url=http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz test -d lci-build-tools || git clone https://git.linaro.org/git/ci/lci-build-tools.git lci-build-tools bash -x lci-build-tools/jenkins_kernel_build_inst # Create the hardware pack cat << EOF > linaro-lt-qcom.default format: '3.0' name: linaro-lt-qcom architectures: - arm64 origin: Linaro maintainer: Linaro Platform support: supported serial_tty: ${SERIAL_CONSOLE} kernel_addr: '0x80208000' initrd_addr: '0x83000000' load_addr: '0x60008000' dtb_addr: '0x61000000' partition_layout: bootfs_rootfs mmc_id: '0:1' kernel_file: boot/Image-*-qcom initrd_file: boot/initrd.img-*-qcom dtb_file: lib/firmware/*-qcom/device-tree/msm8916-mtp.dtb boot_script: boot.scr boot_min_size: 64 extra_serial_options: - console=tty0 - console=${SERIAL_CONSOLE},115200n8 assume_installed: - linaro-headless - linux-firmware sources: qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main ubuntu: http://ports.ubuntu.com/ubuntu-ports ${OS_FLAVOUR} main universe packages: - linux-image-generic - linux-headers-generic - libasound2 - wcnss-wlan - wcnss-bt EOF cat > out/README.txt << EOF This build is using artifacts from the following builds: EOF for rootfs in ${ROOTFS}; do cat linaro-lt-qcom.default > linaro-lt-qcom # additional packages in desktop images [ "${rootfs}" != "developer" ] && cat << EOF >> linaro-lt-qcom - libdrm2 - libdrm-freedreno1 - libdrm-nouveau2 - libdrm-radeon1 - libegl1-mesa - libegl1-mesa-drivers - libgbm1 - libgl1-mesa-dri - libgl1-mesa-glx - libglapi-mesa - libgles1-mesa - libgles2-mesa - libosmesa6 - libwayland-egl1-mesa - libxatracker2 - xserver-xorg-video-freedreno - mesa-utils - gstreamer1.0-plugins-v4l2 EOF rm -f `ls hwpack_linaro-lt-qcom_*_arm64_supported.tar.gz` VERSION=`date +%Y%m%d`-${BUILD_NUMBER} linaro-hwpack-create --debug linaro-lt-qcom ${VERSION} linaro-hwpack-replace -t `ls hwpack_linaro-lt-qcom_*_arm64_supported.tar.gz` -p `ls linux-image-*-linaro-lt-qcom_*.deb` -r linux-image -d -i linaro-hwpack-replace -t `ls hwpack_linaro-lt-qcom_*_arm64_supported.tar.gz` -p `ls linux-headers-*-linaro-lt-qcom_*.deb` -r linux-headers -d -i # Get rootfs export ROOTFS_BUILD_NUMBER=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/ubuntu-arm64-rootfs/label=docker-vivid-arm64,rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/ubuntu-arm64-rootfs/label=docker-vivid-arm64,rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` export ROOTFS_BUILD_URL="http://snapshots.linaro.org/ubuntu/images/${rootfs}-arm64/${ROOTFS_BUILD_NUMBER}/linaro-${OS_FLAVOUR}-${rootfs}-${ROOTFS_BUILD_TIMESTAMP}-${ROOTFS_BUILD_NUMBER}.tar.gz" wget --progress=dot -e dotbytes=2M ${ROOTFS_BUILD_URL} # Create pre-built image(s) linaro-media-create --dev fastmodel --output-directory ${WORKSPACE}/out --image-file linaro-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img --image-size 2G --binary linaro-${OS_FLAVOUR}-${rootfs}-${ROOTFS_BUILD_TIMESTAMP}-${ROOTFS_BUILD_NUMBER}.tar.gz --hwpack hwpack_linaro-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi # Create eMMC rootfs image(s) mkdir rootfs for device in $(sudo kpartx -avs out/linaro-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img | cut -d' ' -f3); do partition=$(echo ${device} | cut -d'p' -f3) [ "${partition}" = "2" ] && sudo mount -o loop /dev/mapper/${device} rootfs done sudo ln -sf /run/resolvconf/resolv.conf rootfs/etc/resolv.conf sudo rm -rf rootfs/dev rootfs/boot rootfs/var/lib/apt/lists sudo mkdir rootfs/dev rootfs/boot rootfs/var/lib/apt/lists # clean up fstab sudo sed -i '/UUID/d' rootfs/etc/fstab # add license file in the generated rootfs rm -f license.txt wget https://git.linaro.org/landing-teams/working/qualcomm/lt-docs.git/blob_plain/HEAD:/license/license.txt sudo cp -f license.txt rootfs/etc/license.txt # add firmware (adreno, venus and WCN) wget -qO- https://builds.96boards.org/snapshots/dragonboard410c/binaries/20150616/firmware.tar.gz | sudo tar xzv -C rootfs/lib/firmware sudo rm -f rootfs/lib/firmware/wlan/macaddr0 sudo make_ext4fs -o -L rootfs -l 6800M -s out/linaro-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img rootfs/ sudo umount rootfs sudo kpartx -dv out/linaro-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img sudo rm -rf rootfs out/linaro-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img # Compress image(s) gzip -9 out/linaro-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img cat >> out/README.txt << EOF Linaro Ubuntu ${rootfs} build: http://snapshots.linaro.org/ubuntu/images/${rootfs}-arm64/${ROOTFS_BUILD_NUMBER} EOF done # Move all relevant DTBs in out/ for f in ${DTBS} ; do mv out/dtbs/${f} out/ done rm -rf out/dtbs # Create device tree table dtbTool -o out/dt.img -s 2048 out/ # Create boot image mkbootimg \ --kernel out/Image \ --ramdisk out/initrd.img-* \ --output out/boot-linaro-${OS_FLAVOUR}-${PLATFORM_NAME}-${VERSION}.img \ --dt out/dt.img \ --pagesize "2048" \ --base "0x80000000" \ --cmdline "root=/dev/disk/by-partlabel/rootfs rw rootwait console=tty0 console=${SERIAL_CONSOLE},115200n8" gzip -9 out/boot-linaro-${OS_FLAVOUR}-${PLATFORM_NAME}-${VERSION}.img # Final preparation for publishing cp -a linux-*.deb out/ ####################################### # let's create the SD install image now ####################################### TMPKEYDIR=$(mktemp -d /tmp/qcom.XXXXXX) cat > ${TMPKEYDIR}/private-key-wrapper.py << EOF #!/usr/bin/python import os import sys def main(): private_key = os.environ.get("PRIVATE_KEY", "Undefined") if private_key == "Undefined": sys.exit("PRIVATE_KEY is not defined.") buffer = private_key.replace(' ','\n') with open('linaro-private-key', 'w') as f: f.write('-----BEGIN RSA PRIVATE KEY-----\n') f.write(buffer) f.write('\n-----END RSA PRIVATE KEY-----\n') if __name__ == "__main__": main() EOF python ${TMPKEYDIR}/private-key-wrapper.py chmod 0600 ${WORKSPACE}/linaro-private-key eval `ssh-agent` >/dev/null 2>/dev/null ssh-add ${WORKSPACE}/linaro-private-key >/dev/null 2>/dev/null rm -rf ${WORKSPACE}/linaro-private-key ${TMPKEYDIR} mkdir ~/.ssh ssh-keyscan dev-private-git.linaro.org >> ~/.ssh/known_hosts cat << EOF >> ~/.ssh/config Host dev-private-git.linaro.org User git EOF chmod 0600 ~/.ssh/* git clone --depth 1 ssh://dev-private-git.linaro.org/landing-teams/working/qualcomm/db410c_bootloader.git # record commit info in build log cd db410c_bootloader git log -1 cd emmc_linux cp ../../out/boot-linaro-${OS_FLAVOUR}-${PLATFORM_NAME}-${VERSION}.img.gz boot.img.gz cp ../../out/linaro-${OS_FLAVOUR}-alip-${PLATFORM_NAME}-${VERSION}.img.gz rootfs.img.gz gunzip *.img.gz cat << EOF >> os.json { "name": "Linaro Linux Desktop for DragonBoard 410c - Build #${BUILD_NUMBER}", "url": "http://builds.96boards.org/releases/dragonboard410c", "version": "${VERSION}", "release_date": "`date +%Y-%m-%d`", "description": "Linaro Linux with LXDE desktop based on Ubuntu ${UBUNTU_VERSION} for DragonBoard 410c" } EOF cd ../sd_install # quick hack for now, need to create the proper job that builds the initrd wget --progress=dot -e dotbytes=2M http://people.linaro.org/~nicolas.dechesne/boot-burn.img cd .. ./build sdcard_install_ubuntu # add license.txt file rm -f license.txt wget https://git.linaro.org/landing-teams/working/qualcomm/lt-docs.git/blob_plain/HEAD:/license/license.txt cp license.txt out/dragonboard410c_sdcard_install_ubuntu # create archive for publishing zip -rj ../out/dragonboard410c_sdcard_install_ubuntu-${BUILD_NUMBER}.zip out/dragonboard410c_sdcard_install_ubuntu cd .. # Create MD5SUMS file (cd out && md5sum * > MD5SUMS.txt) # Publish to snapshots test -d ${HOME}/bin || mkdir ${HOME}/bin wget https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O ${HOME}/bin/linaro-cp.py time python ${HOME}/bin/linaro-cp.py \ --server ${PUBLISH_SERVER} \ --link-latest \ out snapshots/dragonboard410c/linaro/ubuntu/${BUILD_NUMBER} - shell: | VERSION=`date +%Y%m%d`-${BUILD_NUMBER} export BOOT_URL=http://builds.96boards.org/snapshots/dragonboard410c/linaro/ubuntu/${BUILD_NUMBER}/boot-linaro-${OS_FLAVOUR}-${PLATFORM_NAME}-${VERSION}.img.gz export ROOTFS_BUILD_URL=http://builds.96boards.org/snapshots/dragonboard410c/linaro/ubuntu/${BUILD_NUMBER}/linaro-${OS_FLAVOUR}-developer-${PLATFORM_NAME}-${VERSION}.img.gz rm -rf configs lci-build-tools git clone --depth 1 http://git.linaro.org/ci/lci-build-tools.git git clone --depth 1 http://git.linaro.org/ci/job/configs.git ./lci-build-tools/yaml-to-json.py configs/${JOB_NAME}/lava-job-definitions/${DEVICE_TYPE}/template.yaml > custom_lava_job_definition.json cat << EOF > post_build_lava_parameters DEVICE_TYPE=${DEVICE_TYPE} BUNDLE_STREAM_NAME=${BUNDLE_STREAM_NAME} CUSTOM_JSON_URL=${JOB_URL}/ws/custom_lava_job_definition.json LAVA_SERVER=${LAVA_SERVER} EOF - trigger-builds: - project: 'post-build-lava' property-file: post_build_lava_parameters block: true - shell: | VERSION=`date +%Y%m%d`-${BUILD_NUMBER} export BOOT_URL=http://builds.96boards.org/snapshots/dragonboard410c/linaro/ubuntu/${BUILD_NUMBER}/boot-linaro-${OS_FLAVOUR}-${PLATFORM_NAME}-${VERSION}.img.gz export ROOTFS_BUILD_URL=http://builds.96boards.org/snapshots/dragonboard410c/linaro/ubuntu/${BUILD_NUMBER}/linaro-${OS_FLAVOUR}-developer-${PLATFORM_NAME}-${VERSION}.img.gz ./lci-build-tools/yaml-to-json.py configs/${JOB_NAME}/lava-job-definitions/${DEVICE_TYPE}/template-ltp.yaml > custom_lava_job_definition_ltp.json cat << EOF > post_build_lava_parameters DEVICE_TYPE=${DEVICE_TYPE} BUNDLE_STREAM_NAME=${BUNDLE_STREAM_NAME} CUSTOM_JSON_URL=${JOB_URL}/ws/custom_lava_job_definition_ltp.json LAVA_SERVER=${LAVA_SERVER} EOF - trigger-builds: - project: 'post-build-lava' property-file: post_build_lava_parameters block: true publishers: - email: recipients: 'nicolas.dechesne@linaro.org fathi.boudra@linaro.org' - ircbot: channels: - name: '#linaro-lt-qcomm' password: ${LT_QCOM_KEY}