From 33ac5468fef8e1ab9067be057db5f4a678a84a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 1 Feb 2024 12:19:34 +0100 Subject: [PATCH] packaging: Add function to get the kernel modules directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Right now this is just being added but not used yet. The idea is to use this to both cache and later on untar the kernel modules needed for some of the kernel targets we have (specifically looking at the confidential one). Signed-off-by: Fabiano FidĂȘncio --- .../local-build/kata-deploy-binaries.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh index 61edbb3ce4..39b35060c2 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -126,6 +126,24 @@ EOF exit "${return_code}" } +get_kernel_modules_dir() { + local kernel_version="${1:-}" + local kernel_kata_config_version="${2:-}" + local kernel_name"=${3:-}" + [ -z "${kernel_version}" ] && die "kernel version is a required argument" + [ -z "${kernel_kata_config_version}" ] && die "kernel kata config version is a required argument" + [ -z "${kernel_name}" ] && die "kernel name is a required argument" + + local version=${kernel_version#v} + local numeric_final_version=${version} + + # Every first release of a kernel is x.y, while the resulting folder would be x.y.0 + local dots=$(echo ${version} | grep -o '\.' | wc -l) + [ "${dots}" == "1" ] && numeric_final_version="${version}.0" + + echo "${repo_root_dir}/tools/packaging/kata-deploy/local-build/build/${kernel_name}/builddir/kata-linux-${version}-${kernel_kata_config_version}/lib/modules/${numeric_final_version}" +} + cleanup_and_fail() { rm -f "${component_tarball_name}" return 1