From ff20f2008b8d53ff49f3d115d1ae71ce061d7bc6 Mon Sep 17 00:00:00 2001 From: Archana Shinde Date: Tue, 3 Dec 2019 18:03:24 -0800 Subject: [PATCH] release: Checkout right version of kernel patches Checkout tag for packaging repo based on env variable NEW_VERSION or kata_version with kata_version taking precedence. With this, we checkout to the right version of packaging repo before applying kernel patches. Fixes #849 Signed-off-by: Archana Shinde --- kernel/build-kernel.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/build-kernel.sh b/kernel/build-kernel.sh index 102e71c34c..16524f825d 100755 --- a/kernel/build-kernel.sh +++ b/kernel/build-kernel.sh @@ -271,7 +271,13 @@ get_config_and_patches() { if [ -z "${patches_path}" ]; then info "Clone config and patches" patches_path="${default_patches_dir}" - [ -d "${patches_path}" ] || git clone "https://${patches_repo}.git" "${patches_repo_dir}" + if [ ! -d "${patches_path}" ]; then + tag="${kata_version:-$NEW_VERSION}" + git clone "https://${patches_repo}.git" "${patches_repo_dir}" + pushd "${patches_repo_dir}" >> /dev/null + git checkout $tag + popd >> /dev/null + fi fi }