diff --git a/tools/packaging/kata-deploy/local-build/Makefile b/tools/packaging/kata-deploy/local-build/Makefile index ad7d480421..68e45d447e 100644 --- a/tools/packaging/kata-deploy/local-build/Makefile +++ b/tools/packaging/kata-deploy/local-build/Makefile @@ -38,6 +38,10 @@ firecracker-tarball: kernel-tarball: ${MAKE} $@-build +kernel-experimental-tarball: + ${MAKE} $@-build + + qemu-tarball: ${MAKE} $@-build 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 0d4be8b035..1de2e7bdc2 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -67,6 +67,7 @@ options: cloud-hypervisor firecracker kernel + kernel-experimental qemu rootfs-image rootfs-initrd @@ -91,17 +92,16 @@ install_initrd() { #Install kernel asset install_kernel() { export kernel_version="$(yq r $versions_yaml assets.kernel.version)" - DESTDIR="${destdir}" PREFIX="${prefix}" "${kernel_builder}" "${kernel_version}" + DESTDIR="${destdir}" PREFIX="${prefix}" "${kernel_builder}" -f -v "${kernel_version}" } + #Install experimental kernel asset install_experimental_kernel() { info "build experimental kernel" - export kernel_version="$(yq r $versions_yaml assets.kernel-experimental.version)" - "${kernel_builder}" -e setup - "${kernel_builder}" -e build - info "install experimental kernel" - DESTDIR="${destdir}" PREFIX="${prefix}" "${kernel_builder}" -e install + export kernel_version="$(yq r $versions_yaml assets.kernel-experimental.tag)" + info "Kernel version ${kernel_version}" + DESTDIR="${destdir}" PREFIX="${prefix}" "${kernel_builder}" -e -v ${kernel_version} } # Install static qemu asset @@ -158,7 +158,6 @@ handle_build() { case "${build_target}" in all) install_clh - install_experimental_kernel install_firecracker install_image install_initrd @@ -173,6 +172,8 @@ handle_build() { kernel) install_kernel ;; + kernel-experimental) install_experimental_kernel;; + qemu) install_qemu ;; rootfs-image) install_image ;; @@ -201,6 +202,7 @@ main() { cloud-hypervisor firecracker kernel + kernel-experimental qemu rootfs-image rootfs-initrd diff --git a/tools/packaging/kernel/build-kernel.sh b/tools/packaging/kernel/build-kernel.sh index 828939a6c4..47bbc7e940 100755 --- a/tools/packaging/kernel/build-kernel.sh +++ b/tools/packaging/kernel/build-kernel.sh @@ -127,8 +127,9 @@ get_kernel() { kernel_tarball="linux-${version}.tar.xz" if [ ! -f sha256sums.asc ] || ! grep -q "${kernel_tarball}" sha256sums.asc; then - info "Download kernel checksum file: sha256sums.asc" - curl --fail -OL "https://cdn.kernel.org/pub/linux/kernel/v${major_version}.x/sha256sums.asc" + shasum_url="https://cdn.kernel.org/pub/linux/kernel/v${major_version}.x/sha256sums.asc" + info "Download kernel checksum file: sha256sums.asc from ${shasum_url}" + curl --fail -OL "${shasum_url}" fi grep "${kernel_tarball}" sha256sums.asc >"${kernel_tarball}.sha256" diff --git a/tools/packaging/static-build/kernel/build.sh b/tools/packaging/static-build/kernel/build.sh index 701050acf3..1a177ea033 100755 --- a/tools/packaging/static-build/kernel/build.sh +++ b/tools/packaging/static-build/kernel/build.sh @@ -13,26 +13,24 @@ readonly repo_root_dir="$(cd "${script_dir}/../../../.." && pwd)" readonly kernel_builder="${repo_root_dir}/tools/packaging/kernel/build-kernel.sh" -kernel_version=${1} DESTDIR=${DESTDIR:-${PWD}} PREFIX=${PREFIX:-/opt/kata} container_image="kata-kernel-builder" sudo docker build -t "${container_image}" "${script_dir}" -echo "build ${kernel_version}" sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ -w "${PWD}" \ "${container_image}" \ - bash -c "${kernel_builder} -v ${kernel_version} setup" + bash -c "${kernel_builder} $* setup" sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ -w "${PWD}" \ "${container_image}" \ - bash -c "${kernel_builder} -v ${kernel_version} build" + bash -c "${kernel_builder} $* build" sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ -w "${PWD}" \ --env DESTDIR="${DESTDIR}" --env PREFIX="${PREFIX}" \ "${container_image}" \ - bash -c "${kernel_builder} -v ${kernel_version} install" + bash -c "${kernel_builder} $* install"