summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2016-12-02 15:06:39 +0000
committerRyan Harkin <ryan.harkin@linaro.org>2016-12-02 17:30:44 +0000
commit0b493e3947252aa76248845ebd03121f32d0b9c1 (patch)
treee2b028d914f9eaaadd60cf71d0eff10a92f77e11
parent5b311faf5941df17d10f2d380f414fb2bb4d9194 (diff)
Add parameter support
Add the ability to specifiy commandline parameters to the script. Other than "help", there are no parameters added in this patch. Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
-rwxr-xr-xrun_model.sh44
1 files changed, 34 insertions, 10 deletions
diff --git a/run_model.sh b/run_model.sh
index 3d43483..4ecd5c0 100755
--- a/run_model.sh
+++ b/run_model.sh
@@ -30,17 +30,40 @@
err=0
-# $1 - the output dir to run in the model
-rundir=$1
+function usage
+{
+ echo "usage: $0 [--aarch32] [rundir]"
+ echo "Options:"
+ echo " [rundir] the script will run from a directory specified on the commandline"
+ echo " otherwise it will run from the current working directory"
+ echo " use this to tell the model where to find the binaries you want"
+ echo " to load if they aren't in the current directory."
+ exit
+}
+
+while [ "$1" != "" ]; do
+ case $1 in
+ "-h" | "-?" | "-help" | "--help" | "--h" | "help" )
+ usage
+ exit
+ ;;
+ *)
+ if [ "$rundir" == "" ]
+ then
+ rundir=$1
+ fi
+ ;;
+ esac
+ shift
+done
-# If the run dir is not set, use the current dir
-if [ "$rundir" != "" ]; then
- if [ -e $rundir ]; then
- cd $rundir
- else
- echo "ERROR: you set the run directory to $rundir, however that path does not exist"
- exit 1
- fi
+rundir=${rundir:-.}
+
+if [ -e $rundir ]; then
+ cd $rundir
+else
+ echo "ERROR: the run directory to $rundir, however that path does not exist"
+ exit 1
fi
CLUSTER0_NUM_CORES=${CLUSTER0_NUM_CORES:-1}
@@ -133,6 +156,7 @@ SECURE_MEMORY=${SECURE_MEMORY:-0}
echo "Running FVP Base Model with these parameters:"
echo "MODEL=$MODEL"
+echo "rundir=$rundir"
echo "BL1=$BL1"
echo "FIP=$FIP"
echo "IMAGE=$IMAGE"