Merge pull request #6249 from stevenhorsman/attestation-agent-bump

osbuilder: Make attestation-agent build
This commit is contained in:
Steve Horsman 2023-03-23 12:26:51 +00:00 committed by GitHub
commit b1afabdef0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -670,23 +670,12 @@ EOF
info "Install attestation-agent with KBC ${AA_KBC}" info "Install attestation-agent with KBC ${AA_KBC}"
#git clone "${attestation_agent_url}" --branch "${attestation_agent_tag}" --single-branch #git clone "${attestation_agent_url}" --branch "${attestation_agent_tag}" --single-branch
git clone --depth=1 "${attestation_agent_url}" attestation-agent 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 fetch --depth=1 origin "${attestation_agent_version}"
git checkout FETCH_HEAD git checkout FETCH_HEAD
source "${HOME}/.cargo/env" [ "${AA_KBC}" == "eaa_kbc" ] && [ "${ARCH}" == "x86_64" ] && LIBC="gnu"
target="${ARCH}-unknown-linux-${LIBC}" make KBC=${AA_KBC} && make install DESTDIR="${ROOTFS_DIR}/usr/local/bin/"
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/"
popd popd
fi fi