Merge pull request #761 from bergwolf/fix-clh-build

packaging: fix cloud-hypervisor build
This commit is contained in:
Bin Liu 2020-09-19 10:31:00 +08:00 committed by GitHub
commit 6c034baa00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 21 deletions

View File

@ -173,7 +173,7 @@ install_clh() {
kata_version="${kata_version}" "${script_dir}/../static-build/cloud-hypervisor/build-static-clh.sh"
info "Install static cloud-hypervisor"
mkdir -p "${destdir}/opt/kata/bin/"
sudo install -D --owner root --group root --mode 0744 cloud-hypervisor/cloud-hypervisor "${destdir}/opt/kata/bin/cloud-hypervisor"
sudo install -D --owner root --group root --mode 0744 cloud-hypervisor "${destdir}/opt/kata/bin/cloud-hypervisor"
pushd "${destdir}"
# create tarball for github release action
tar -czvf ../kata-static-clh.tar.gz *

View File

@ -13,29 +13,12 @@ kata_version="${kata_version:-}"
source "${script_dir}/../../scripts/lib.sh"
cloud_hypervisor_repo="${cloud_hypervisor_repo:-}"
cloud_hypervisor_version="${cloud_hypervisor_version:-}"
if [ -z "$cloud_hypervisor_repo" ]; then
info "Get cloud_hypervisor information from runtime versions.yaml"
cloud_hypervisor_url=$(get_from_kata_deps "assets.hypervisor.cloud_hypervisor.url" "${kata_version}")
[ -n "$cloud_hypervisor_url" ] || die "failed to get cloud_hypervisor url"
cloud_hypervisor_repo="${cloud_hypervisor_url}.git"
fi
[ -n "$cloud_hypervisor_repo" ] || die "failed to get cloud_hypervisor repo"
[ -n "$cloud_hypervisor_version" ] || cloud_hypervisor_version=$(get_from_kata_deps "assets.hypervisor.cloud_hypervisor.version" "${kata_version}")
[ -n "$cloud_hypervisor_version" ] || die "failed to get cloud_hypervisor version"
info "Build ${cloud_hypervisor_repo} version: ${cloud_hypervisor_version}"
info "Download cloud-hypervisor version: ${cloud_hypervisor_version}"
cloud_hypervisor_binary="https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/${cloud_hypervisor_version}/cloud-hypervisor-static"
repo_dir=$(basename "${cloud_hypervisor_repo}")
repo_dir="${repo_dir//.git}"
[ -d "${repo_dir}" ] || git clone "${cloud_hypervisor_repo}"
cd "${repo_dir}"
git fetch || true
git checkout "${cloud_hypervisor_version}"
"${script_dir}/docker-build/build.sh"
rm -f cloud-hypervisor
cp ./target/release/cloud-hypervisor .
curl --fail -L ${cloud_hypervisor_binary} -o cloud-hypervisor