From fe86c08a634ed3effff1915447c2d8a1197dc960 Mon Sep 17 00:00:00 2001 From: Zvonko Kaiser Date: Mon, 3 Apr 2023 13:40:59 +0000 Subject: [PATCH] tools: Avoid building the kernel twice Two different kernel build targets (build,install) have both instructions to build the kernel, hence it was executed twice. Install should only do install and build should only do build. Fixes: #6588 Signed-off-by: Zvonko Kaiser --- tools/packaging/kernel/build-kernel.sh | 3 ++- tools/packaging/kernel/kata_config_version | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/packaging/kernel/build-kernel.sh b/tools/packaging/kernel/build-kernel.sh index af7e36e6b..4de27ca33 100755 --- a/tools/packaging/kernel/build-kernel.sh +++ b/tools/packaging/kernel/build-kernel.sh @@ -419,6 +419,8 @@ install_kata() { local kernel_path=${1:-} [ -n "${kernel_path}" ] || die "kernel_path not provided" [ -d "${kernel_path}" ] || die "path to kernel does not exist, use ${script_name} setup" + [ -n "${arch_target}" ] || arch_target="$(uname -m)" + arch_target=$(arch_to_kernel "${arch_target}") pushd "${kernel_path}" >>/dev/null config_version=$(get_config_version) [ -n "${config_version}" ] || die "failed to get config version" @@ -593,7 +595,6 @@ main() { build_kernel "${kernel_path}" ;; install) - build_kernel "${kernel_path}" install_kata "${kernel_path}" ;; setup) diff --git a/tools/packaging/kernel/kata_config_version b/tools/packaging/kernel/kata_config_version index 257e56326..a9c8fe829 100644 --- a/tools/packaging/kernel/kata_config_version +++ b/tools/packaging/kernel/kata_config_version @@ -1 +1 @@ -102 +103