summaryrefslogtreecommitdiff
path: root/el3_payload
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2018-08-30 17:37:43 +0200
committerSandrine Bailleux <sandrine.bailleux@arm.com>2019-05-10 14:31:07 +0200
commit7c5df58ddbb2c55a0ef16d1e8d9ae3f3d2f4c73e (patch)
treebb892f0c8949550fcba0111186e559998a47ff0f /el3_payload
parent47ab4f4fd1c650eff22844593577814a095952dd (diff)
run_armds_script.sh: Ask user which DSTREAM to connect to
Previously the script to run the EL3 payload on Juno would connect to the first DSTREAM it detected, without even asking the user's consent. Change-Id: I1586957094cc3247c1dadf0adac263af0256e03d Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Diffstat (limited to 'el3_payload')
-rwxr-xr-xel3_payload/scripts/juno/run_armds_script.sh24
1 files changed, 18 insertions, 6 deletions
diff --git a/el3_payload/scripts/juno/run_armds_script.sh b/el3_payload/scripts/juno/run_armds_script.sh
index b2d6b17..d9763b4 100755
--- a/el3_payload/scripts/juno/run_armds_script.sh
+++ b/el3_payload/scripts/juno/run_armds_script.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
set -e
@@ -31,16 +31,28 @@ armdbg --cdb-entry "$juno_cdb_entry" --browse \
tail -n +2 $connections_list > ${connections_list}_stripped
mv ${connections_list}_stripped ${connections_list}
-# Use first available connection
-read connection < $connections_list || true
-rm $connections_list
+if [ ! -s $connections_list ] ; then
+ echo "ERROR: Found no connection"
+ exit 1
+fi
+
+# Ask the user which connection to use.
+echo
+cat -n $connections_list
+echo -n "Which one do you want to connect to? "
+read connection_id
+# Extract the corresponding connection name from the file.
+connection=$(((sed -n "${connection_id}p") | sed 's/^ *//') < $connections_list)
if [ -z "$connection" ] ; then
- echo "ERROR: Found no connection"
- exit 1
+ echo "ERROR: Invalid connection"
+ exit 1
fi
+rm $connections_list
+
# Run DS-5 script
+echo
echo "Connecting to $connection..."
armdbg \
--cdb-entry "$juno_cdb_entry" \