summaryrefslogtreecommitdiffstats
path: root/debug/risc-v-gsp-rm-vm/rmharness/rmq.sh
diff options
context:
space:
mode:
Diffstat (limited to 'debug/risc-v-gsp-rm-vm/rmharness/rmq.sh')
-rwxr-xr-xdebug/risc-v-gsp-rm-vm/rmharness/rmq.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/debug/risc-v-gsp-rm-vm/rmharness/rmq.sh b/debug/risc-v-gsp-rm-vm/rmharness/rmq.sh
new file mode 100755
index 0000000..ce0670e
--- /dev/null
+++ b/debug/risc-v-gsp-rm-vm/rmharness/rmq.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# rmq.sh - build-if-needed wrapper for the existing tools/rmq host RM oracle.
+# rmq itself is not modified by the harness; this only locates/builds it.
+set -euo pipefail
+HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ROOT="$(cd "$HERE/../../.." && pwd)"
+BIN="$ROOT/tools/rmq/rmq"
+# rmq has no --help flag; answer it here so the smoke check never touches the
+# device (see rmharness/README.md "Safe smoke checks").
+case "${1:-}" in
+-h | --help)
+ echo "usage: $(basename "$0") [rmq-index options] (read-only RM oracle)"
+ echo " rmq has no launcher of its own; see $ROOT/tools/rmq/."
+ echo " Built on first use from $ROOT/tools/rmq."
+ exit 0
+ ;;
+esac
+if [[ ! -x "$BIN" ]]; then
+ make -C "$ROOT/tools/rmq" >&2
+fi
+exec "$BIN" "$@"