From 1a25afcdf5d9f84ec2081d4a64a1862d9a6eb13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 11 Jul 2022 14:20:08 +0200 Subject: [PATCH] kernel: Allow passing the URL to download the tarball MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Passing the URL to be used to download the kernel tarball is useful in various scenarios, mainly when doing a downstream build, thus let's add this new option. This new option also works around a known issue of the Dockerfile used to build the kernel not having `yq` installed. Fixes: #4629 Signed-off-by: Fabiano FidĂȘncio --- tools/packaging/kernel/build-kernel.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/packaging/kernel/build-kernel.sh b/tools/packaging/kernel/build-kernel.sh index d3a3be9ea8..837dfd67a6 100755 --- a/tools/packaging/kernel/build-kernel.sh +++ b/tools/packaging/kernel/build-kernel.sh @@ -59,6 +59,8 @@ skip_config_checks="false" DESTDIR="${DESTDIR:-/}" #PREFIX= PREFIX="${PREFIX:-/usr}" +#Kernel URL +kernel_url="" packaging_scripts_dir="${script_dir}/../scripts" source "${packaging_scripts_dir}/lib.sh" @@ -97,6 +99,7 @@ Options: -p : Path to a directory with patches to apply to kernel. -s : Skip .config checks -t : Hypervisor_target. + -u : Kernel URL to be used to download the kernel tarball. -v : Kernel version to use if kernel path not provided. -x : Confidential guest protection type, such as sev and tdx EOF @@ -123,7 +126,7 @@ get_tee_kernel() { mkdir -p ${kernel_path} - kernel_url=$(get_from_kata_deps "assets.kernel.${tee}.url") + [ -z "${kernel_url}" ] && kernel_url=$(get_from_kata_deps "assets.kernel.${tee}.url") kernel_tarball="${version}.tar.gz" if [ ! -f "${kernel_tarball}" ]; then @@ -468,7 +471,7 @@ install_kata() { } main() { - while getopts "a:b:c:deEfg:hk:p:t:v:x:" opt; do + while getopts "a:b:c:deEfg:hk:p:t:u:v:x:" opt; do case "$opt" in a) arch_target="${OPTARG}" @@ -511,6 +514,9 @@ main() { t) hypervisor_target="${OPTARG}" ;; + u) + kernel_url="${OPTARG}" + ;; v) kernel_version="${OPTARG}" ;;