coreos: Add coreos-cargo hook for sys-block/thin-provisioning-tools

We currently ship an amd64 binary of thin-provisioning-tools on arm64.
To fix this add a hook that hijacks src_unpack and calls the
cross-compilation friendly implementation. We also need to fixup the
src_install implementation since it looks for the produced binary in the
default cargo location.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2024-03-21 10:14:43 +00:00
parent 44bb4367b4
commit b34894e37e

View File

@ -0,0 +1,16 @@
cros_pre_src_unpack_coreos_unpack() {
local _COREOS_CARGO_SKIP_INHERIT=1
source "${CROS_ADDONS_TREE}"/../eclass/coreos-cargo.eclass
src_unpack() {
einfo "Running coreos-cargo_src_unpack"
coreos-cargo_src_unpack
}
}
cros_pre_src_install_rust_cross() {
pushd "${S}"
local rust_target="$(ls -d target/*-unknown-linux-gnu)"
rust_target="${rust_target#target/}"
ln -f target/{"${rust_target}",}/"$(usex debug debug release)/pdata_tools" || die
popd
}