aboutsummaryrefslogtreecommitdiff
path: root/rpb-debian.yaml
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2016-07-02 12:20:07 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2016-07-02 12:20:07 +0300
commite0c7324d83a9ae1547d8d363ef708c3c1c881819 (patch)
treef817dc6626a4e643a0accf315848a620ad29289b /rpb-debian.yaml
parentdfc5054ae9b9efdc48a7f5b21350fca158c91333 (diff)
downloadconfigs-e0c7324d83a9ae1547d8d363ef708c3c1c881819.tar.gz
RPB: rename the build jobs files and adjust display names
As part of the Reference Software Platform transition, rename the build jobs files and adjust the display names. It's a purely cosmetic change in order to start to move RPBs into their own namespace: https://ci.linaro.org/view/reference-platform/ Note: the build jobs names aren't yet modified on purpose and avoid to break the build pipeline. Change-Id: Iba180092faafda1378a243d339c19cc2b0c32d9c Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'rpb-debian.yaml')
-rw-r--r--rpb-debian.yaml288
1 files changed, 288 insertions, 0 deletions
diff --git a/rpb-debian.yaml b/rpb-debian.yaml
new file mode 100644
index 000000000..25ee10fd9
--- /dev/null
+++ b/rpb-debian.yaml
@@ -0,0 +1,288 @@
+- job:
+ name: 96boards-reference-platform-debian
+ project-type: matrix
+ defaults: global
+ logrotate:
+ daysToKeep: 30
+ numToKeep: 30
+ properties:
+ - authorization:
+ anonymous:
+ - job-read
+ - job-extended-read
+ - job-workspace
+ linaro:
+ - job-read
+ - job-extended-read
+ - job-build
+ - job-cancel
+ parameters:
+ - string:
+ name: BUNDLE_STREAM_NAME
+ default: '/public/team/linaro/rpb-debian/'
+ - string:
+ name: LAVA_SERVER
+ default: 'validation.linaro.org/RPC2/'
+ disabled: false
+ node: build
+ child-workspace: .
+ display-name: 'Reference Platform - Debian'
+ axes:
+ - axis:
+ type: user-defined
+ name: BOARD
+ values:
+ - hikey
+ - dragonboard410c
+ - axis:
+ type: slave
+ name: label
+ values:
+ - docker-jessie-amd64
+ execution-strategy:
+ sequential: true
+ touchstone:
+ expr: 'BOARD=="hikey"'
+ wrappers:
+ - timestamps
+ - build-name:
+ name: '#${BUILD_NUMBER}'
+ - matrix-tie-parent:
+ node: build
+ 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 ${BOARD}-debian-*.img || true
+ rm -rf configs out
+ }
+
+ # Builder setup
+ sudo apt-get update
+ sudo apt-get install -y android-tools-fsutils grub-common kpartx libfdt-dev mtools python-pycurl dosfstools
+ wget -q \
+ http://repo.linaro.org/ubuntu/linaro-tools/pool/main/l/linaro-image-tools/linaro-image-tools_2016.05-1linarojessie1_amd64.deb \
+ http://repo.linaro.org/ubuntu/linaro-tools/pool/main/l/linaro-image-tools/python-linaro-image-tools_2016.05-1linarojessie1_all.deb
+ sudo dpkg -i --force-all *.deb
+ rm -f *.deb
+
+ git clone --depth 1 http://git.linaro.org/ci/job/configs.git
+
+ # Create the hardware pack
+ cp -a configs/96boards-reference-platform-debian/hwpacks/linaro-${BOARD} .
+ VERSION=`date +%Y%m%d`-${BUILD_NUMBER}
+ linaro-hwpack-create --debug --backports linaro-${BOARD} ${VERSION}
+
+ # Get rootfs
+ export ROOTFS_BUILD_NUMBER=`wget -q --no-check-certificate -O - https://ci.linaro.org/job/debian-arm64-rootfs/label=docker-jessie-arm64,rootfs=alip/lastSuccessfulBuild/buildNumber`
+ export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/job/debian-arm64-rootfs/label=docker-jessie-arm64,rootfs=alip/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd`
+ export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/alip-arm64/${ROOTFS_BUILD_NUMBER}/linaro-jessie-alip-${ROOTFS_BUILD_TIMESTAMP}-${ROOTFS_BUILD_NUMBER}.tar.gz"
+ wget --progress=dot -e dotbytes=2M ${ROOTFS_BUILD_URL}
+ ROOTFS_BUILD_TAR=linaro-jessie-alip-${ROOTFS_BUILD_TIMESTAMP}-${ROOTFS_BUILD_NUMBER}.tar.gz
+
+ # Create pre-built image(s)
+ linaro-media-create --dev fastmodel --output-directory ${WORKSPACE} --image-file ${BOARD}-debian-jessie-alip-sdcard-${VERSION}.img --image-size 2500M --binary ${ROOTFS_BUILD_TAR} --hwpack hwpack_linaro-${BOARD}_*.tar.gz --hwpack-force-yes --bootloader uefi
+
+ # Create eMMC rootfs image(s)
+ mkdir boot rootfs
+ for device in $(sudo kpartx -avs ${BOARD}-debian-jessie-alip-sdcard-${VERSION}.img | cut -d' ' -f3); do
+ partition=$(echo ${device} | cut -d'p' -f3)
+ [ "${partition}" = "1" ] && sudo mount -o loop /dev/mapper/${device} boot
+ [ "${partition}" = "2" ] && sudo mount -o loop /dev/mapper/${device} rootfs
+ done
+
+ KERNEL_VERSION=`basename rootfs/boot/vmlinuz-* | sed -e "s,^[^0-9]*-,,g"`
+
+ mkdir -p out/${BOARD}
+
+ # Build information
+ cat > out/${BOARD}/README.textile << EOF
+
+ h4. 96Boards - Reference Platform Build - Debian
+
+ Build description:
+ * Build URL: "$BUILD_URL":$BUILD_URL
+ * ALIP Rootfs: "http://snapshots.linaro.org/debian/images/alip-arm64/$ROOTFS_BUILD_NUMBER":http://snapshots.linaro.org/debian/images/alip-arm64/$ROOTFS_BUILD_NUMBER
+ * Kernel: "linux-image-$KERNEL_VERSION":http://repo.linaro.org/ubuntu/linaro-overlay/pool/main/l/linux/
+ EOF
+
+ # Create boot image
+ if [ "${BOARD}" == "hikey" ]; then
+ FASTBOOT_EFI_BUILD_NUMBER=`wget -q --no-check-certificate -O - https://ci.linaro.org/view/96boards/job/96boards-reference-uefi/MX_PLATFORM=hikey,MX_TYPE=RELEASE,label=docker-jessie-amd64/lastStableBuild/buildNumber`
+ FASTBOOT_EFI_URL="http://builds.96boards.org/snapshots/reference-platform/components/uefi/${FASTBOOT_EFI_BUILD_NUMBER}/release/hikey/AndroidFastbootApp.efi"
+ wget --progress=dot ${FASTBOOT_EFI_URL} -O fastboot.efi
+ GRUB_EFI_BUILD_NUMBER=`wget -q --no-check-certificate -O - https://ci.linaro.org/view/96boards/job/96boards-reference-grub-efi-arm64/lastStableBuild/buildNumber`
+ GRUB_EFI_URL="https://builds.96boards.org/snapshots/reference-platform/components/grub/${GRUB_EFI_BUILD_NUMBER}/grubaa64.efi"
+ GRUB_SD_EFI_URL="https://builds.96boards.org/snapshots/reference-platform/components/grub/${GRUB_EFI_BUILD_NUMBER}/grubaa64-sd.efi"
+ wget --progress=dot ${GRUB_EFI_URL} -O grubaa64.efi
+ wget --progress=dot ${GRUB_SD_EFI_URL} -O grubaa64-sd.efi
+
+ /sbin/mkfs.fat -F32 -n "boot" -C out/${BOARD}/${BOARD}-boot-linux-${VERSION}.uefi.img 65536
+ mmd -i out/${BOARD}/${BOARD}-boot-linux-${VERSION}.uefi.img EFI
+ mmd -i out/${BOARD}/${BOARD}-boot-linux-${VERSION}.uefi.img EFI/BOOT
+ mcopy -i out/${BOARD}/${BOARD}-boot-linux-${VERSION}.uefi.img fastboot.efi ::EFI/BOOT/fastboot.efi
+ mcopy -i out/${BOARD}/${BOARD}-boot-linux-${VERSION}.uefi.img grubaa64.efi ::EFI/BOOT/grubaa64.efi
+ chmod 644 out/${BOARD}/${BOARD}-boot-linux-${VERSION}.uefi.img
+
+ # Replicate boot image into the original img file
+ sudo rm -rf boot/*
+ sudo mkdir -p boot/EFI/BOOT
+ sudo cp fastboot.efi boot/EFI/BOOT/
+ # Boot partition for SD needs a different grub (default root search)
+ sudo cp grubaa64-sd.efi boot/EFI/BOOT/grubaa64.efi
+ sudo cp grubaa64-sd.efi boot/EFI/BOOT/BOOTAA64.EFI
+
+ # Compress boot partition image
+ gzip -9 out/${BOARD}/${BOARD}-boot-linux-${VERSION}.uefi.img
+
+ cat >> out/${BOARD}/README.textile << EOF
+ * Grub UEFI: "http://builds.96boards.org/snapshots/reference-platform/components/grub/$GRUB_EFI_BUILD_NUMBER":http://builds.96boards.org/snapshots/reference-platform/components/grub/$GRUB_EFI_BUILD_NUMBER
+ * ARM TF / EDK2 UEFI: "http://builds.96boards.org/snapshots/reference-platform/components/uefi/$FASTBOOT_EFI_BUILD_NUMBER/release/hikey":http://builds.96boards.org/snapshots/reference-platform/components/uefi/$FASTBOOT_EFI_BUILD_NUMBER/release/hikey
+ EOF
+ # Grub config to be set as part of the rootfs
+ ## FIXME: Make this generic
+ sudo mkdir rootfs/boot/grub/fonts
+ sudo cp rootfs/usr/share/grub/unicode.pf2 rootfs/boot/grub/fonts
+ sudo grub-editenv rootfs/boot/grubenv create
+ sed -e "s/KERNEL_VERSION/$KERNEL_VERSION/" configs/96boards-reference-platform-debian/grub/grub-hikey.cfg.in > grub.cfg
+ sed -e "s/root=(hd0,gpt9)/root=(hd1,msdos2)/g" -e "s/mmcblk0p9/mmcblk1p2/g" grub.cfg > grub-sd.cfg
+ sudo cp configs/96boards-reference-platform-debian/grub/grub-fastboot.cfg rootfs/boot/grub/custom.cfg
+ sudo cp -a rootfs/usr/lib/grub/arm64-efi rootfs/boot/grub
+ sudo cp hi6220-hikey.dtb rootfs/boot/hi6220-hikey.dtb-${KERNEL_VERSION}
+ sudo ln -s hi6220-hikey.dtb-${KERNEL_VERSION} rootfs/boot/hi6220-hikey.dtb
+ echo "KERNEL_DEVICETREE=hi6220-hikey" | sudo tee rootfs/etc/default/kernel
+ sudo sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT.*/GRUB_CMDLINE_LINUX_DEFAULT="efi=noruntime rw quiet"/g' rootfs/etc/default/grub
+
+ # Since it uses uefi, create the boot efi fstab entry
+ sudo mkdir rootfs/boot/efi
+ cat << EOF | sudo tee rootfs/etc/fstab
+ /dev/disk/by-partlabel/boot /boot/efi vfat defaults 0 0
+ EOF
+
+ elif [ "${BOARD}" == "dragonboard410c" ]; then
+ # Boot image tools
+ git clone git://codeaurora.org/quic/kernel/skales
+ (cd skales && git log -1)
+ export PATH=`pwd`/skales:$PATH
+
+ ## FIXME: See if we can find a better way to package this
+ # Firmware (adreno, venus and WCN)
+ wget --progress=dot -e dotbytes=1M https://developer.qualcomm.com/download/db410c/firmware-410c-1.2.0.bin
+ yes | sh firmware-410c-1.2.0.bin > /dev/null
+ sudo cp -a linux-ubuntu-board-support-package-*/proprietary-ubuntu/* rootfs/lib/firmware
+ sudo rm -f rootfs/lib/firmware.tar
+
+ # add license file in the generated rootfs
+ 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
+
+ # Create device tree table (not really required by u-boot, but needed by mkbootimg)
+ dtbTool -o dt.img -s 2048 rootfs/usr/lib/linux-image-*/qcom
+ # mkbootimg also needs initrd, just use an empty one
+ touch initrd
+
+ # Create boot image (u-boot)
+ mkbootimg \
+ --kernel rootfs/usr/lib/u-boot/dragonboard410c/u-boot.bin \
+ --ramdisk initrd \
+ --output out/${BOARD}/${BOARD}-boot-linux-${VERSION}.img \
+ --dt dt.img \
+ --pagesize "2048" \
+ --base "0x80000000" \
+ --cmdline ""
+ gzip -9 out/${BOARD}/${BOARD}-boot-linux-${VERSION}.img
+
+ # For U-Boot
+ sudo cp apq8016-sbc.dtb rootfs/boot/apq8016-sbc.dtb-${KERNEL_VERSION}
+ sudo ln -s apq8016-sbc.dtb-${KERNEL_VERSION} rootfs/boot/apq8016-sbc.dtb
+ echo "KERNEL_DEVICETREE=apq8016-sbc" | sudo tee rootfs/etc/default/kernel
+ sudo mkdir -p rootfs/boot/extlinux
+ sudo cp configs/96boards-reference-platform-debian/extlinux/dragonboard410c.conf rootfs/boot/extlinux/extlinux.conf
+ fi
+
+ # Create the ext4fs (fastboot compatible)
+ sudo mkfs.ext4 -L rootfs ${BOARD}-rootfs-debian-jessie-alip-${VERSION}.emmc.img.raw 2500M
+ mkdir rootfs_ext4
+ sudo mount -o loop ${BOARD}-rootfs-debian-jessie-alip-${VERSION}.emmc.img.raw rootfs_ext4
+ sudo cp -a rootfs/* rootfs_ext4
+ ## Make grub specific to the image type (e.g. emmc, sd)
+ if [ -f grub.cfg ]; then
+ sudo cp grub.cfg rootfs_ext4/boot/grub
+ sudo cp grub-sd.cfg rootfs/boot/grub/grub.cfg
+ fi
+ sudo umount boot rootfs_ext4 rootfs
+ sudo ext2simg -v ${BOARD}-rootfs-debian-jessie-alip-${VERSION}.emmc.img.raw out/${BOARD}/${BOARD}-rootfs-debian-jessie-alip-${VERSION}.emmc.img
+
+ sudo kpartx -dv ${BOARD}-debian-jessie-alip-sdcard-${VERSION}.img
+ sudo rm -rf boot rootfs rootfs_ext4 ${BOARD}-rootfs-debian-jessie-alip-${VERSION}.emmc.img.raw
+
+ # Compress image
+ gzip -9 out/${BOARD}/${BOARD}-rootfs-debian-jessie-alip-${VERSION}.emmc.img
+
+ # Publish remaining files
+ mkdir -p out/${BOARD}/hwpack
+ cp hwpack* out/${BOARD}/hwpack
+ ## For SD Card or other boot medias
+ cp ${BOARD}-debian-jessie-alip-sdcard-${VERSION}.img out/${BOARD}/
+ gzip -9 out/${BOARD}/${BOARD}-debian-jessie-alip-sdcard-${VERSION}.img
+
+ # Create MD5SUMS files
+ (cd out/${BOARD} && md5sum *.gz > MD5SUMS.txt)
+ (cd out/${BOARD}/hwpack && md5sum * > MD5SUMS.txt)
+
+ # Publish
+ 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} \
+ out/${BOARD} snapshots/reference-platform/debian/${BUILD_NUMBER}/${BOARD}
+ python ${HOME}/bin/linaro-cp.py \
+ --server ${PUBLISH_SERVER} \
+ --make-link snapshots/reference-platform/debian/${BUILD_NUMBER}
+
+ cat << EOF > post_build_lava_parameters
+ BOOT_URL=http://builds.96boards.org/snapshots/reference-platform/debian/${BUILD_NUMBER}/${BOARD}/$(ls out/${BOARD}/${BOARD}-boot-linux-${VERSION}.*img.gz | xargs basename)
+ ROOTFS_BUILD_URL=http://builds.96boards.org/snapshots/reference-platform/debian/${BUILD_NUMBER}/${BOARD}/${BOARD}-rootfs-debian-jessie-alip-${VERSION}.emmc.img.gz
+ SYSTEM_URL=http://builds.96boards.org/snapshots/reference-platform/debian/${BUILD_NUMBER}/${BOARD}/${BOARD}-rootfs-debian-jessie-alip-${VERSION}.emmc.img.gz
+ DTB=hi6220-hikey.dtb-${KERNEL_VERSION}
+ EOF
+ - inject:
+ properties-file: post_build_lava_parameters
+ - shell: |
+ case "${BOARD}" in
+ hikey)
+ export DEVICE_TYPE=hi6220-hikey
+ export root='$root'
+ ;;
+ dragonboard410c)
+ export DEVICE_TYPE=apq8016-sbc
+ ;;
+ esac
+
+ 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/96boards-reference-platform-debian/lava-job-definitions/${DEVICE_TYPE}/template-wa2.yaml > custom_lava_job_definition_wa2.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_wa2.json
+ LAVA_SERVER=${LAVA_SERVER}
+ EOF
+ - trigger-builds:
+ - project: 'post-build-lava'
+ property-file: post_build_lava_parameters
+ block: true
+ publishers:
+ - email:
+ recipients: 'fathi.boudra@linaro.org ricardo.salveti@linaro.org'