I just tried steps on the document and did not encounter the same error as you did.
So I can only suggest something like deleting the BSP and starting over again, or maybe looking for another host PC.
can you try writing a shell script to echo the variable in the script and see if it works?
If you still cannot get it done, then I’d suggest hard-coding path to the toolchain:
(inside nvcommon_build.sh)
if [ "${IS_CROSS_COMPILATION}" -eq 1 ]; then
check_vars "CROSS_COMPILE_AARCH64_PATH"
CROSS_COMPILE_AARCH64="${CROSS_COMPILE_AARCH64:-${CROSS_COMPILE_AARCH64_PATH}/bin/aarch64-buildroot-linux-gnu-}"
if [ ! -f "${CROSS_COMPILE_AARCH64}gcc" ]; then
echo "Error: Path ${CROSS_COMPILE_AARCH64}gcc does not exist."
exit 1
fi
fi
function check_vars {
# shellcheck disable=SC2124
variables=${@}
for variable in ${variables} ; do
if [ -z "${!variable}" ]; then
++ echo $CROSS_COMPILE_AARCH64
echo "Error: Env variable ${variable} is not set!!"
exit 1
fi
done
}
# Function to check build environment
function check_env_common {
if [ "${IS_CROSS_COMPILATION}" -eq 1 ]; then
check_vars "CROSS_COMPILE_AARCH64_PATH"
-- CROSS_COMPILE_AARCH64="${CROSS_COMPILE_AARCH64:-${CROSS_COMPILE_AARCH64_PATH}/bin/aarch64-buildroot-linux-gnu-}"
++ CROSS_COMPILE_AARCH64="${CROSS_COMPILE_AARCH64:-~/workspace/tools/l4t-gcc/bin/aarch64-buildroot-linux-gnu-}"
if [ ! -f "${CROSS_COMPILE_AARCH64}gcc" ]; then
echo "Error: Path ${CROSS_COMPILE_AARCH64}gcc does not exist."
exit 1
fi
fi
The results of the execution are as follows.
sudo ./nvbuild.sh -o $PWD/kernel_out
Error: Env variable CROSS_COMPILE_AARCH64_PATH is not set!!
The environment variable still does not seem to change.