image: gitlab.int.toradex.com:4567/rd/linux-bsp/ci-toolchain-container:linux-toradex_aarch32_arm_builder-bb6f84e variables: # uncomment for the pipeline debug purpose # CI_DEBUG_TRACE: "true" DOCKER_HOST: tcp://docker:2375 DOCKER_DRIVER: overlay2 DOCKER_TLS_CERTDIR: "" # Kernel Configuration Section # Supplementary Tool Section # Artifacts configuring section KERNEL_CONFIG_BUILD_LOG_FILE_NAME: build_config.log KERNEL_BUILD_LOG_FILE_NAME: build.log KERNEL_CONFIGURATION_FILE: .config # Defining temporary build folder to do outside of the box builds. Absolute path TEMP_BUILD_FOLDER: /builds/temp-builds stages: - check-patch - build-product .build_base: stage: build-product variables: GIT_STRATEGY: fetch # we are only using 3 latest commits to speed up the fetch process, as we are running pipeline each time we do a commit or a MR https://docs.gitlab.com/ee/ci/large_repositories/index.html#shallow-cloning GIT_DEPTH: "3" # To run just on merge request # only: # - merge_requests # when: manual script: | #set -o xtrace cd $CI_PROJECT_DIR echo -e "Compiler used to build binaries is" which ${CROSS_COMPILE}gcc ${CROSS_COMPILE}gcc --version echo -e "Arch is \e[36m$ARCH\e[39m" THREADS=$(grep processor /proc/cpuinfo -c) # due to specific of the kernel build we need to use the latest # configuration from the nightly builds. We are getting $Version # dynamically, as a variable, based on parsing URL page with # Nightly builds ID version=$( wget -q -O - http://artifactory-horw.int.toradex.com/artifactory/list/torizoncore-oe-prerelease-horw/dunfell-5.x.y/nightly/ | grep -E "^&1 | tee $KERNEL_BUILD_LOG_FILE_NAME artifacts: when: always name: "$CI_COMMIT_REF_NAME" paths: - $KERNEL_BUILD_LOG_FILE_NAME #As we do not generate config for 5.x and use generated one, we have just kernel config and kernel build log - kernel-config allow_failure: true after_script: - set -o xtrace - rm -rf $TEMP_BUILD_FOLDER check_patch: stage: check-patch script: .gitlab-ci.d/check-patch.py variables: GIT_STRATEGY: fetch GIT_DEPTH: 1000 allow_failure: true # If you need additional products build just copy-paste build_******_product section with new config name build_default_defconfig : stage: build-product variables: DEFCONFIG: "imx_v6_v7_defconfig" # Choose max kernel size that `ubinfo /dev/ubi0_0` reports MAX_KERNEL_SIZE_B: 12570624 GIT_STRATEGY: fetch GIT_DEPTH: "1" script: | #set -o xtrace cd $CI_PROJECT_DIR echo -e "Compiler used to build binaries is" which ${CROSS_COMPILE}gcc ${CROSS_COMPILE}gcc --version echo -e "Arch is \e[36m$ARCH\e[39m" THREADS=$(grep processor /proc/cpuinfo -c) make $DEFCONFIG make -j $THREADS 2>&1 | tee $KERNEL_BUILD_LOG_FILE_NAME KERNEL_SIZE=$(ls -la arch/arm/boot/zImage | awk '{print $5}') echo "Kernel size is ${KERNEL_SIZE} bytes" if [ $KERNEL_SIZE -ge $MAX_KERNEL_SIZE_B ]; then echo "❌ Kernel exceeds the max size of ${MAX_KERNEL_SIZE_B}, failing CI pipeline"; exit 1 fi allow_failure: true build_bsp_defconfig: stage: build-product variables: DEFCONFIG: "toradex-imx_v6_v7_defconfig" # Choose max kernel size that `ubinfo /dev/ubi0_0` reports MAX_KERNEL_SIZE_B: 12570624 GIT_STRATEGY: fetch GIT_DEPTH: "1" script: | #set -o xtrace cd $CI_PROJECT_DIR echo -e "Compiler used to build binaries is" which ${CROSS_COMPILE}gcc ${CROSS_COMPILE}gcc --version echo -e "Arch is \e[36m$ARCH\e[39m" THREADS=$(grep processor /proc/cpuinfo -c) make $DEFCONFIG make -j $THREADS 2>&1 | tee $KERNEL_BUILD_LOG_FILE_NAME KERNEL_SIZE=$(ls -la arch/arm/boot/zImage | awk '{print $5}') echo "Kernel size is ${KERNEL_SIZE} bytes" if [ $KERNEL_SIZE -ge $MAX_KERNEL_SIZE_B ]; then echo "❌ Kernel exceeds the max size of ${MAX_KERNEL_SIZE_B}, failing CI pipeline"; exit 1 fi artifacts: when: always name: "$CI_COMMIT_REF_NAME" paths: - $KERNEL_BUILD_LOG_FILE_NAME - kernel-config