From 6d2d0c699856362d5be7cdd0e4f5d30b99d18c89 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Mon, 5 Nov 2018 15:18:46 -0500 Subject: [PATCH] Checkout kernel only if necessary Signed-off-by: Jonathan Rajotte --- jobs/system-tests.yaml | 5 ----- scripts/system-tests/check-build-needs.sh | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/jobs/system-tests.yaml b/jobs/system-tests.yaml index 9a33e6f..2a1ed5b 100644 --- a/jobs/system-tests.yaml +++ b/jobs/system-tests.yaml @@ -344,11 +344,6 @@ - git: url: https://github.com/lttng/lttng-ci basedir: src/lttng-ci/ - - git: - url : $KGITREPO - basedir: src/linux/ - branches: - - $KERNEL_COMMIT_ID - git: url : $LTTNG_MODULES_REPO basedir: src/lttng-modules/ diff --git a/scripts/system-tests/check-build-needs.sh b/scripts/system-tests/check-build-needs.sh index 6602d39..cf51ab2 100644 --- a/scripts/system-tests/check-build-needs.sh +++ b/scripts/system-tests/check-build-needs.sh @@ -49,6 +49,13 @@ set -e # We need to fetch the kernel source and lttng-modules to build either the # kernel or modules if [ $NEED_MODULES_BUILD -eq 1 ] || [ $NEED_KERNEL_BUILD -eq 1 ] ; then + mkdir -p "$LINUX_PATH" + pushd "$LINUX_PATH" + git init + git remote add origin "$KGITREPO" + git fetch --depth 1 origin "$KERNEL_COMMIT_ID" + git checkout FETCH_HEAD + popd cp src/lttng-ci/lava/kernel/vanilla/x86_64_server.config "$LINUX_PATH/.config" make --directory="$LINUX_PATH" olddefconfig -- 2.34.1