mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-19 15:58:25 +00:00
packaging: coco-guest-components: Pass DESTDIR to the build script
As DESTDIR was not being passed, we've been installing the final binaries in a container path that was not exposed to the host, leading to creating an empty tarball with the guest components. Now, theoretically, guest-components should respect a PREFIX passed, but that's not the case and we're manually adding "/usr/local/bin" to the passed DESTDIR. Here's the result of the tarball: ```bash ⋊> kata-containers ≡ tar tf build/kata-static-coco-guest-components.tar.xz ./ ./usr/ ./usr/local/ ./usr/local/bin/ ./usr/local/bin/confidential-data-hub ./usr/local/bin/attestation-agent ./usr/local/bin/api-server-rest ``` Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
@@ -818,7 +818,7 @@ install_coco_guest_components() {
|
|||||||
&& return 0
|
&& return 0
|
||||||
|
|
||||||
info "build static coco-guest-components"
|
info "build static coco-guest-components"
|
||||||
"${coco_guest_components_builder}"
|
DESTDIR="${destdir}" "${coco_guest_components_builder}"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_tools_helper() {
|
install_tools_helper() {
|
||||||
|
@@ -52,11 +52,11 @@ build_coco_guest_components_from_source() {
|
|||||||
git fetch --depth=1 origin "${coco_guest_components_version}"
|
git fetch --depth=1 origin "${coco_guest_components_version}"
|
||||||
git checkout FETCH_HEAD
|
git checkout FETCH_HEAD
|
||||||
|
|
||||||
TEE_PLATFORM=${TEE_PLATFORM} make build
|
DESTDIR="${DESTDIR}/usr/local/bin" TEE_PLATFORM=${TEE_PLATFORM} make build
|
||||||
strip target/${rust_arch}-unknown-linux-${LIBC}/release/confidential-data-hub
|
strip target/${rust_arch}-unknown-linux-${LIBC}/release/confidential-data-hub
|
||||||
strip target/${rust_arch}-unknown-linux-${LIBC}/release/attestation-agent
|
strip target/${rust_arch}-unknown-linux-${LIBC}/release/attestation-agent
|
||||||
strip target/${rust_arch}-unknown-linux-${LIBC}/release/api-server-rest
|
strip target/${rust_arch}-unknown-linux-${LIBC}/release/api-server-rest
|
||||||
TEE_PLATFORM=${TEE_PLATFORM} make install
|
DESTDIR="${DESTDIR}/usr/local/bin" TEE_PLATFORM=${TEE_PLATFORM} make install
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,6 +13,8 @@ readonly coco_guest_components_builder="${script_dir}/build-static-coco-guest-co
|
|||||||
|
|
||||||
source "${script_dir}/../../scripts/lib.sh"
|
source "${script_dir}/../../scripts/lib.sh"
|
||||||
|
|
||||||
|
DESTDIR=${DESTDIR:-${PWD}}
|
||||||
|
|
||||||
coco_guest_components_repo="${coco_guest_components_repo:-}"
|
coco_guest_components_repo="${coco_guest_components_repo:-}"
|
||||||
coco_guest_components_version="${coco_guest_components_version:-}"
|
coco_guest_components_version="${coco_guest_components_version:-}"
|
||||||
coco_guest_components_toolchain="${coco_guest_components_toolchain:-}"
|
coco_guest_components_toolchain="${coco_guest_components_toolchain:-}"
|
||||||
@@ -38,6 +40,7 @@ sudo docker pull ${container_image} || \
|
|||||||
|
|
||||||
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
||||||
-w "${PWD}" \
|
-w "${PWD}" \
|
||||||
|
--env DESTDIR="${DESTDIR}" \
|
||||||
--env TEE_PLATFORM=${TEE_PLATFORM:-all} \
|
--env TEE_PLATFORM=${TEE_PLATFORM:-all} \
|
||||||
--env coco_guest_components_repo="${coco_guest_components_repo}" \
|
--env coco_guest_components_repo="${coco_guest_components_repo}" \
|
||||||
--env coco_guest_components_version="${coco_guest_components_version}" \
|
--env coco_guest_components_version="${coco_guest_components_version}" \
|
||||||
|
Reference in New Issue
Block a user