Get utility script name from TF configuration
The problem was found with CI build scripts when building rdn1edgex2
platform. Both rdn1edge and rdn1edgex2 have PLAT=rdn1edge in their TF
configs (which is correct, as there is no rdn1edgex2 build option
for TF-A).The problem is that PLAT sets 'plat' variable which is used
to call ${plat}_utils.sh and rdn1edge_utils.sh is called instead of
rdn1edgex2_utils.sh.
To resolve this issue introduced a new config parameter “SCRIPT_NAME”
inside the TF configuration which is used to source the utility script
for e.g. rdn1edge_utils.sh.
Change-Id: I5c50f71acc77f0bb2d24393e784360adb36adf95
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
diff --git a/script/build_package.sh b/script/build_package.sh
index 2c61f05..cd5caf2 100755
--- a/script/build_package.sh
+++ b/script/build_package.sh
@@ -1194,9 +1194,17 @@
(
echo "##########"
- # Source platform-specific utilities
- plat="$(get_tftf_opt PLAT)"
- plat_utils="$ci_root/${plat}_utils.sh"
+ plat_utils="$(get_tf_opt PLAT_UTILS)"
+ if [ -z ${plat_utils} ]; then
+ # Source platform-specific utilities.
+ plat="$(get_tftf_opt PLAT)"
+ plat_utils="$ci_root/${plat}_utils.sh"
+ else
+ # Source platform-specific utilities by
+ # using plat_utils name.
+ plat_utils="$ci_root/${plat_utils}.sh"
+ fi
+
if [ -f "$plat_utils" ]; then
source "$plat_utils"
fi
@@ -1226,9 +1234,17 @@
(
echo "##########"
- # Source platform-specific utilities
- plat="$(get_tf_opt PLAT)"
- plat_utils="$ci_root/${plat}_utils.sh"
+ plat_utils="$(get_tf_opt PLAT_UTILS)"
+ if [ -z ${plat_utils} ]; then
+ # Source platform-specific utilities.
+ plat="$(get_tf_opt PLAT)"
+ plat_utils="$ci_root/${plat}_utils.sh"
+ else
+ # Source platform-specific utilities by
+ # using plat_utils name.
+ plat_utils="$ci_root/${plat_utils}.sh"
+ fi
+
if [ -f "$plat_utils" ]; then
source "$plat_utils"
fi