From b34894e37ee9fe9ee233ed7d990c13ce79244129 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Thu, 21 Mar 2024 10:14:43 +0000 Subject: [PATCH] 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 --- .../config/env/sys-block/thin-provisioning-tools | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-block/thin-provisioning-tools diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-block/thin-provisioning-tools b/sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-block/thin-provisioning-tools new file mode 100644 index 0000000000..e2b17a5677 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-block/thin-provisioning-tools @@ -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 +}