osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/33799 )
Change subject: scripts/kernel-test: add KERNEL_SKIP_REBUILD ......................................................................
scripts/kernel-test: add KERNEL_SKIP_REBUILD
Speed up local test cycles by not building the kernel again from source if not needed.
Change-Id: Iaa401918d7c09ec92ec546071d8961e99a4cbb47 --- M README.md M jenkins-common.sh M scripts/kernel-test/kernel-build.sh 3 files changed, 24 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/99/33799/1
diff --git a/README.md b/README.md index 0e59fe3..7a7c1ab 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,8 @@ repositories in the same local linux clone, default: net-next) * `KERNEL_URL`: git remote url (default: net-next.git on kernel.org) * `KERNEL_BRANCH` branch to checkout (default: master) +* `KERNEL_SKIP_REBUILD`: set to 1 to not build the kernel again if already + built with `KERNEL_BUILD=1`
The OBS repository mirror consists of `${OSMOCOM_REPO_MIRROR}/${OSMOCOM_REPO_PATH}/${OSMOCOM_REPO_VERSION}`, diff --git a/jenkins-common.sh b/jenkins-common.sh index 20c1c4e..56c06fc 100644 --- a/jenkins-common.sh +++ b/jenkins-common.sh @@ -451,6 +451,7 @@ -e "KERNEL_CONFIG_BASE=$kernel_config_base" \ -e "KERNEL_REMOTE_NAME=$KERNEL_REMOTE_NAME" \ -e "KERNEL_URL=$KERNEL_URL" \ + -e "KERNEL_SKIP_REBUILD=$KERNEL_SKIP_REBUILD" \ "$@" \ "$docker_image" \ "/kernel-test/prepare.sh" diff --git a/scripts/kernel-test/kernel-build.sh b/scripts/kernel-test/kernel-build.sh index 5f246ae..d2127e4 100755 --- a/scripts/kernel-test/kernel-build.sh +++ b/scripts/kernel-test/kernel-build.sh @@ -61,8 +61,13 @@ cp .config "$previous" }
-prepare_git_repo -update_kernel_config +output="$KERNEL_DIR"/arch/x86/boot/bzImage
-make "-j$(nproc)" -cp arch/x86/boot/bzImage /cache/kernel-test/linux +if [ ! -e "$output" ] || [ "$KERNEL_SKIP_REBUILD" != 1 ]; then + prepare_git_repo + update_kernel_config + + make "-j$(nproc)" +fi + +cp "$output" /cache/kernel-test/linux