From ddc2f1c3313dd41e2c16b256d6358f3cedd65397 Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Thu, 9 Feb 2023 13:34:40 +0000 Subject: [PATCH] osbuilder: Make attestation-agent build Update the build to use the attestation-agent makefile to build it, so we can pick up the enhancements there Fixes: #6253 Signed-off-by: stevenhorsman --- tools/osbuilder/rootfs-builder/rootfs.sh | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/tools/osbuilder/rootfs-builder/rootfs.sh b/tools/osbuilder/rootfs-builder/rootfs.sh index 4323a57403..c246f40322 100755 --- a/tools/osbuilder/rootfs-builder/rootfs.sh +++ b/tools/osbuilder/rootfs-builder/rootfs.sh @@ -670,23 +670,12 @@ EOF info "Install attestation-agent with KBC ${AA_KBC}" #git clone "${attestation_agent_url}" --branch "${attestation_agent_tag}" --single-branch git clone --depth=1 "${attestation_agent_url}" attestation-agent - pushd attestation-agent/app + + pushd attestation-agent git fetch --depth=1 origin "${attestation_agent_version}" git checkout FETCH_HEAD - source "${HOME}/.cargo/env" - target="${ARCH}-unknown-linux-${LIBC}" - if [ "${AA_KBC}" == "eaa_kbc" ] && [ "${ARCH}" == "x86_64" ]; then - RUSTFLAGS="-C link-args=-Wl,-rpath,/usr/local/lib/rats-tls" - # Currently eaa_kbc module only support this specific platform - target="x86_64-unknown-linux-gnu" - fi - if [ "$(uname -m)" != "$ARCH" ]; then - RUSTFLAGS+=" -C linker=$CC" - fi - export RUSTFLAGS - # Foreign CC is incompatible with libgit2 -- CC is still handled by `-C linker=...` flag - CC= cargo build --release --target "${target}" --no-default-features --features "${AA_KBC}" - install -D -o root -g root -m 0755 "target/${target}/release/attestation-agent" -t "${ROOTFS_DIR}/usr/local/bin/" + [ "${AA_KBC}" == "eaa_kbc" ] && [ "${ARCH}" == "x86_64" ] && LIBC="gnu" + make KBC=${AA_KBC} && make install DESTDIR="${ROOTFS_DIR}/usr/local/bin/" popd fi