From 2a1ea0b741e7a248ba9e1a18c83ffd98c18ed08a Mon Sep 17 00:00:00 2001 From: Per Held Date: Mon, 17 Mar 2025 13:18:57 +0100 Subject: [PATCH] Arm backend: Make setup.sh handle unset EULA variable If setup.sh was called without --i-agree-to-the-contained-eula or with ARM_FVP_INSTALL_I_AGREE_TO_THE_CONTAINED_EULA unset all you would get back is the error message: "examples/arm/setup.sh: line 88: ARM_FVP_INSTALL_I_AGREE_TO_THE_CONTAINED_EULA: unbound variable" This is not a good error message. This commit adds handling of this variable being unset and gives a proper error message on how to accept the EULA. Change-Id: I2fd85ff136f708f91836fae32e4e402d0557fa25 --- examples/arm/setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/arm/setup.sh b/examples/arm/setup.sh index d37d0b0f637..cc8774ba7a0 100755 --- a/examples/arm/setup.sh +++ b/examples/arm/setup.sh @@ -84,8 +84,10 @@ function setup_fvp() { # Mandatory user arg --i-agree-to-the-contained-eula eula_acceptance="${1:-'.'}" + eula_acceptance_by_variable="${ARM_FVP_INSTALL_I_AGREE_TO_THE_CONTAINED_EULA:-False}" + if [[ "${eula_acceptance}" != "--i-agree-to-the-contained-eula" ]]; then - if [[ ${ARM_FVP_INSTALL_I_AGREE_TO_THE_CONTAINED_EULA} != "True" ]]; then + if [[ ${eula_acceptance_by_variable} != "True" ]]; then echo "Must pass first positional argument '--i-agree-to-the-contained-eula' to agree to EULA associated with downloading the FVP. Exiting!" exit 1 else