1#!/bin/bash 2 3set -e 4set -x 5 6# Try to use the kernel and rootfs built in mainline first, so we're more 7# likely to hit cache 8if wget -q --method=HEAD "https://${BASE_SYSTEM_MAINLINE_HOST_PATH}/done"; then 9 BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_MAINLINE_HOST_PATH}" 10else 11 BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_FORK_HOST_PATH}" 12fi 13 14rm -rf results 15mkdir -p results/job-rootfs-overlay/ 16 17cp artifacts/ci-common/capture-devcoredump.sh results/job-rootfs-overlay/ 18cp artifacts/ci-common/init-*.sh results/job-rootfs-overlay/ 19cp artifacts/ci-common/intel-gpu-freq.sh results/job-rootfs-overlay/ 20 21# Prepare env vars for upload. 22KERNEL_IMAGE_BASE_URL="https://${BASE_SYSTEM_HOST_PATH}" \ 23 artifacts/ci-common/generate-env.sh > results/job-rootfs-overlay/set-job-env-vars.sh 24 25tar zcf job-rootfs-overlay.tar.gz -C results/job-rootfs-overlay/ . 26ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" job-rootfs-overlay.tar.gz "https://${JOB_ROOTFS_OVERLAY_PATH}" 27 28touch results/lava.log 29tail -f results/lava.log & 30PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \ 31 --dump-yaml \ 32 --pipeline-info "$CI_JOB_NAME: $CI_PIPELINE_URL on $CI_COMMIT_REF_NAME ${CI_NODE_INDEX}/${CI_NODE_TOTAL}" \ 33 --rootfs-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \ 34 --kernel-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \ 35 --build-url "${FDO_HTTP_CACHE_URI:-}https://${BUILD_PATH}" \ 36 --job-rootfs-overlay-url "${FDO_HTTP_CACHE_URI:-}https://${JOB_ROOTFS_OVERLAY_PATH}" \ 37 --job-timeout ${JOB_TIMEOUT:-30} \ 38 --first-stage-init artifacts/ci-common/init-stage1.sh \ 39 --ci-project-dir ${CI_PROJECT_DIR} \ 40 --device-type ${DEVICE_TYPE} \ 41 --dtb ${DTB} \ 42 --jwt-file "${CI_JOB_JWT_FILE}" \ 43 --kernel-image-name ${KERNEL_IMAGE_NAME} \ 44 --kernel-image-type "${KERNEL_IMAGE_TYPE}" \ 45 --boot-method ${BOOT_METHOD} \ 46 --visibility-group ${VISIBILITY_GROUP} \ 47 --lava-tags "${LAVA_TAGS}" \ 48 --mesa-job-name "$CI_JOB_NAME" \ 49 >> results/lava.log 50