kernel: Allow passing the URL to download the tarball

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 <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2022-07-11 14:20:08 +02:00
parent 80c68b80a8
commit 1a25afcdf5

View File

@ -59,6 +59,8 @@ skip_config_checks="false"
DESTDIR="${DESTDIR:-/}" DESTDIR="${DESTDIR:-/}"
#PREFIX= #PREFIX=
PREFIX="${PREFIX:-/usr}" PREFIX="${PREFIX:-/usr}"
#Kernel URL
kernel_url=""
packaging_scripts_dir="${script_dir}/../scripts" packaging_scripts_dir="${script_dir}/../scripts"
source "${packaging_scripts_dir}/lib.sh" source "${packaging_scripts_dir}/lib.sh"
@ -97,6 +99,7 @@ Options:
-p <path> : Path to a directory with patches to apply to kernel. -p <path> : Path to a directory with patches to apply to kernel.
-s : Skip .config checks -s : Skip .config checks
-t <hypervisor> : Hypervisor_target. -t <hypervisor> : Hypervisor_target.
-u <url> : Kernel URL to be used to download the kernel tarball.
-v <version> : Kernel version to use if kernel path not provided. -v <version> : Kernel version to use if kernel path not provided.
-x <type> : Confidential guest protection type, such as sev and tdx -x <type> : Confidential guest protection type, such as sev and tdx
EOF EOF
@ -123,7 +126,7 @@ get_tee_kernel() {
mkdir -p ${kernel_path} 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" kernel_tarball="${version}.tar.gz"
if [ ! -f "${kernel_tarball}" ]; then if [ ! -f "${kernel_tarball}" ]; then
@ -468,7 +471,7 @@ install_kata() {
} }
main() { 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 case "$opt" in
a) a)
arch_target="${OPTARG}" arch_target="${OPTARG}"
@ -511,6 +514,9 @@ main() {
t) t)
hypervisor_target="${OPTARG}" hypervisor_target="${OPTARG}"
;; ;;
u)
kernel_url="${OPTARG}"
;;
v) v)
kernel_version="${OPTARG}" kernel_version="${OPTARG}"
;; ;;