aboutsummaryrefslogtreecommitdiff
path: root/lt-qcom-debian-images/builders-fai.sh
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2023-09-20 01:42:06 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2023-09-20 01:42:57 +0300
commitecd9d1a4eeefdaa7b652675766e5f63d814729d7 (patch)
tree8e9f7ce7c05bbd9592d26b27da2b1adad6061700 /lt-qcom-debian-images/builders-fai.sh
parent031d76701228606d09da7ff42997258f76e6e258 (diff)
lt-qcom-debian-images: drop in favour of CLO
These jobs were replaced by CLO, drop them. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Change-Id: Ia9375208b48a8977729eac6657028e56ecb4707d
Diffstat (limited to 'lt-qcom-debian-images/builders-fai.sh')
-rw-r--r--lt-qcom-debian-images/builders-fai.sh219
1 files changed, 0 insertions, 219 deletions
diff --git a/lt-qcom-debian-images/builders-fai.sh b/lt-qcom-debian-images/builders-fai.sh
deleted file mode 100644
index e74ed5d381..0000000000
--- a/lt-qcom-debian-images/builders-fai.sh
+++ /dev/null
@@ -1,219 +0,0 @@
-#!/bin/bash
-
-set -ex
-
-trap cleanup_exit INT TERM EXIT
-
-cleanup_exit()
-{
- echo "INFO: umount ${WORKSPACE}/builddir"
- sudo umount ${WORKSPACE}/builddir
-}
-
-if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update; then
- echo "INFO: apt update error - try again in a moment"
- sleep 15
- sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update || true
-fi
-pkg_list="apt-transport-https"
-if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 install -y ${pkg_list}; then
- echo "INFO: apt install error - try again in a moment"
- sleep 15
- sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 install -y ${pkg_list}
-fi
-if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update; then
- echo "INFO: apt update error - try again in a moment"
- sleep 15
- sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update || true
-fi
-pkg_list="python3-pip python3-setuptools fai-server fai-setup-storage qemu-utils procps mtools pigz zip android-sdk-libsparse-utils mkbootimg libpython3-dev dosfstools"
-if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 install -y ${pkg_list}; then
- echo "INFO: apt install error - try again in a moment"
- sleep 15
- sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 install -y ${pkg_list}
-fi
-
-# install jflog client tool, v1, used for publishing artifacts
-(mkdir -p $HOME/bin && cd $HOME/bin && curl -fL https://getcli.jfrog.io | sh)
-
-set -ex
-
-# Needed to use git commit/push on CI
-git config --global user.name "Linaro CI"
-git config --global user.email "ci_notify@linaro.org"
-git config --global core.sshCommand "ssh -F ${HOME}/qcom.sshconfig"
-
-cat << EOF > ${HOME}/qcom.sshconfig
-Host git.codelinaro.org
- User qclt-bot
- UserKnownHostsFile /dev/null
- StrictHostKeyChecking no
-EOF
-chmod 0600 ${HOME}/qcom.sshconfig
-
-# Build information
-mkdir -p out
-cat > out/HEADER.textile << EOF
-
-h4. QCOM Landing Team - $BUILD_DISPLAY_NAME
-
-Build description:
-* Build URL: "$BUILD_URL":$BUILD_URL
-* OS flavour: $OS_FLAVOUR
-* FAI: "$GIT_URL":$GIT_URL
-* FAI commit: "$GIT_COMMIT":$GIT_URL/commit/?id=$GIT_COMMIT
-EOF
-
-# speed up FAI
-test -d builddir || mkdir builddir
-sudo mount -t tmpfs -o size=6G tmpfs builddir
-
-# dumb utility to parse dpkg -l output
-wget https://git.linaro.org/ci/job/configs.git/blob_plain/HEAD:/lt-qcom-debian-images/debpkgdiff.py
-
-# Record build log changes in git tree
-LT_CI_REPO_URL="git@git.codelinaro.org:linaro/qcomlt/lt-ci.git"
-git clone ${LT_CI_REPO_URL} -b debian/${PLATFORM_NAME}
-
-# comment obs.linaro.org repository
-if [ -f /etc/apt/sources.list.d/linaro-overlay-obs.list ]; then
- sudo sed -i 's/^deb/#deb/g' /etc/apt/sources.list.d/linaro-overlay-obs.list
-fi
-
-for rootfs in ${ROOTFS}; do
-
- rootfs_sz=$(echo $rootfs | cut -f2 -d,)
- rootfs=$(echo $rootfs | cut -f1 -d,)
-
- sudo fai-diskimage -v --cspace $(pwd) \
- --hostname linaro-${rootfs} \
- -S ${rootfs_sz} \
- --class $(echo SAVECACHE,${OS_FLAVOUR},DEBIAN,LINARO,QCOM,${rootfs},RAW | tr '[:lower:]' '[:upper:]') \
- builddir/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw
-
- sudo cp /var/log/fai/linaro-${rootfs}/last/fai.log fai-${rootfs}.log
- if grep -E '^(ERROR:|WARNING: These unknown packages are removed from the installation list|Exit code task_)' fai-${rootfs}.log
- then
- echo "Errors during build"
- rm -rf out/
- exit 1
- fi
-
- rootfs_sz_real=$(du -h builddir/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw | cut -f1)
-
- # make sure that there are the same for all images, in case we build more than 1 image
- if [ -f MD5SUM ]; then
- md5sum -c MD5SUM
- else
- md5sum out/{vmlinuz-*,config-*} $(find dtbs -name *.dtb) > MD5SUM
- fi
-
- img2simg builddir/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img
- sudo rm -f builddir/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw
-
- # Compress image(s)
- pigz -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img
-
- # dpkg -l output
- mv out/packages.txt out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.packages
-
- # record changes since last build, if available
- if wget -q ${PUBLISH_SERVER}$(dirname ${PUB_DEST})/latest/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-*.packages -O last-build.packages; then
- echo -e "=== Packages changes for ${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}\n" >> out/build-changes.txt
- python debpkgdiff.py last-build.packages out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.packages >> out/build-changes.txt
- echo >> out/build-changes.txt
- else
- echo "latest build published does not have packages list, skipping diff report"
- fi
-
- # record list of installed packages in git
- cp out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.packages lt-ci/${VENDOR}-${OS_FLAVOUR}-${rootfs}.packages
-
- cat >> out/HEADER.textile << EOF
-* Linaro Debian ${rootfs}: size: ${rootfs_sz_real}
-EOF
-done
-
-# Record info about kernel, there can be multiple .packages files, but we have already checked that kernel version is the same. so pick one.
-kernel_binpkg=$(grep -h linux-image out/${VENDOR}-${OS_FLAVOUR}-*-${PLATFORM_NAME}-${BUILD_NUMBER}.packages | sed 's/\s\s*/ /g' | cut -d ' ' -f2 | uniq)
-kernel_pkgver=$(grep -h linux-image out/${VENDOR}-${OS_FLAVOUR}-*-${PLATFORM_NAME}-${BUILD_NUMBER}.packages | sed 's/\s\s*/ /g' | cut -d ' ' -f3 | uniq)
-
-# record kernel config changes since last build, if available
-if wget -q ${PUBLISH_SERVER}$(dirname ${PUB_DEST})/latest/config-* -O last-build.config; then
- echo -e "=== Changes for kernel config\n" >> out/build-changes.txt
- diff -su last-build.config out/config-* >> out/build-changes.txt || true
- echo >> out/build-changes.txt
-else
- echo "latest build published does not have kernel config, skipping diff report"
-fi
-
-# record kernel config changes in git
-cp out/config-* lt-ci/config
-
-# the space after pre.. tag is on purpose
-if [ -f out/build-changes.txt ]; then
- cat > out/README.textile << EOF
-
-h4. Build changes
-
-pre..
-EOF
- cat out/build-changes.txt >> out/README.textile
-else
- cat > out/README.textile << EOF
-
-h4. No build changes
-EOF
-fi
-
-cat >> out/HEADER.textile << EOF
-* Kernel package name: ${kernel_binpkg}
-* Kernel package version: ${kernel_pkgver}
-EOF
-
-# Commit build changes in lt-ci
-cd lt-ci
-git add -A
-git commit --allow-empty -m "Import build ${BUILD_NUMBER}"
-git push origin debian/${PLATFORM_NAME}
-cd ..
-
-# Create boot image for each DTB
-# format is 'dtb_file,rootfs_label', if rootfs_label is missing, default to 'rootfs'
-BOOTIMG_PAGESIZE='4096'
-BOOTIMG_BASE='0x80000000'
-BOOTIMG_KERNEL_OFFSET='0x8000'
-BOOTIMG_RAMDISK_OFFSET='0x1000000'
-BOOTIMG_TAGS_OFFSET='0x100'
-for dtb in ${DTBS}; do
-
- dtb_file=$(echo ${dtb}, | cut -f1 -d,)
- rootfs_label=$(echo ${dtb}, | cut -f2 -d,)
- dtb_name=$(basename $(echo ${dtb_file} | tr '/' '_' ) .dtb)
-
- if [ "${rootfs_label}" == "" ]; then
- rootfs_label='rootfs'
- fi
-
- KERNEL_CMDLINE="root=PARTLABEL=${rootfs_label} console=tty0 console=${SERIAL_CONSOLE},115200n8 ${KERNEL_CMDLINE_PLATFORM}"
-
- BOOTIMG=boot-${VENDOR}-${OS_FLAVOUR}-${PLATFORM_NAME}-${dtb_name}-${BUILD_NUMBER}.img
-
- cp out/dtbs/${dtb_file} out/${dtb_name}.dtb
- cat out/vmlinuz-* out/${dtb_name}.dtb > Image.gz+dtb
- mkbootimg \
- --kernel Image.gz+dtb \
- --ramdisk out/initrd.img-* \
- --output out/${BOOTIMG} \
- --pagesize "${BOOTIMG_PAGESIZE}" \
- --base "${BOOTIMG_BASE}" \
- --kernel_offset "${BOOTIMG_KERNEL_OFFSET}" \
- --ramdisk_offset "${BOOTIMG_RAMDISK_OFFSET}" \
- --tags_offset "${BOOTIMG_TAGS_OFFSET}" \
- --cmdline "${KERNEL_CMDLINE}"
- pigz -9 out/${BOOTIMG}
-
-done
-
-# delete all unused DTB files
-sudo rm -rf out/dtbs/