diff options
-rw-r--r-- | lt-qcom-db410c-bootloader.yaml | 130 | ||||
-rw-r--r-- | lt-qcom-db410c-bootloader/builders.sh | 127 | ||||
-rw-r--r-- | lt-qcom-debian-96boards-images.yaml | 219 | ||||
-rw-r--r-- | lt-qcom-debian-96boards-images/builders.sh | 216 | ||||
-rw-r--r-- | lt-qcom-debian-images-arm64.yaml | 304 | ||||
-rw-r--r-- | lt-qcom-debian-images-arm64/builders.sh | 301 | ||||
-rw-r--r-- | lt-qcom-debian-images-tracking-arm64.yaml | 229 | ||||
-rw-r--r-- | lt-qcom-debian-images-tracking-arm64/builders.sh | 226 | ||||
-rw-r--r-- | lt-qcom-debian-images-tracking.yaml | 214 | ||||
-rw-r--r-- | lt-qcom-debian-images-tracking/builders.sh | 211 | ||||
-rw-r--r-- | lt-qcom-debian-images.yaml | 214 | ||||
-rw-r--r-- | lt-qcom-debian-images/builders.sh | 211 |
12 files changed, 1304 insertions, 1298 deletions
diff --git a/lt-qcom-db410c-bootloader.yaml b/lt-qcom-db410c-bootloader.yaml index a2ff0fe7f0..507f5919aa 100644 --- a/lt-qcom-db410c-bootloader.yaml +++ b/lt-qcom-db410c-bootloader.yaml @@ -74,134 +74,8 @@ builders: - linaro-publish-token: host: builds.96boards.org - - shell: | - #!/bin/bash - set -ex - - sudo apt-get update - sudo apt-get install -y zip gdisk - - # download the firmware packages - wget -q ${QCOM_LINUX_FIRMWARE} - wget -q ${QCOM_ANDROID_FIRMWARE} - wget -q ${QCOM_ANDROID_FIRMWARE_OLD} - echo "${QCOM_LINUX_FIRMWARE_MD5} $(basename ${QCOM_LINUX_FIRMWARE})" > MD5 - echo "${QCOM_ANDROID_FIRMWARE_MD5} $(basename ${QCOM_ANDROID_FIRMWARE})" >> MD5 - echo "${QCOM_ANDROID_FIRMWARE_OLD_MD5} $(basename ${QCOM_ANDROID_FIRMWARE_OLD})" >> MD5 - md5sum -c MD5 - - unzip -j -d bootloaders-android $(basename ${QCOM_ANDROID_FIRMWARE}) - unzip -j -d bootloaders-android-old $(basename ${QCOM_ANDROID_FIRMWARE_OLD}) - unzip -j -d bootloaders-linux $(basename ${QCOM_LINUX_FIRMWARE}) "*/bootloaders-linux/*" - - # Get the Android compiler - git clone ${LK_GCC_GIT} --depth 1 -b ${LK_GCC_REL} android-gcc - - # Build all needed flavors of LK - git clone --depth 1 ${LK_GIT_LINARO} -b ${LK_GIT_REL_SD_RESCUE} lk_sdrescue - git clone --depth 1 ${LK_GIT_LINARO} -b ${LK_GIT_REL_SD_BOOT} lk_sd_boot - git clone --depth 1 ${LK_GIT_LINARO} -b ${LK_GIT_REL_EMMC_BOOT} lk_emmc_boot - - for lk in lk_sdrescue lk_sd_boot lk_emmc_boot; do - echo "Building LK in : $lk" - cd $lk - git log -1 - make -j4 msm8916 EMMC_BOOT=1 TOOLCHAIN_PREFIX=${WORKSPACE}/android-gcc/bin/arm-eabi- - cd - - done - - mkdir -p out/dragonboard410c_sdcard_rescue \ - out/dragonboard410c_bootloader_sd_linux \ - out/dragonboard410c_bootloader_emmc_linux \ - out/dragonboard410c_bootloader_emmc_android - - # get license.txt file - wget https://git.linaro.org/landing-teams/working/qualcomm/lt-docs.git/blob_plain/HEAD:/license/license.txt - - # bootloader_emmc_linux - cp -a license.txt \ - dragonboard410c/linux/flashall \ - lk_emmc_boot/build-msm8916/emmc_appsboot.mbn \ - bootloaders-linux/{NON-HLOS.bin,rpm.mbn,sbl1.mbn,tz.mbn,tz-psci.mbn,hyp.mbn} \ - out/dragonboard410c_bootloader_emmc_linux - - # no need to set the eMMC size here. Fastboot will patch the last partition and grow it until last sector - sudo ./mksdcard -x -g -o gpt.img -p dragonboard410c/linux/partitions.txt - sudo sgdisk -bgpt.bin gpt.img - ./mkgpt -d -i gpt.bin -o out/dragonboard410c_bootloader_emmc_linux/gpt_both0.bin - - # bootloader_emmc_android - cp -a license.txt \ - dragonboard410c/android/flashall \ - dragonboard410c/android/emmc_appsboot.mbn \ - bootloaders-android-old/sbl1.mbn \ - bootloaders-android/{NON-HLOS.bin,rpm.mbn,tz.mbn,hyp.mbn} \ - out/dragonboard410c_bootloader_emmc_android - - # no need to set the eMMC size here. Fastboot will patch the last partition and grow it until last sector - sudo ./mksdcard -x -g -o gpt.img -p dragonboard410c/android/partitions.txt - sudo sgdisk -bgpt.bin gpt.img - ./mkgpt -d -i gpt.bin -o out/dragonboard410c_bootloader_emmc_android/gpt_both0.bin - - # bootloader_sd_linux - cp -a license.txt \ - lk_sd_boot/build-msm8916/emmc_appsboot.mbn \ - bootloaders-linux/{NON-HLOS.bin,rpm.mbn,sbl1.mbn,tz.mbn,tz-psci.mbn,hyp.mbn} \ - out/dragonboard410c_bootloader_sd_linux - - # sdcard_rescue - cp -a license.txt out/dragonboard410c_sdcard_rescue - sudo ./mksdcard -x -p dragonboard410c/linux/sdrescue.txt \ - -o out/dragonboard410c_sdcard_rescue/db410c_sd_rescue.img \ - -i lk_sdrescue/build-msm8916/ \ - -i bootloaders-linux/ - - # Create MD5SUMS file - for i in dragonboard410c_sdcard_rescue dragonboard410c_bootloader_sd_linux \ - dragonboard410c_bootloader_emmc_linux dragonboard410c_bootloader_emmc_android; do - (cd out/$i && md5sum * > MD5SUMS.txt) - done - - # Final preparation of archives for publishing - mkdir out2 - zip -rj out2/dragonboard410c_sdcard_rescue-${BUILD_NUMBER}.zip out/dragonboard410c_sdcard_rescue - zip -rj out2/dragonboard410c_bootloader_emmc_linux-${BUILD_NUMBER}.zip out/dragonboard410c_bootloader_emmc_linux - zip -rj out2/dragonboard410c_bootloader_emmc_android-${BUILD_NUMBER}.zip out/dragonboard410c_bootloader_emmc_android - zip -rj out2/dragonboard410c_bootloader_sd_linux-${BUILD_NUMBER}.zip out/dragonboard410c_bootloader_sd_linux - - # Create MD5SUMS file - (cd out2 && md5sum * > MD5SUMS.txt) - - # Build information - cat > out2/HEADER.textile << EOF - - h4. Bootloaders for Dragonboard 410c - - This page provides the bootloaders packages for the Dragonboard 410c. There are several packages: - * *sdcard_rescue* : an SD card image that can be used to boot from SD card, and rescue a board when the onboard eMMC is empty or corrupted - * *bootloader_emmc_linux* : includes the bootloaders and partition table (GPT) used when booting Linux images from onboard eMMC - * *bootloader_emmc_android* : includes the bootloaders and partition table (GPT) used when booting Android images from onboard eMMC - * *bootloader_sd_linux* : includes the bootloaders and partition table (GPT) used when booting Linux images from SD card - - Build description: - * Build URL: "$BUILD_URL":$BUILD_URL - * Proprietary bootloaders can be found on "Qualcomm Developer Network":https://developer.qualcomm.com/hardware/dragonboard-410c/tools - * Android proprietary bootloaders package: $(basename ${QCOM_ANDROID_FIRMWARE}) - * Linux proprietary bootloaders package: $(basename ${QCOM_LINUX_FIRMWARE}) - * Little Kernel (LK) source code: - ** "SD rescue boot":$LK_GIT_LINARO/shortlog/refs/heads/$LK_GIT_REL_SD_RESCUE - ** "SD Linux boot":$LK_GIT_LINARO/shortlog/refs/heads/$LK_GIT_REL_SD_BOOT - ** "eMMC Linux boot":$LK_GIT_LINARO/shortlog/refs/heads/$LK_GIT_REL_EMMC_BOOT - * Tools version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT - EOF - - # Publish - test -d ${HOME}/bin || mkdir ${HOME}/bin - wget -q 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 \ - out2 snapshots/dragonboard410c/linaro/rescue-ng/${BUILD_NUMBER} + - shell: + !include-raw: lt-qcom-db410c-bootloader/builders.sh publishers: - email: recipients: 'nicolas.dechesne@linaro.org fathi.boudra@linaro.org' diff --git a/lt-qcom-db410c-bootloader/builders.sh b/lt-qcom-db410c-bootloader/builders.sh new file mode 100644 index 0000000000..797b1932ac --- /dev/null +++ b/lt-qcom-db410c-bootloader/builders.sh @@ -0,0 +1,127 @@ +#!/bin/bash +set -ex + +sudo apt-get update +sudo apt-get install -y zip gdisk + +# download the firmware packages +wget -q ${QCOM_LINUX_FIRMWARE} +wget -q ${QCOM_ANDROID_FIRMWARE} +wget -q ${QCOM_ANDROID_FIRMWARE_OLD} +echo "${QCOM_LINUX_FIRMWARE_MD5} $(basename ${QCOM_LINUX_FIRMWARE})" > MD5 +echo "${QCOM_ANDROID_FIRMWARE_MD5} $(basename ${QCOM_ANDROID_FIRMWARE})" >> MD5 +echo "${QCOM_ANDROID_FIRMWARE_OLD_MD5} $(basename ${QCOM_ANDROID_FIRMWARE_OLD})" >> MD5 +md5sum -c MD5 + +unzip -j -d bootloaders-android $(basename ${QCOM_ANDROID_FIRMWARE}) +unzip -j -d bootloaders-android-old $(basename ${QCOM_ANDROID_FIRMWARE_OLD}) +unzip -j -d bootloaders-linux $(basename ${QCOM_LINUX_FIRMWARE}) "*/bootloaders-linux/*" + +# Get the Android compiler +git clone ${LK_GCC_GIT} --depth 1 -b ${LK_GCC_REL} android-gcc + +# Build all needed flavors of LK +git clone --depth 1 ${LK_GIT_LINARO} -b ${LK_GIT_REL_SD_RESCUE} lk_sdrescue +git clone --depth 1 ${LK_GIT_LINARO} -b ${LK_GIT_REL_SD_BOOT} lk_sd_boot +git clone --depth 1 ${LK_GIT_LINARO} -b ${LK_GIT_REL_EMMC_BOOT} lk_emmc_boot + +for lk in lk_sdrescue lk_sd_boot lk_emmc_boot; do + echo "Building LK in : $lk" + cd $lk + git log -1 + make -j4 msm8916 EMMC_BOOT=1 TOOLCHAIN_PREFIX=${WORKSPACE}/android-gcc/bin/arm-eabi- + cd - +done + +mkdir -p out/dragonboard410c_sdcard_rescue \ + out/dragonboard410c_bootloader_sd_linux \ + out/dragonboard410c_bootloader_emmc_linux \ + out/dragonboard410c_bootloader_emmc_android + +# get license.txt file +wget https://git.linaro.org/landing-teams/working/qualcomm/lt-docs.git/blob_plain/HEAD:/license/license.txt + +# bootloader_emmc_linux +cp -a license.txt \ + dragonboard410c/linux/flashall \ + lk_emmc_boot/build-msm8916/emmc_appsboot.mbn \ + bootloaders-linux/{NON-HLOS.bin,rpm.mbn,sbl1.mbn,tz.mbn,tz-psci.mbn,hyp.mbn} \ + out/dragonboard410c_bootloader_emmc_linux + +# no need to set the eMMC size here. Fastboot will patch the last partition and grow it until last sector +sudo ./mksdcard -x -g -o gpt.img -p dragonboard410c/linux/partitions.txt +sudo sgdisk -bgpt.bin gpt.img +./mkgpt -d -i gpt.bin -o out/dragonboard410c_bootloader_emmc_linux/gpt_both0.bin + +# bootloader_emmc_android +cp -a license.txt \ + dragonboard410c/android/flashall \ + dragonboard410c/android/emmc_appsboot.mbn \ + bootloaders-android-old/sbl1.mbn \ + bootloaders-android/{NON-HLOS.bin,rpm.mbn,tz.mbn,hyp.mbn} \ + out/dragonboard410c_bootloader_emmc_android + +# no need to set the eMMC size here. Fastboot will patch the last partition and grow it until last sector +sudo ./mksdcard -x -g -o gpt.img -p dragonboard410c/android/partitions.txt +sudo sgdisk -bgpt.bin gpt.img +./mkgpt -d -i gpt.bin -o out/dragonboard410c_bootloader_emmc_android/gpt_both0.bin + +# bootloader_sd_linux +cp -a license.txt \ + lk_sd_boot/build-msm8916/emmc_appsboot.mbn \ + bootloaders-linux/{NON-HLOS.bin,rpm.mbn,sbl1.mbn,tz.mbn,tz-psci.mbn,hyp.mbn} \ + out/dragonboard410c_bootloader_sd_linux + +# sdcard_rescue +cp -a license.txt out/dragonboard410c_sdcard_rescue +sudo ./mksdcard -x -p dragonboard410c/linux/sdrescue.txt \ + -o out/dragonboard410c_sdcard_rescue/db410c_sd_rescue.img \ + -i lk_sdrescue/build-msm8916/ \ + -i bootloaders-linux/ + +# Create MD5SUMS file +for i in dragonboard410c_sdcard_rescue dragonboard410c_bootloader_sd_linux \ + dragonboard410c_bootloader_emmc_linux dragonboard410c_bootloader_emmc_android; do + (cd out/$i && md5sum * > MD5SUMS.txt) +done + +# Final preparation of archives for publishing +mkdir out2 +zip -rj out2/dragonboard410c_sdcard_rescue-${BUILD_NUMBER}.zip out/dragonboard410c_sdcard_rescue +zip -rj out2/dragonboard410c_bootloader_emmc_linux-${BUILD_NUMBER}.zip out/dragonboard410c_bootloader_emmc_linux +zip -rj out2/dragonboard410c_bootloader_emmc_android-${BUILD_NUMBER}.zip out/dragonboard410c_bootloader_emmc_android +zip -rj out2/dragonboard410c_bootloader_sd_linux-${BUILD_NUMBER}.zip out/dragonboard410c_bootloader_sd_linux + +# Create MD5SUMS file +(cd out2 && md5sum * > MD5SUMS.txt) + +# Build information +cat > out2/HEADER.textile << EOF + +h4. Bootloaders for Dragonboard 410c + +This page provides the bootloaders packages for the Dragonboard 410c. There are several packages: +* *sdcard_rescue* : an SD card image that can be used to boot from SD card, and rescue a board when the onboard eMMC is empty or corrupted +* *bootloader_emmc_linux* : includes the bootloaders and partition table (GPT) used when booting Linux images from onboard eMMC +* *bootloader_emmc_android* : includes the bootloaders and partition table (GPT) used when booting Android images from onboard eMMC +* *bootloader_sd_linux* : includes the bootloaders and partition table (GPT) used when booting Linux images from SD card + +Build description: +* Build URL: "$BUILD_URL":$BUILD_URL +* Proprietary bootloaders can be found on "Qualcomm Developer Network":https://developer.qualcomm.com/hardware/dragonboard-410c/tools +* Android proprietary bootloaders package: $(basename ${QCOM_ANDROID_FIRMWARE}) +* Linux proprietary bootloaders package: $(basename ${QCOM_LINUX_FIRMWARE}) +* Little Kernel (LK) source code: +** "SD rescue boot":$LK_GIT_LINARO/shortlog/refs/heads/$LK_GIT_REL_SD_RESCUE +** "SD Linux boot":$LK_GIT_LINARO/shortlog/refs/heads/$LK_GIT_REL_SD_BOOT +** "eMMC Linux boot":$LK_GIT_LINARO/shortlog/refs/heads/$LK_GIT_REL_EMMC_BOOT +* Tools version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT +EOF + +# Publish +test -d ${HOME}/bin || mkdir ${HOME}/bin +wget -q 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 \ + out2 snapshots/dragonboard410c/linaro/rescue-ng/${BUILD_NUMBER} diff --git a/lt-qcom-debian-96boards-images.yaml b/lt-qcom-debian-96boards-images.yaml index 9bbbcddb9f..72498e7896 100644 --- a/lt-qcom-debian-96boards-images.yaml +++ b/lt-qcom-debian-96boards-images.yaml @@ -71,223 +71,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/${VENDOR}-${OS_FLAVOUR}-*.sd.img || true - sudo git clean -fdx - } - - sudo apt-get update - sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip android-tools-fsutils - 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 - - export LANG=C - export make_bootwrapper=false - export make_install=true - export kernel_flavour=lt-qcom - export kernel_config="qcom_defconfig distro.config" - export MAKE_DTBS=true - export tcbindir="${HOME}/srv/toolchain/arm-tc-14.04/bin" - export toolchain_url=http://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_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 > ${VENDOR}-lt-qcom.default - format: '3.0' - name: ${VENDOR}-lt-qcom - architectures: - - armhf - origin: Linaro - maintainer: Linaro Platform <linaro-dev@lists.linaro.org> - 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/vmlinuz-*-qcom - initrd_file: boot/initrd.img-*-qcom - dtb_file: lib/firmware/*-qcom/device-tree/qcom-apq8064-arrow-sd-600eval.dtb - dtb_files: - - qcom-apq8064-arrow-sd-600eval.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-arrow-sd-600eval.dtb - boot_script: boot.scr - boot_min_size: 64 - extra_serial_options: - - console=tty0 - - console=${SERIAL_CONSOLE},115200n8 - assume_installed: - - adduser - - apt - - apt-utils - - debconf-i18n - - debian-archive-keyring - - gcc-4.9 - - gnupg - - ifupdown - - initramfs-tools - - iproute2 - - irqbalance - - isc-dhcp-client - - kmod - - netbase - - udev - sources: - qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main - repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main - debian: http://ftp.debian.org/debian/ ${OS_FLAVOUR} main contrib non-free - backports: http://ftp.debian.org/debian/ ${OS_FLAVOUR}-backports main - packages: - - linux-image-armmp - - linux-headers-armmp - - wcnss-wlan - - wcnss-bt - - wcnss-start - EOF - - # Build information - cat > out/HEADER.textile << EOF - - h4. QCOM Landing Team - Snapdragon 600 - Debian - - Build description: - * Build URL: "$BUILD_URL":$BUILD_URL - * OS flavour: $OS_FLAVOUR - * Kernel tree: "$GIT_URL":$GIT_URL - * Kernel branch: $KERNEL_BRANCH - * Kernel version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT - * Kernel defconfig: $kernel_config - EOF - - # Download license file and firmware - rm -f license.txt - wget https://git.linaro.org/landing-teams/working/qualcomm/lt-docs.git/blob_plain/HEAD:/license/license.txt - - rm -rf qcom_firmware && mkdir qcom_firmware && cd qcom_firmware - wget -q ${QCOM_FIRMWARE} - echo "${QCOM_FIRMWARE_MD5} $(basename ${QCOM_FIRMWARE})" > MD5 - md5sum -c MD5 - unzip $(basename ${QCOM_FIRMWARE}) - cd - - rm -f qcom_firmware/SD_600eval-linux_proprietary_firmware-v1.0/license.txt - - for rootfs in ${ROOTFS}; do - - rootfs_arch=$(echo $rootfs | cut -f2 -d,) - rootfs_sz=$(echo $rootfs | cut -f3 -d,) - rootfs=$(echo $rootfs | cut -f1 -d,) - - cat ${VENDOR}-lt-qcom.default > ${VENDOR}-lt-qcom - - # additional packages in desktop images - [ "${rootfs}" = "alip" ] && cat << EOF >> ${VENDOR}-lt-qcom - - xserver-xorg-video-freedreno - - 96boards-artwork - EOF - - rm -f `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` - VERSION=`date +%Y%m%d`-${BUILD_NUMBER} - linaro-hwpack-create --debug --backports ${VENDOR}-lt-qcom ${VERSION} - linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-image-*-${VENDOR}-lt-qcom_*.deb` -r linux-image -d -i - linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-headers-*-${VENDOR}-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/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` - export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` - export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${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 ${VENDOR}-${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_${VENDOR}-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi - - # Create eMMC rootfs image(s) - mkdir rootfs - for device in $(sudo kpartx -avs out/${VENDOR}-${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 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 - sudo cp -f license.txt rootfs/etc/license.txt - - # add firmware (adreno, DSP and WCN) - sudo cp -a qcom_firmware/SD_600eval-linux_proprietary_firmware-v1.0/* rootfs/lib/firmware - - sudo mkfs.ext4 -L rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw ${rootfs_sz} - mkdir rootfs2 - sudo mount -o loop out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw rootfs2 - sudo cp -a rootfs/* rootfs2 - rootfs_sz_real=$(sudo du -sh rootfs2 | cut -f1) - sudo umount rootfs2 rootfs - sudo ext2simg -v out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img - sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img - sudo rm -rf rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img rootfs2 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw - - # Compress image(s) - gzip -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img - - cat >> out/HEADER.textile << EOF - * Linaro Debian ${rootfs}: "http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER}":http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER} , size: ${rootfs_sz_real} - EOF - done - - # Create boot image(s) - cat > out/bootimg.cfg << EOF - bootsize = 0xA00000 - pagesize = 0x800 - kerneladdr = 0x80208000 - ramdiskaddr = 0x83000000 - secondaddr = 0x81100000 - tagsaddr = 0x80200100 - name = ${VENDOR}-${PLATFORM_NAME} - cmdline = console=tty0 console=${SERIAL_CONSOLE},115200n8 root=/dev/disk/by-partlabel/userdata rootwait rw - EOF - - # Create one boot image for each platform supported, since we need to append DTB to zImage - for f in ${DTBS} ; do - mv out/dtbs/${f} out/ - target=`basename ${f} .dtb` - cat out/zImage out/${f} > zImage-dtb - abootimg --create out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img -f out/bootimg.cfg -k zImage-dtb -r out/initrd.img-* - gzip -9 out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img - done - rm -rf out/dtbs - - # Final preparation for publishing - cp -a linux-*.deb out/ - rm -f out/vmlinuz - - # 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/sd-600eval/${VENDOR}/debian/${BUILD_NUMBER} + - shell: + !include-raw: lt-qcom-debian-96boards-images/builders.sh publishers: - email: recipients: 'nicolas.dechesne@linaro.org fathi.boudra@linaro.org' diff --git a/lt-qcom-debian-96boards-images/builders.sh b/lt-qcom-debian-96boards-images/builders.sh new file mode 100644 index 0000000000..82b75f712f --- /dev/null +++ b/lt-qcom-debian-96boards-images/builders.sh @@ -0,0 +1,216 @@ +#!/bin/bash + +set -ex + +trap cleanup_exit INT TERM EXIT + +cleanup_exit() +{ + cd ${WORKSPACE} + sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-*.sd.img || true + sudo git clean -fdx +} + +sudo apt-get update +sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip android-tools-fsutils +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 + +export LANG=C +export make_bootwrapper=false +export make_install=true +export kernel_flavour=lt-qcom +export kernel_config="qcom_defconfig distro.config" +export MAKE_DTBS=true +export tcbindir="${HOME}/srv/toolchain/arm-tc-14.04/bin" +export toolchain_url=http://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_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 > ${VENDOR}-lt-qcom.default +format: '3.0' +name: ${VENDOR}-lt-qcom +architectures: +- armhf +origin: Linaro +maintainer: Linaro Platform <linaro-dev@lists.linaro.org> +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/vmlinuz-*-qcom +initrd_file: boot/initrd.img-*-qcom +dtb_file: lib/firmware/*-qcom/device-tree/qcom-apq8064-arrow-sd-600eval.dtb +dtb_files: +- qcom-apq8064-arrow-sd-600eval.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-arrow-sd-600eval.dtb +boot_script: boot.scr +boot_min_size: 64 +extra_serial_options: +- console=tty0 +- console=${SERIAL_CONSOLE},115200n8 +assume_installed: +- adduser +- apt +- apt-utils +- debconf-i18n +- debian-archive-keyring +- gcc-4.9 +- gnupg +- ifupdown +- initramfs-tools +- iproute2 +- irqbalance +- isc-dhcp-client +- kmod +- netbase +- udev +sources: + qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main + repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main + debian: http://ftp.debian.org/debian/ ${OS_FLAVOUR} main contrib non-free + backports: http://ftp.debian.org/debian/ ${OS_FLAVOUR}-backports main +packages: +- linux-image-armmp +- linux-headers-armmp +- wcnss-wlan +- wcnss-bt +- wcnss-start +EOF + +# Build information +cat > out/HEADER.textile << EOF + +h4. QCOM Landing Team - Snapdragon 600 - Debian + +Build description: +* Build URL: "$BUILD_URL":$BUILD_URL +* OS flavour: $OS_FLAVOUR +* Kernel tree: "$GIT_URL":$GIT_URL +* Kernel branch: $KERNEL_BRANCH +* Kernel version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT +* Kernel defconfig: $kernel_config +EOF + +# Download license file and firmware +rm -f license.txt +wget https://git.linaro.org/landing-teams/working/qualcomm/lt-docs.git/blob_plain/HEAD:/license/license.txt + +rm -rf qcom_firmware && mkdir qcom_firmware && cd qcom_firmware +wget -q ${QCOM_FIRMWARE} +echo "${QCOM_FIRMWARE_MD5} $(basename ${QCOM_FIRMWARE})" > MD5 +md5sum -c MD5 +unzip $(basename ${QCOM_FIRMWARE}) +cd - +rm -f qcom_firmware/SD_600eval-linux_proprietary_firmware-v1.0/license.txt + +for rootfs in ${ROOTFS}; do + + rootfs_arch=$(echo $rootfs | cut -f2 -d,) + rootfs_sz=$(echo $rootfs | cut -f3 -d,) + rootfs=$(echo $rootfs | cut -f1 -d,) + + cat ${VENDOR}-lt-qcom.default > ${VENDOR}-lt-qcom + + # additional packages in desktop images + [ "${rootfs}" = "alip" ] && cat << EOF >> ${VENDOR}-lt-qcom +- xserver-xorg-video-freedreno +- 96boards-artwork +EOF + + rm -f `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` + VERSION=`date +%Y%m%d`-${BUILD_NUMBER} + linaro-hwpack-create --debug --backports ${VENDOR}-lt-qcom ${VERSION} + linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-image-*-${VENDOR}-lt-qcom_*.deb` -r linux-image -d -i + linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-headers-*-${VENDOR}-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/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` + export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` + export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${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 ${VENDOR}-${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_${VENDOR}-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi + + # Create eMMC rootfs image(s) + mkdir rootfs + for device in $(sudo kpartx -avs out/${VENDOR}-${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 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 + sudo cp -f license.txt rootfs/etc/license.txt + + # add firmware (adreno, DSP and WCN) + sudo cp -a qcom_firmware/SD_600eval-linux_proprietary_firmware-v1.0/* rootfs/lib/firmware + + sudo mkfs.ext4 -L rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw ${rootfs_sz} + mkdir rootfs2 + sudo mount -o loop out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw rootfs2 + sudo cp -a rootfs/* rootfs2 + rootfs_sz_real=$(sudo du -sh rootfs2 | cut -f1) + sudo umount rootfs2 rootfs + sudo ext2simg -v out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img + sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img + sudo rm -rf rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img rootfs2 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw + + # Compress image(s) + gzip -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img + + cat >> out/HEADER.textile << EOF +* Linaro Debian ${rootfs}: "http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER}":http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER} , size: ${rootfs_sz_real} +EOF +done + +# Create boot image(s) +cat > out/bootimg.cfg << EOF +bootsize = 0xA00000 +pagesize = 0x800 +kerneladdr = 0x80208000 +ramdiskaddr = 0x83000000 +secondaddr = 0x81100000 +tagsaddr = 0x80200100 +name = ${VENDOR}-${PLATFORM_NAME} +cmdline = console=tty0 console=${SERIAL_CONSOLE},115200n8 root=/dev/disk/by-partlabel/userdata rootwait rw +EOF + +# Create one boot image for each platform supported, since we need to append DTB to zImage +for f in ${DTBS} ; do + mv out/dtbs/${f} out/ + target=`basename ${f} .dtb` + cat out/zImage out/${f} > zImage-dtb + abootimg --create out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img -f out/bootimg.cfg -k zImage-dtb -r out/initrd.img-* + gzip -9 out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img +done +rm -rf out/dtbs + +# Final preparation for publishing +cp -a linux-*.deb out/ +rm -f out/vmlinuz + +# 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/sd-600eval/${VENDOR}/debian/${BUILD_NUMBER} diff --git a/lt-qcom-debian-images-arm64.yaml b/lt-qcom-debian-images-arm64.yaml index a0ffaa319d..2917ef9f24 100644 --- a/lt-qcom-debian-images-arm64.yaml +++ b/lt-qcom-debian-images-arm64.yaml @@ -74,308 +74,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/${VENDOR}-${OS_FLAVOUR}-*.sd.img || true - rm -rf lci-build-tools - rm -rf builddir* - rm -rf out - git clean -fdx - } - - sudo apt-get update - sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip libfdt-dev mtools android-tools-fsutils - 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 - - # 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 > ${VENDOR}-lt-qcom.default - format: '3.0' - name: ${VENDOR}-lt-qcom - architectures: - - arm64 - origin: Linaro - maintainer: Linaro Platform <linaro-dev@lists.linaro.org> - 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: - - adduser - - apt - - apt-utils - - debconf-i18n - - debian-archive-keyring - - gcc-4.9 - - gnupg - - ifupdown - - initramfs-tools - - iproute2 - - irqbalance - - isc-dhcp-client - - kmod - - netbase - - udev - - linaro-artwork - sources: - qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main - repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main - debian: http://ftp.debian.org/debian/ ${OS_FLAVOUR} main contrib non-free - backports: http://ftp.debian.org/debian/ ${OS_FLAVOUR}-backports main - packages: - - linux-image-arm64 - - linux-headers-arm64 - - firmware-linux - - wcnss-wlan - - wcnss-bt - - wcnss-start - EOF - - # Build information - cat > out/HEADER.textile << EOF - - h4. QCOM Landing Team - Snapdragon 410 - Debian - - Build description: - * Build URL: "$BUILD_URL":$BUILD_URL - * OS flavour: $OS_FLAVOUR - * Kernel tree: "$GIT_URL":$GIT_URL - * Kernel branch: $KERNEL_BRANCH - * Kernel version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT - * Kernel defconfig: $kernel_config - EOF - - # Download license file and firmware - rm -f license.txt - wget https://git.linaro.org/landing-teams/working/qualcomm/lt-docs.git/blob_plain/HEAD:/license/license.txt - - rm -rf qcom_firmware && mkdir qcom_firmware && cd qcom_firmware - wget -q ${QCOM_FIRMWARE} - echo "${QCOM_FIRMWARE_MD5} $(basename ${QCOM_FIRMWARE})" > MD5 - md5sum -c MD5 - unzip $(basename ${QCOM_FIRMWARE}) - cd - - rm -f qcom_firmware/linux-board-support-package-*/proprietary-linux/wlan/macaddr0 - rm -f qcom_firmware/linux-board-support-package-*/proprietary-linux/firmware.tar - sudo MTOOLS_SKIP_CHECK=1 mcopy -i qcom_firmware/linux-board-support-package-*/bootloaders-linux/NON-HLOS.bin \ - ::image/modem.* ::image/mba.mbn qcom_firmware/linux-board-support-package-*/proprietary-linux - - for rootfs in ${ROOTFS}; do - - rootfs_arch=$(echo $rootfs | cut -f2 -d,) - rootfs_sz=$(echo $rootfs | cut -f3 -d,) - rootfs=$(echo $rootfs | cut -f1 -d,) - - cat ${VENDOR}-lt-qcom.default > ${VENDOR}-lt-qcom - - # additional packages in desktop images - [ "${rootfs}" = "alip" ] && cat << EOF >> ${VENDOR}-lt-qcom - - xserver-xorg-video-freedreno - - gstreamer1.0-plugins-v4l2 - - 96boards-artwork - EOF - - rm -f `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` - VERSION=`date +%Y%m%d`-${BUILD_NUMBER} - linaro-hwpack-create --debug --backports ${VENDOR}-lt-qcom ${VERSION} - linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-image-*-${VENDOR}-lt-qcom_*.deb` -r linux-image -d -i - linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-headers-*-${VENDOR}-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/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` - export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` - export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${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 ${VENDOR}-${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_${VENDOR}-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi - - # Create eMMC rootfs image(s) - mkdir rootfs - for device in $(sudo kpartx -avs out/${VENDOR}-${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 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 - sudo cp -f license.txt rootfs/etc/license.txt - - # add firmware (adreno, venus and WCN) - sudo cp -a qcom_firmware/linux-board-support-package-*/proprietary-linux/* rootfs/lib/firmware - - sudo mkfs.ext4 -L rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw ${rootfs_sz} - mkdir rootfs2 - sudo mount -o loop out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw rootfs2 - sudo cp -a rootfs/* rootfs2 - rootfs_sz_real=$(sudo du -sh rootfs2 | cut -f1) - sudo umount rootfs2 rootfs - sudo ext2simg -v out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img - sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img - sudo rm -rf rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img rootfs2 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw - - # Compress image(s) - gzip -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img - - cat >> out/HEADER.textile << EOF - * Linaro Debian ${rootfs}: "http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER}":http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER} , size: ${rootfs_sz_real} - 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-${VENDOR}-${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-${VENDOR}-${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 -p ~/.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/* || true - - 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-${VENDOR}-${OS_FLAVOUR}-${PLATFORM_NAME}-${VERSION}.img.gz boot.img.gz - cp ../../out/${VENDOR}-${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 Debian (${OS_FLAVOUR}) 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_debian - - # 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_debian - - # create archive for publishing - zip -rj ../out/dragonboard410c_sdcard_install_debian-${BUILD_NUMBER}.zip out/dragonboard410c_sdcard_install_debian - 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/${VENDOR}/debian/${BUILD_NUMBER} + - shell: + !include-raw: lt-qcom-debian-images-arm64/builders.sh - shell: | VERSION=`date +%Y%m%d`-${BUILD_NUMBER} diff --git a/lt-qcom-debian-images-arm64/builders.sh b/lt-qcom-debian-images-arm64/builders.sh new file mode 100644 index 0000000000..16e63aaaee --- /dev/null +++ b/lt-qcom-debian-images-arm64/builders.sh @@ -0,0 +1,301 @@ +#!/bin/bash + +set -ex + +trap cleanup_exit INT TERM EXIT + +cleanup_exit() +{ + cd ${WORKSPACE} + sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-*.sd.img || true + rm -rf lci-build-tools + rm -rf builddir* + rm -rf out + git clean -fdx +} + +sudo apt-get update +sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip libfdt-dev mtools android-tools-fsutils +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 + +# 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 > ${VENDOR}-lt-qcom.default +format: '3.0' +name: ${VENDOR}-lt-qcom +architectures: +- arm64 +origin: Linaro +maintainer: Linaro Platform <linaro-dev@lists.linaro.org> +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: +- adduser +- apt +- apt-utils +- debconf-i18n +- debian-archive-keyring +- gcc-4.9 +- gnupg +- ifupdown +- initramfs-tools +- iproute2 +- irqbalance +- isc-dhcp-client +- kmod +- netbase +- udev +- linaro-artwork +sources: + qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main + repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main + debian: http://ftp.debian.org/debian/ ${OS_FLAVOUR} main contrib non-free + backports: http://ftp.debian.org/debian/ ${OS_FLAVOUR}-backports main +packages: +- linux-image-arm64 +- linux-headers-arm64 +- firmware-linux +- wcnss-wlan +- wcnss-bt +- wcnss-start +EOF + +# Build information +cat > out/HEADER.textile << EOF + +h4. QCOM Landing Team - Snapdragon 410 - Debian + +Build description: +* Build URL: "$BUILD_URL":$BUILD_URL +* OS flavour: $OS_FLAVOUR +* Kernel tree: "$GIT_URL":$GIT_URL +* Kernel branch: $KERNEL_BRANCH +* Kernel version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT +* Kernel defconfig: $kernel_config +EOF + +# Download license file and firmware +rm -f license.txt +wget https://git.linaro.org/landing-teams/working/qualcomm/lt-docs.git/blob_plain/HEAD:/license/license.txt + +rm -rf qcom_firmware && mkdir qcom_firmware && cd qcom_firmware +wget -q ${QCOM_FIRMWARE} +echo "${QCOM_FIRMWARE_MD5} $(basename ${QCOM_FIRMWARE})" > MD5 +md5sum -c MD5 +unzip $(basename ${QCOM_FIRMWARE}) +cd - +rm -f qcom_firmware/linux-board-support-package-*/proprietary-linux/wlan/macaddr0 +rm -f qcom_firmware/linux-board-support-package-*/proprietary-linux/firmware.tar +sudo MTOOLS_SKIP_CHECK=1 mcopy -i qcom_firmware/linux-board-support-package-*/bootloaders-linux/NON-HLOS.bin \ + ::image/modem.* ::image/mba.mbn qcom_firmware/linux-board-support-package-*/proprietary-linux + +for rootfs in ${ROOTFS}; do + + rootfs_arch=$(echo $rootfs | cut -f2 -d,) + rootfs_sz=$(echo $rootfs | cut -f3 -d,) + rootfs=$(echo $rootfs | cut -f1 -d,) + + cat ${VENDOR}-lt-qcom.default > ${VENDOR}-lt-qcom + + # additional packages in desktop images + [ "${rootfs}" = "alip" ] && cat << EOF >> ${VENDOR}-lt-qcom +- xserver-xorg-video-freedreno +- gstreamer1.0-plugins-v4l2 +- 96boards-artwork +EOF + + rm -f `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` + VERSION=`date +%Y%m%d`-${BUILD_NUMBER} + linaro-hwpack-create --debug --backports ${VENDOR}-lt-qcom ${VERSION} + linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-image-*-${VENDOR}-lt-qcom_*.deb` -r linux-image -d -i + linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-headers-*-${VENDOR}-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/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` + export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` + export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${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 ${VENDOR}-${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_${VENDOR}-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi + + # Create eMMC rootfs image(s) + mkdir rootfs + for device in $(sudo kpartx -avs out/${VENDOR}-${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 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 + sudo cp -f license.txt rootfs/etc/license.txt + + # add firmware (adreno, venus and WCN) + sudo cp -a qcom_firmware/linux-board-support-package-*/proprietary-linux/* rootfs/lib/firmware + + sudo mkfs.ext4 -L rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw ${rootfs_sz} + mkdir rootfs2 + sudo mount -o loop out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw rootfs2 + sudo cp -a rootfs/* rootfs2 + rootfs_sz_real=$(sudo du -sh rootfs2 | cut -f1) + sudo umount rootfs2 rootfs + sudo ext2simg -v out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img + sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img + sudo rm -rf rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img rootfs2 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw + + # Compress image(s) + gzip -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img + + cat >> out/HEADER.textile << EOF +* Linaro Debian ${rootfs}: "http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER}":http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER} , size: ${rootfs_sz_real} +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-${VENDOR}-${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-${VENDOR}-${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 -p ~/.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/* || true + +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-${VENDOR}-${OS_FLAVOUR}-${PLATFORM_NAME}-${VERSION}.img.gz boot.img.gz +cp ../../out/${VENDOR}-${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 Debian (${OS_FLAVOUR}) 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_debian + +# 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_debian + +# create archive for publishing +zip -rj ../out/dragonboard410c_sdcard_install_debian-${BUILD_NUMBER}.zip out/dragonboard410c_sdcard_install_debian +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/${VENDOR}/debian/${BUILD_NUMBER} diff --git a/lt-qcom-debian-images-tracking-arm64.yaml b/lt-qcom-debian-images-tracking-arm64.yaml index e817a393d8..3757539b23 100644 --- a/lt-qcom-debian-images-tracking-arm64.yaml +++ b/lt-qcom-debian-images-tracking-arm64.yaml @@ -70,233 +70,8 @@ name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}' builders: - linaro-publish-token - - shell: | - #!/bin/bash - - set -ex - - trap cleanup_exit INT TERM EXIT - - cleanup_exit() - { - cd ${WORKSPACE} - sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-*.sd.img || true - rm -rf lci-build-tools - rm -rf builddir* - rm -rf out - git clean -fdx - } - - sudo apt-get update - sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip libfdt-dev mtools android-tools-fsutils - 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 - - # 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 > ${VENDOR}-lt-qcom.default - format: '3.0' - name: ${VENDOR}-lt-qcom - architectures: - - arm64 - origin: Linaro - maintainer: Linaro Platform <linaro-dev@lists.linaro.org> - 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: - - adduser - - apt - - apt-utils - - debconf-i18n - - debian-archive-keyring - - gcc-4.9 - - gnupg - - ifupdown - - initramfs-tools - - iproute2 - - irqbalance - - isc-dhcp-client - - kmod - - netbase - - udev - - linaro-artwork - sources: - qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main - repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main - debian: http://ftp.debian.org/debian/ ${OS_FLAVOUR} main contrib non-free - backports: http://ftp.debian.org/debian/ ${OS_FLAVOUR}-backports main - packages: - - linux-image-arm64 - - linux-headers-arm64 - - firmware-linux - - wcnss-wlan - - wcnss-bt - - wcnss-start - EOF - - # Build information - cat > out/HEADER.textile << EOF - - h4. QCOM Landing Team - Snapdragon 410 - Debian - - Build description: - * Build URL: "$BUILD_URL":$BUILD_URL - * OS flavour: $OS_FLAVOUR - * Kernel tree: "$GIT_URL":$GIT_URL - * Kernel branch: $KERNEL_BRANCH - * Kernel version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT - * Kernel defconfig: $kernel_config - EOF - - # Download license file and firmware - rm -f license.txt - wget https://git.linaro.org/landing-teams/working/qualcomm/lt-docs.git/blob_plain/HEAD:/license/license.txt - - rm -rf qcom_firmware && mkdir qcom_firmware && cd qcom_firmware - wget -q ${QCOM_FIRMWARE} - echo "${QCOM_FIRMWARE_MD5} $(basename ${QCOM_FIRMWARE})" > MD5 - md5sum -c MD5 - unzip $(basename ${QCOM_FIRMWARE}) - cd - - rm -f qcom_firmware/linux-board-support-package-*/proprietary-linux/wlan/macaddr0 - rm -f qcom_firmware/linux-board-support-package-*/proprietary-linux/firmware.tar - sudo MTOOLS_SKIP_CHECK=1 mcopy -i qcom_firmware/linux-board-support-package-*/bootloaders-linux/NON-HLOS.bin \ - ::image/modem.* ::image/mba.mbn qcom_firmware/linux-board-support-package-*/proprietary-linux - - for rootfs in ${ROOTFS}; do - - rootfs_arch=$(echo $rootfs | cut -f2 -d,) - rootfs_sz=$(echo $rootfs | cut -f3 -d,) - rootfs=$(echo $rootfs | cut -f1 -d,) - - cat ${VENDOR}-lt-qcom.default > ${VENDOR}-lt-qcom - - # additional packages in desktop images - [ "${rootfs}" = "alip" ] && cat << EOF >> ${VENDOR}-lt-qcom - - xserver-xorg-video-freedreno - - gstreamer1.0-plugins-v4l2 - - 96boards-artwork - EOF - - rm -f `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` - VERSION=`date +%Y%m%d`-${BUILD_NUMBER} - linaro-hwpack-create --debug --backports ${VENDOR}-lt-qcom ${VERSION} - linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-image-*-${VENDOR}-lt-qcom_*.deb` -r linux-image -d -i - linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-headers-*-${VENDOR}-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/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` - export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` - export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${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 ${VENDOR}-${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_${VENDOR}-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi - - # Create eMMC rootfs image(s) - mkdir rootfs - for device in $(sudo kpartx -avs out/${VENDOR}-${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 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 - sudo cp -f license.txt rootfs/etc/license.txt - - # add firmware (adreno, venus and WCN) - sudo cp -a qcom_firmware/linux-board-support-package-*/proprietary-linux/* rootfs/lib/firmware - - sudo mkfs.ext4 -L rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw ${rootfs_sz} - mkdir rootfs2 - sudo mount -o loop out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw rootfs2 - sudo cp -a rootfs/* rootfs2 - rootfs_sz_real=$(sudo du -sh rootfs2 | cut -f1) - sudo umount rootfs2 rootfs - sudo ext2simg -v out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img - sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img - sudo rm -rf rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img rootfs2 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw - - # Compress image(s) - gzip -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img - - cat >> out/HEADER.textile << EOF - * Linaro Debian ${rootfs}: "http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER}":http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER} , size: ${rootfs_sz_real} - EOF - done - - # Move all relevant DTBs in out/ - for f in arch/arm64/boot/dts/qcom/*.dts ; do - mv out/dtbs/$(basename ${f} .dts).dtb 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-${VENDOR}-${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-${VENDOR}-${OS_FLAVOUR}-${PLATFORM_NAME}-${VERSION}.img - - # Final preparation for publishing - cp -a linux-*.deb out/ - - # 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 \ - --api_version 3 \ - --link-latest \ - out debian/pre-built/snapdragon-tracking-arm64/${BUILD_NUMBER} + - shell: + !include-raw: lt-qcom-debian-images-tracking-arm64/builders.sh - shell: | VERSION=`date +%Y%m%d`-${BUILD_NUMBER} diff --git a/lt-qcom-debian-images-tracking-arm64/builders.sh b/lt-qcom-debian-images-tracking-arm64/builders.sh new file mode 100644 index 0000000000..43ac37c12e --- /dev/null +++ b/lt-qcom-debian-images-tracking-arm64/builders.sh @@ -0,0 +1,226 @@ +#!/bin/bash + +set -ex + +trap cleanup_exit INT TERM EXIT + +cleanup_exit() +{ + cd ${WORKSPACE} + sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-*.sd.img || true + rm -rf lci-build-tools + rm -rf builddir* + rm -rf out + git clean -fdx +} + +sudo apt-get update +sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip libfdt-dev mtools android-tools-fsutils +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 + +# 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 > ${VENDOR}-lt-qcom.default +format: '3.0' +name: ${VENDOR}-lt-qcom +architectures: +- arm64 +origin: Linaro +maintainer: Linaro Platform <linaro-dev@lists.linaro.org> +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: +- adduser +- apt +- apt-utils +- debconf-i18n +- debian-archive-keyring +- gcc-4.9 +- gnupg +- ifupdown +- initramfs-tools +- iproute2 +- irqbalance +- isc-dhcp-client +- kmod +- netbase +- udev +- linaro-artwork +sources: + qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main + repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main + debian: http://ftp.debian.org/debian/ ${OS_FLAVOUR} main contrib non-free + backports: http://ftp.debian.org/debian/ ${OS_FLAVOUR}-backports main +packages: +- linux-image-arm64 +- linux-headers-arm64 +- firmware-linux +- wcnss-wlan +- wcnss-bt +- wcnss-start +EOF + +# Build information +cat > out/HEADER.textile << EOF + +h4. QCOM Landing Team - Snapdragon 410 - Debian + +Build description: +* Build URL: "$BUILD_URL":$BUILD_URL +* OS flavour: $OS_FLAVOUR +* Kernel tree: "$GIT_URL":$GIT_URL +* Kernel branch: $KERNEL_BRANCH +* Kernel version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT +* Kernel defconfig: $kernel_config +EOF + +# Download license file and firmware +rm -f license.txt +wget https://git.linaro.org/landing-teams/working/qualcomm/lt-docs.git/blob_plain/HEAD:/license/license.txt + +rm -rf qcom_firmware && mkdir qcom_firmware && cd qcom_firmware +wget -q ${QCOM_FIRMWARE} +echo "${QCOM_FIRMWARE_MD5} $(basename ${QCOM_FIRMWARE})" > MD5 +md5sum -c MD5 +unzip $(basename ${QCOM_FIRMWARE}) +cd - +rm -f qcom_firmware/linux-board-support-package-*/proprietary-linux/wlan/macaddr0 +rm -f qcom_firmware/linux-board-support-package-*/proprietary-linux/firmware.tar +sudo MTOOLS_SKIP_CHECK=1 mcopy -i qcom_firmware/linux-board-support-package-*/bootloaders-linux/NON-HLOS.bin \ + ::image/modem.* ::image/mba.mbn qcom_firmware/linux-board-support-package-*/proprietary-linux + +for rootfs in ${ROOTFS}; do + + rootfs_arch=$(echo $rootfs | cut -f2 -d,) + rootfs_sz=$(echo $rootfs | cut -f3 -d,) + rootfs=$(echo $rootfs | cut -f1 -d,) + + cat ${VENDOR}-lt-qcom.default > ${VENDOR}-lt-qcom + + # additional packages in desktop images + [ "${rootfs}" = "alip" ] && cat << EOF >> ${VENDOR}-lt-qcom +- xserver-xorg-video-freedreno +- gstreamer1.0-plugins-v4l2 +- 96boards-artwork +EOF + + rm -f `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` + VERSION=`date +%Y%m%d`-${BUILD_NUMBER} + linaro-hwpack-create --debug --backports ${VENDOR}-lt-qcom ${VERSION} + linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-image-*-${VENDOR}-lt-qcom_*.deb` -r linux-image -d -i + linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-headers-*-${VENDOR}-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/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` + export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` + export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${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 ${VENDOR}-${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_${VENDOR}-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi + + # Create eMMC rootfs image(s) + mkdir rootfs + for device in $(sudo kpartx -avs out/${VENDOR}-${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 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 + sudo cp -f license.txt rootfs/etc/license.txt + + # add firmware (adreno, venus and WCN) + sudo cp -a qcom_firmware/linux-board-support-package-*/proprietary-linux/* rootfs/lib/firmware + + sudo mkfs.ext4 -L rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw ${rootfs_sz} + mkdir rootfs2 + sudo mount -o loop out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw rootfs2 + sudo cp -a rootfs/* rootfs2 + rootfs_sz_real=$(sudo du -sh rootfs2 | cut -f1) + sudo umount rootfs2 rootfs + sudo ext2simg -v out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img + sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img + sudo rm -rf rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img rootfs2 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw + + # Compress image(s) + gzip -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img + + cat >> out/HEADER.textile << EOF +* Linaro Debian ${rootfs}: "http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER}":http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER} , size: ${rootfs_sz_real} +EOF +done + +# Move all relevant DTBs in out/ +for f in arch/arm64/boot/dts/qcom/*.dts ; do + mv out/dtbs/$(basename ${f} .dts).dtb 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-${VENDOR}-${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-${VENDOR}-${OS_FLAVOUR}-${PLATFORM_NAME}-${VERSION}.img + +# Final preparation for publishing +cp -a linux-*.deb out/ + +# 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 \ + --api_version 3 \ + --link-latest \ + out debian/pre-built/snapdragon-tracking-arm64/${BUILD_NUMBER} diff --git a/lt-qcom-debian-images-tracking.yaml b/lt-qcom-debian-images-tracking.yaml index b0bead5df0..4dd8b94ff1 100644 --- a/lt-qcom-debian-images-tracking.yaml +++ b/lt-qcom-debian-images-tracking.yaml @@ -64,218 +64,8 @@ name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}' builders: - linaro-publish-token - - shell: | - #!/bin/bash - - set -ex - - trap cleanup_exit INT TERM EXIT - - cleanup_exit() - { - cd ${WORKSPACE} - sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-*.sd.img || true - rm -rf lci-build-tools - rm -rf builddir* - rm -rf out - rm -rf qcom-firmware - git clean -fdx - } - - sudo apt-get update - sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip android-tools-fsutils - 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 - - export LANG=C - export make_bootwrapper=false - export make_install=true - export kernel_flavour=lt-qcom - export kernel_config="qcom_defconfig distro.config" - export MAKE_DTBS=true - export tcbindir="${HOME}/srv/toolchain/arm-tc-14.04/bin" - export toolchain_url=http://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_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 > ${VENDOR}-lt-qcom.default - format: '3.0' - name: ${VENDOR}-lt-qcom - architectures: - - armhf - origin: Linaro - maintainer: Linaro Platform <linaro-dev@lists.linaro.org> - 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/vmlinuz-*-qcom - initrd_file: boot/initrd.img-*-qcom - dtb_file: lib/firmware/*-qcom/device-tree/qcom-apq8064-ifc6410.dtb - dtb_files: - - qcom-apq8064-ifc6410.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-ifc6410.dtb - - qcom-apq8064-cm-qs600.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-cm-qs600.dtb - - qcom-apq8064-eI_ERAGON600.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-eI_ERAGON600.dtb - boot_script: boot.scr - boot_min_size: 64 - extra_serial_options: - - console=tty0 - - console=${SERIAL_CONSOLE},115200n8 - assume_installed: - - adduser - - apt - - apt-utils - - debconf-i18n - - debian-archive-keyring - - gcc-4.9 - - gnupg - - ifupdown - - initramfs-tools - - iproute2 - - irqbalance - - isc-dhcp-client - - kmod - - netbase - - udev - sources: - qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main - repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main - debian: http://ftp.debian.org/debian/ ${OS_FLAVOUR} main contrib non-free - backports: http://ftp.debian.org/debian/ ${OS_FLAVOUR}-backports main - packages: - - linux-image-armmp - - linux-headers-armmp - EOF - - # Build information - cat > out/HEADER.textile << EOF - - h4. QCOM Landing Team - Snapdragon 600 - Debian - - Build description: - * Build URL: "$BUILD_URL":$BUILD_URL - * OS flavour: $OS_FLAVOUR - * Kernel tree: "$GIT_URL":$GIT_URL - * Kernel branch: $KERNEL_BRANCH - * Kernel version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT - * Kernel defconfig: $kernel_config - EOF - - for rootfs in ${ROOTFS}; do - - rootfs_arch=$(echo $rootfs | cut -f2 -d,) - rootfs_sz=$(echo $rootfs | cut -f3 -d,) - rootfs=$(echo $rootfs | cut -f1 -d,) - - cat ${VENDOR}-lt-qcom.default > ${VENDOR}-lt-qcom - - # additional packages in desktop images - [ "${rootfs}" != "developer" ] && cat << EOF >> ${VENDOR}-lt-qcom - - xserver-xorg-video-freedreno - EOF - - rm -f `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` - VERSION=`date +%Y%m%d`-${BUILD_NUMBER} - linaro-hwpack-create --debug --backports ${VENDOR}-lt-qcom ${VERSION} - linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-image-*-${VENDOR}-lt-qcom_*.deb` -r linux-image -d -i - linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-headers-*-${VENDOR}-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/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` - export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` - export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${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 ${VENDOR}-${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_${VENDOR}-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi - - # Create eMMC rootfs image(s) - mkdir rootfs - for device in $(sudo kpartx -avs out/${VENDOR}-${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 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 - - cat << EOF | sudo tee -a rootfs/etc/fstab - LABEL=qcom-firmware /lib/firmware ext4 defaults 0 0 - EOF - - sudo mkfs.ext4 -L rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw ${rootfs_sz} - mkdir rootfs2 - sudo mount -o loop out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw rootfs2 - sudo cp -a rootfs/* rootfs2 - rootfs_sz_real=$(sudo du -sh rootfs2 | cut -f1) - sudo umount rootfs2 rootfs - sudo ext2simg -v out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img - sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img - sudo rm -rf rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img rootfs2 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw - - # Compress image(s) - gzip -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img - - cat >> out/HEADER.textile << EOF - * Linaro Debian ${rootfs}: "http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER}":http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER} , size: ${rootfs_sz_real} - EOF - done - - # Create boot image(s) - cat > out/bootimg.cfg << EOF - bootsize = 0xA00000 - pagesize = 0x800 - kerneladdr = 0x80208000 - ramdiskaddr = 0x83000000 - secondaddr = 0x81100000 - tagsaddr = 0x80200100 - name = ${VENDOR}-${PLATFORM_NAME} - cmdline = console=tty0 console=${SERIAL_CONSOLE},115200n8 root=/dev/disk/by-partlabel/userdata rootwait rw systemd.unit=multi-user.target - EOF - - # Create one boot image for each platform supported, since we need to append DTB to zImage - for f in ${DTBS} ; do - mv out/dtbs/${f} out/ - target=`basename ${f} .dtb` - cat out/zImage out/${f} > zImage-dtb - abootimg --create out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img -f out/bootimg.cfg -k zImage-dtb -r out/initrd.img-* - gzip -9 out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img - done - rm -rf out/dtbs - - # Create an empty partition, placeholder for proprietary firmware - # do no create sparse file, so that the file can be easily loop mounted - mkdir qcom-firmware - sudo make_ext4fs -L qcom-firmware -l 64M out/firmware-${PLATFORM_NAME}-${VERSION}.img qcom-firmware/ - rm -rf qcom-firmware - gzip -9 out/firmware-${PLATFORM_NAME}-${VERSION}.img - - # Final preparation for publishing - cp -a linux-*.deb out/ - rm -f out/vmlinuz - - # 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 \ - --api_version 3 \ - --link-latest \ - out debian/pre-built/snapdragon-tracking/${BUILD_NUMBER} + - shell: + !include-raw: lt-qcom-debian-images-tracking/builders.sh - shell: | VERSION=`date +%Y%m%d`-${BUILD_NUMBER} diff --git a/lt-qcom-debian-images-tracking/builders.sh b/lt-qcom-debian-images-tracking/builders.sh new file mode 100644 index 0000000000..1a564208f3 --- /dev/null +++ b/lt-qcom-debian-images-tracking/builders.sh @@ -0,0 +1,211 @@ +#!/bin/bash + +set -ex + +trap cleanup_exit INT TERM EXIT + +cleanup_exit() +{ + cd ${WORKSPACE} + sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-*.sd.img || true + rm -rf lci-build-tools + rm -rf builddir* + rm -rf out + rm -rf qcom-firmware + git clean -fdx +} + +sudo apt-get update +sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip android-tools-fsutils +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 + +export LANG=C +export make_bootwrapper=false +export make_install=true +export kernel_flavour=lt-qcom +export kernel_config="qcom_defconfig distro.config" +export MAKE_DTBS=true +export tcbindir="${HOME}/srv/toolchain/arm-tc-14.04/bin" +export toolchain_url=http://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_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 > ${VENDOR}-lt-qcom.default +format: '3.0' +name: ${VENDOR}-lt-qcom +architectures: +- armhf +origin: Linaro +maintainer: Linaro Platform <linaro-dev@lists.linaro.org> +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/vmlinuz-*-qcom +initrd_file: boot/initrd.img-*-qcom +dtb_file: lib/firmware/*-qcom/device-tree/qcom-apq8064-ifc6410.dtb +dtb_files: +- qcom-apq8064-ifc6410.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-ifc6410.dtb +- qcom-apq8064-cm-qs600.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-cm-qs600.dtb +- qcom-apq8064-eI_ERAGON600.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-eI_ERAGON600.dtb +boot_script: boot.scr +boot_min_size: 64 +extra_serial_options: +- console=tty0 +- console=${SERIAL_CONSOLE},115200n8 +assume_installed: +- adduser +- apt +- apt-utils +- debconf-i18n +- debian-archive-keyring +- gcc-4.9 +- gnupg +- ifupdown +- initramfs-tools +- iproute2 +- irqbalance +- isc-dhcp-client +- kmod +- netbase +- udev +sources: + qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main + repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main + debian: http://ftp.debian.org/debian/ ${OS_FLAVOUR} main contrib non-free + backports: http://ftp.debian.org/debian/ ${OS_FLAVOUR}-backports main +packages: +- linux-image-armmp +- linux-headers-armmp +EOF + +# Build information +cat > out/HEADER.textile << EOF + +h4. QCOM Landing Team - Snapdragon 600 - Debian + +Build description: +* Build URL: "$BUILD_URL":$BUILD_URL +* OS flavour: $OS_FLAVOUR +* Kernel tree: "$GIT_URL":$GIT_URL +* Kernel branch: $KERNEL_BRANCH +* Kernel version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT +* Kernel defconfig: $kernel_config +EOF + +for rootfs in ${ROOTFS}; do + + rootfs_arch=$(echo $rootfs | cut -f2 -d,) + rootfs_sz=$(echo $rootfs | cut -f3 -d,) + rootfs=$(echo $rootfs | cut -f1 -d,) + + cat ${VENDOR}-lt-qcom.default > ${VENDOR}-lt-qcom + + # additional packages in desktop images + [ "${rootfs}" != "developer" ] && cat << EOF >> ${VENDOR}-lt-qcom +- xserver-xorg-video-freedreno +EOF + + rm -f `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` + VERSION=`date +%Y%m%d`-${BUILD_NUMBER} + linaro-hwpack-create --debug --backports ${VENDOR}-lt-qcom ${VERSION} + linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-image-*-${VENDOR}-lt-qcom_*.deb` -r linux-image -d -i + linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-headers-*-${VENDOR}-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/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` + export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` + export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${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 ${VENDOR}-${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_${VENDOR}-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi + + # Create eMMC rootfs image(s) + mkdir rootfs + for device in $(sudo kpartx -avs out/${VENDOR}-${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 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 + + cat << EOF | sudo tee -a rootfs/etc/fstab +LABEL=qcom-firmware /lib/firmware ext4 defaults 0 0 +EOF + + sudo mkfs.ext4 -L rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw ${rootfs_sz} + mkdir rootfs2 + sudo mount -o loop out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw rootfs2 + sudo cp -a rootfs/* rootfs2 + rootfs_sz_real=$(sudo du -sh rootfs2 | cut -f1) + sudo umount rootfs2 rootfs + sudo ext2simg -v out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img + sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img + sudo rm -rf rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img rootfs2 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw + + # Compress image(s) + gzip -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img + + cat >> out/HEADER.textile << EOF +* Linaro Debian ${rootfs}: "http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER}":http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER} , size: ${rootfs_sz_real} +EOF +done + +# Create boot image(s) +cat > out/bootimg.cfg << EOF +bootsize = 0xA00000 +pagesize = 0x800 +kerneladdr = 0x80208000 +ramdiskaddr = 0x83000000 +secondaddr = 0x81100000 +tagsaddr = 0x80200100 +name = ${VENDOR}-${PLATFORM_NAME} +cmdline = console=tty0 console=${SERIAL_CONSOLE},115200n8 root=/dev/disk/by-partlabel/userdata rootwait rw systemd.unit=multi-user.target +EOF + +# Create one boot image for each platform supported, since we need to append DTB to zImage +for f in ${DTBS} ; do + mv out/dtbs/${f} out/ + target=`basename ${f} .dtb` + cat out/zImage out/${f} > zImage-dtb + abootimg --create out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img -f out/bootimg.cfg -k zImage-dtb -r out/initrd.img-* + gzip -9 out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img +done +rm -rf out/dtbs + +# Create an empty partition, placeholder for proprietary firmware +# do no create sparse file, so that the file can be easily loop mounted +mkdir qcom-firmware +sudo make_ext4fs -L qcom-firmware -l 64M out/firmware-${PLATFORM_NAME}-${VERSION}.img qcom-firmware/ +rm -rf qcom-firmware +gzip -9 out/firmware-${PLATFORM_NAME}-${VERSION}.img + +# Final preparation for publishing +cp -a linux-*.deb out/ +rm -f out/vmlinuz + +# 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 \ + --api_version 3 \ + --link-latest \ + out debian/pre-built/snapdragon-tracking/${BUILD_NUMBER} diff --git a/lt-qcom-debian-images.yaml b/lt-qcom-debian-images.yaml index 0bd918fbc2..5ca18f3f67 100644 --- a/lt-qcom-debian-images.yaml +++ b/lt-qcom-debian-images.yaml @@ -64,218 +64,8 @@ name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}' builders: - linaro-publish-token - - shell: | - #!/bin/bash - - set -ex - - trap cleanup_exit INT TERM EXIT - - cleanup_exit() - { - cd ${WORKSPACE} - sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-*.sd.img || true - rm -rf lci-build-tools - rm -rf builddir* - rm -rf out - rm -rf qcom-firmware - git clean -fdx - } - - sudo apt-get update - sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip android-tools-fsutils - 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 - - export LANG=C - export make_bootwrapper=false - export make_install=true - export kernel_flavour=lt-qcom - export kernel_config="qcom_defconfig distro.config" - export MAKE_DTBS=true - export tcbindir="${HOME}/srv/toolchain/arm-tc-14.04/bin" - export toolchain_url=http://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_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 > ${VENDOR}-lt-qcom.default - format: '3.0' - name: ${VENDOR}-lt-qcom - architectures: - - armhf - origin: Linaro - maintainer: Linaro Platform <linaro-dev@lists.linaro.org> - 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/vmlinuz-*-qcom - initrd_file: boot/initrd.img-*-qcom - dtb_file: lib/firmware/*-qcom/device-tree/qcom-apq8064-ifc6410.dtb - dtb_files: - - qcom-apq8064-ifc6410.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-ifc6410.dtb - - qcom-apq8064-cm-qs600.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-cm-qs600.dtb - - qcom-apq8064-eI_ERAGON600.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-eI_ERAGON600.dtb - boot_script: boot.scr - boot_min_size: 64 - extra_serial_options: - - console=tty0 - - console=${SERIAL_CONSOLE},115200n8 - assume_installed: - - adduser - - apt - - apt-utils - - debconf-i18n - - debian-archive-keyring - - gcc-4.9 - - gnupg - - ifupdown - - initramfs-tools - - iproute2 - - irqbalance - - isc-dhcp-client - - kmod - - netbase - - udev - sources: - qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main - repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main - debian: http://ftp.debian.org/debian/ ${OS_FLAVOUR} main contrib non-free - backports: http://ftp.debian.org/debian/ ${OS_FLAVOUR}-backports main - packages: - - linux-image-armmp - - linux-headers-armmp - EOF - - # Build information - cat > out/HEADER.textile << EOF - - h4. QCOM Landing Team - Snapdragon 600 - Debian - - Build description: - * Build URL: "$BUILD_URL":$BUILD_URL - * OS flavour: $OS_FLAVOUR - * Kernel tree: "$GIT_URL":$GIT_URL - * Kernel branch: $KERNEL_BRANCH - * Kernel version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT - * Kernel defconfig: $kernel_config - EOF - - for rootfs in ${ROOTFS}; do - - rootfs_arch=$(echo $rootfs | cut -f2 -d,) - rootfs_sz=$(echo $rootfs | cut -f3 -d,) - rootfs=$(echo $rootfs | cut -f1 -d,) - - cat ${VENDOR}-lt-qcom.default > ${VENDOR}-lt-qcom - - # additional packages in desktop images - [ "${rootfs}" != "developer" ] && cat << EOF >> ${VENDOR}-lt-qcom - - xserver-xorg-video-freedreno - EOF - - rm -f `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` - VERSION=`date +%Y%m%d`-${BUILD_NUMBER} - linaro-hwpack-create --debug --backports ${VENDOR}-lt-qcom ${VERSION} - linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-image-*-${VENDOR}-lt-qcom_*.deb` -r linux-image -d -i - linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-headers-*-${VENDOR}-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/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` - export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` - export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${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 ${VENDOR}-${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_${VENDOR}-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi - - # Create eMMC rootfs image(s) - mkdir rootfs - for device in $(sudo kpartx -avs out/${VENDOR}-${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 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 - - cat << EOF | sudo tee -a rootfs/etc/fstab - LABEL=qcom-firmware /lib/firmware ext4 defaults 0 0 - EOF - - sudo mkfs.ext4 -L rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw ${rootfs_sz} - mkdir rootfs2 - sudo mount -o loop out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw rootfs2 - sudo cp -a rootfs/* rootfs2 - rootfs_sz_real=$(sudo du -sh rootfs2 | cut -f1) - sudo umount rootfs2 rootfs - sudo ext2simg -v out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img - sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img - sudo rm -rf rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img rootfs2 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw - - # Compress image(s) - gzip -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img - - cat >> out/HEADER.textile << EOF - * Linaro Debian ${rootfs}: "http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER}":http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER} , size: ${rootfs_sz_real} - EOF - done - - # Create boot image(s) - cat > out/bootimg.cfg << EOF - bootsize = 0xA00000 - pagesize = 0x800 - kerneladdr = 0x80208000 - ramdiskaddr = 0x83000000 - secondaddr = 0x81100000 - tagsaddr = 0x80200100 - name = ${VENDOR}-${PLATFORM_NAME} - cmdline = console=tty0 console=${SERIAL_CONSOLE},115200n8 root=/dev/disk/by-partlabel/userdata rootwait rw systemd.unit=multi-user.target - EOF - - # Create one boot image for each platform supported, since we need to append DTB to zImage - for f in ${DTBS} ; do - mv out/dtbs/${f} out/ - target=`basename ${f} .dtb` - cat out/zImage out/${f} > zImage-dtb - abootimg --create out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img -f out/bootimg.cfg -k zImage-dtb -r out/initrd.img-* - gzip -9 out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img - done - rm -rf out/dtbs - - # Create an empty partition, placeholder for proprietary firmware - # do no create sparse file, so that the file can be easily loop mounted - mkdir qcom-firmware - sudo make_ext4fs -L qcom-firmware -l 64M out/firmware-${PLATFORM_NAME}-${VERSION}.img qcom-firmware/ - rm -rf qcom-firmware - gzip -9 out/firmware-${PLATFORM_NAME}-${VERSION}.img - - # Final preparation for publishing - cp -a linux-*.deb out/ - rm -f out/vmlinuz - - # 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 \ - --api_version 3 \ - --link-latest \ - out debian/pre-built/snapdragon/${BUILD_NUMBER} + - shell: + !include-raw: lt-qcom-debian-images/builders.sh - shell: | VERSION=`date +%Y%m%d`-${BUILD_NUMBER} diff --git a/lt-qcom-debian-images/builders.sh b/lt-qcom-debian-images/builders.sh new file mode 100644 index 0000000000..535a11d303 --- /dev/null +++ b/lt-qcom-debian-images/builders.sh @@ -0,0 +1,211 @@ +#!/bin/bash + +set -ex + +trap cleanup_exit INT TERM EXIT + +cleanup_exit() +{ + cd ${WORKSPACE} + sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-*.sd.img || true + rm -rf lci-build-tools + rm -rf builddir* + rm -rf out + rm -rf qcom-firmware + git clean -fdx +} + +sudo apt-get update +sudo apt-get install -y kpartx python-pycurl device-tree-compiler zip android-tools-fsutils +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 + +export LANG=C +export make_bootwrapper=false +export make_install=true +export kernel_flavour=lt-qcom +export kernel_config="qcom_defconfig distro.config" +export MAKE_DTBS=true +export tcbindir="${HOME}/srv/toolchain/arm-tc-14.04/bin" +export toolchain_url=http://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_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 > ${VENDOR}-lt-qcom.default +format: '3.0' +name: ${VENDOR}-lt-qcom +architectures: +- armhf +origin: Linaro +maintainer: Linaro Platform <linaro-dev@lists.linaro.org> +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/vmlinuz-*-qcom +initrd_file: boot/initrd.img-*-qcom +dtb_file: lib/firmware/*-qcom/device-tree/qcom-apq8064-ifc6410.dtb +dtb_files: +- qcom-apq8064-ifc6410.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-ifc6410.dtb +- qcom-apq8064-cm-qs600.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-cm-qs600.dtb +- qcom-apq8064-eI_ERAGON600.dtb: lib/firmware/*-qcom/device-tree/qcom-apq8064-eI_ERAGON600.dtb +boot_script: boot.scr +boot_min_size: 64 +extra_serial_options: +- console=tty0 +- console=${SERIAL_CONSOLE},115200n8 +assume_installed: +- adduser +- apt +- apt-utils +- debconf-i18n +- debian-archive-keyring +- gcc-4.9 +- gnupg +- ifupdown +- initramfs-tools +- iproute2 +- irqbalance +- isc-dhcp-client +- kmod +- netbase +- udev +sources: + qcom: http://repo.linaro.org/ubuntu/qcom-overlay ${OS_FLAVOUR} main + repo: http://repo.linaro.org/ubuntu/linaro-overlay ${OS_FLAVOUR} main + debian: http://ftp.debian.org/debian/ ${OS_FLAVOUR} main contrib non-free + backports: http://ftp.debian.org/debian/ ${OS_FLAVOUR}-backports main +packages: +- linux-image-armmp +- linux-headers-armmp +EOF + +# Build information +cat > out/HEADER.textile << EOF + +h4. QCOM Landing Team - Snapdragon 600 - Debian + +Build description: +* Build URL: "$BUILD_URL":$BUILD_URL +* OS flavour: $OS_FLAVOUR +* Kernel tree: "$GIT_URL":$GIT_URL +* Kernel branch: $KERNEL_BRANCH +* Kernel version: "$GIT_COMMIT":$GIT_URL/commit/$GIT_COMMIT +* Kernel defconfig: $kernel_config +EOF + +for rootfs in ${ROOTFS}; do + + rootfs_arch=$(echo $rootfs | cut -f2 -d,) + rootfs_sz=$(echo $rootfs | cut -f3 -d,) + rootfs=$(echo $rootfs | cut -f1 -d,) + + cat ${VENDOR}-lt-qcom.default > ${VENDOR}-lt-qcom + + # additional packages in desktop images + [ "${rootfs}" != "developer" ] && cat << EOF >> ${VENDOR}-lt-qcom +- xserver-xorg-video-freedreno +EOF + + rm -f `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` + VERSION=`date +%Y%m%d`-${BUILD_NUMBER} + linaro-hwpack-create --debug --backports ${VENDOR}-lt-qcom ${VERSION} + linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-image-*-${VENDOR}-lt-qcom_*.deb` -r linux-image -d -i + linaro-hwpack-replace -t `ls hwpack_${VENDOR}-lt-qcom_*_${rootfs_arch}_supported.tar.gz` -p `ls linux-headers-*-${VENDOR}-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/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildNumber` + export ROOTFS_BUILD_TIMESTAMP=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/debian-${rootfs_arch}-rootfs/label=docker-jessie-${rootfs_arch},rootfs=${rootfs}/lastSuccessfulBuild/buildTimestamp?format=yyyyMMdd` + export ROOTFS_BUILD_URL="http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${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 ${VENDOR}-${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_${VENDOR}-lt-qcom_*.tar.gz --hwpack-force-yes --bootloader uefi + + # Create eMMC rootfs image(s) + mkdir rootfs + for device in $(sudo kpartx -avs out/${VENDOR}-${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 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 + + cat << EOF | sudo tee -a rootfs/etc/fstab +LABEL=qcom-firmware /lib/firmware ext4 defaults 0 0 +EOF + + sudo mkfs.ext4 -L rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw ${rootfs_sz} + mkdir rootfs2 + sudo mount -o loop out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw rootfs2 + sudo cp -a rootfs/* rootfs2 + rootfs_sz_real=$(sudo du -sh rootfs2 | cut -f1) + sudo umount rootfs2 rootfs + sudo ext2simg -v out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img + sudo kpartx -dv out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img + sudo rm -rf rootfs out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.sd.img rootfs2 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img.raw + + # Compress image(s) + gzip -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${VERSION}.img + + cat >> out/HEADER.textile << EOF +* Linaro Debian ${rootfs}: "http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER}":http://snapshots.linaro.org/debian/images/${rootfs}-${rootfs_arch}/${ROOTFS_BUILD_NUMBER} , size: ${rootfs_sz_real} +EOF +done + +# Create boot image(s) +cat > out/bootimg.cfg << EOF +bootsize = 0xA00000 +pagesize = 0x800 +kerneladdr = 0x80208000 +ramdiskaddr = 0x83000000 +secondaddr = 0x81100000 +tagsaddr = 0x80200100 +name = ${VENDOR}-${PLATFORM_NAME} +cmdline = console=tty0 console=${SERIAL_CONSOLE},115200n8 root=/dev/disk/by-partlabel/userdata rootwait rw systemd.unit=multi-user.target +EOF + +# Create one boot image for each platform supported, since we need to append DTB to zImage +for f in ${DTBS} ; do + mv out/dtbs/${f} out/ + target=`basename ${f} .dtb` + cat out/zImage out/${f} > zImage-dtb + abootimg --create out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img -f out/bootimg.cfg -k zImage-dtb -r out/initrd.img-* + gzip -9 out/boot-${target}-${PLATFORM_NAME}-${VERSION}.img +done +rm -rf out/dtbs + +# Create an empty partition, placeholder for proprietary firmware +# do no create sparse file, so that the file can be easily loop mounted +mkdir qcom-firmware +sudo make_ext4fs -L qcom-firmware -l 64M out/firmware-${PLATFORM_NAME}-${VERSION}.img qcom-firmware/ +rm -rf qcom-firmware +gzip -9 out/firmware-${PLATFORM_NAME}-${VERSION}.img + +# Final preparation for publishing +cp -a linux-*.deb out/ +rm -f out/vmlinuz + +# 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 \ + --api_version 3 \ + --link-latest \ + out debian/pre-built/snapdragon/${BUILD_NUMBER} |