From 8f38dcb8504a78d7ebd6f8630ceab4103bf941ff Mon Sep 17 00:00:00 2001 From: ChengyuZhu6 Date: Mon, 11 Sep 2023 09:13:43 +0800 Subject: [PATCH] osbuilder: check rust enviornment before building agent and AA We should configure the Rust environment when AGENT_SOURCE_BIN is empty or AA_KBC is not empty. Fixes #7877 Signed-off-by: ChengyuZhu6 --- tools/osbuilder/rootfs-builder/rootfs.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/osbuilder/rootfs-builder/rootfs.sh b/tools/osbuilder/rootfs-builder/rootfs.sh index ee7569d7ce..9d30472457 100755 --- a/tools/osbuilder/rootfs-builder/rootfs.sh +++ b/tools/osbuilder/rootfs-builder/rootfs.sh @@ -606,7 +606,7 @@ EOF AGENT_DIR="${ROOTFS_DIR}/usr/bin" AGENT_DEST="${AGENT_DIR}/${AGENT_BIN}" - if [ -z "${AGENT_SOURCE_BIN}" ] ; then + if [ -z "${AGENT_SOURCE_BIN}" ] || [ -n "${AA_KBC}" ]; then test -r "${HOME}/.cargo/env" && source "${HOME}/.cargo/env" # rust agent needs ${arch}-unknown-linux-${LIBC} if ! (rustup show | grep -v linux-${LIBC} > /dev/null); then @@ -617,7 +617,9 @@ EOF bash ${script_dir}/../../../ci/install_rust.sh ${RUST_VERSION} fi test -r "${HOME}/.cargo/env" && source "${HOME}/.cargo/env" + fi + if [ -z "${AGENT_SOURCE_BIN}" ]; then agent_dir="${script_dir}/../../../src/agent/" if [ "${SECCOMP}" == "yes" ]; then