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
This commit is contained in:
Oliver Smith 2023-07-18 15:12:04 +02:00 committed by osmith
parent 421bac2d86
commit c53a630c19
3 changed files with 12 additions and 4 deletions

View File

@ -82,6 +82,8 @@ Environment variables:
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}`,

View File

@ -451,6 +451,7 @@ kernel_test_prepare() {
-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"

View File

@ -61,8 +61,13 @@ update_kernel_config() {
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