summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDavid Hendricks <david.hendricks@gmail.com>2017-09-16 12:59:23 -0700
committerDavid Hendricks <david.hendricks@gmail.com>2017-09-17 01:13:23 +0000
commitc863be7ba45f5babb965dd38ca779c38e334559d (patch)
tree18593ba0a14dab2e704b26ca922301e0df256f80 /util
parent693315160e84988028abca5ca6c1d311a479717a (diff)
board_status: Add option to set cbmem path
This allows the user to specify a custom path for cbmem on the DUT. Change-Id: I2c28737d6efaae238fd6831cd3d00b2142b39a4c Signed-off-by: David Hendricks <david.hendricks@gmail.com> Reviewed-on: https://review.coreboot.org/21565 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'util')
-rwxr-xr-xutil/board_status/board_status.sh25
1 files changed, 20 insertions, 5 deletions
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh
index 1dcca713da..76da47990f 100755
--- a/util/board_status/board_status.sh
+++ b/util/board_status/board_status.sh
@@ -24,6 +24,9 @@ REMOTE=1
FATAL=0
NONFATAL=1
+# Used if cbmem is not in default $PATH, e.g. not installed or when using `sudo`
+CBMEM_PATH=""
+
# test a command
#
# $1: 0 ($LOCAL) to run command locally,
@@ -172,6 +175,8 @@ show_help() {
${0} <option>
Options
+ -c, --cbmem
+ Path to cbmem on device under test (DUT).
-C, --clobber
Clobber temporary output when finished. Useful for debugging.
-h, --help
@@ -199,16 +204,20 @@ if [ $? -ne 4 ]; then
exit $EXIT_FAILURE
fi
-LONGOPTS="clobber,help,image:,remote-host:,upload-results"
+LONGOPTS="cbmem:,clobber,help,image:,remote-host:,upload-results"
LONGOPTS="${LONGOPTS},serial-device:,serial-speed:"
LONGOPTS="${LONGOPTS},ssh-port:"
-ARGS=$(getopt -o Chi:r:s:S:u -l "$LONGOPTS" -n "$0" -- "$@");
+ARGS=$(getopt -o c:Chi:r:s:S:u -l "$LONGOPTS" -n "$0" -- "$@");
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$ARGS"
while true ; do
case "$1" in
# generic options
+ -c|--cbmem)
+ shift
+ CBMEM_PATH="$1"
+ ;;
-C|--clobber)
CLOBBER_OUTPUT=1
;;
@@ -349,13 +358,19 @@ printf "Upstream revision: %s\n" "$($getrevision -u)" >> "${tmpdir}/${results}/r
printf "Upstream URL: %s\n" "$($getrevision -U)" >> "${tmpdir}/${results}/revision.txt"
printf "Timestamp: %s\n" "$timestamp" >> "${tmpdir}/${results}/revision.txt"
+if [ -n "$CBMEM_PATH" ]; then
+ cbmem_cmd="$CBMEM_PATH"
+else
+ cbmem_cmd="cbmem"
+fi
+
if [ -z "$SERIAL_DEVICE" ]; then
echo "Verifying that CBMEM is available on remote device"
- test_cmd $REMOTE "cbmem"
+ test_cmd $REMOTE "$cbmem_cmd"
echo "Getting coreboot boot log"
- cmd $REMOTE "cbmem -c" "${tmpdir}/${results}/coreboot_console.txt"
+ cmd $REMOTE "$cbmem_cmd -c" "${tmpdir}/${results}/coreboot_console.txt"
echo "Getting timestamp data"
- cmd_nonfatal $REMOTE "cbmem -t" "${tmpdir}/${results}/coreboot_timestamps.txt"
+ cmd_nonfatal $REMOTE "$cbmem_cmd -t" "${tmpdir}/${results}/coreboot_timestamps.txt"
else
get_serial_bootlog "$SERIAL_DEVICE" "$SERIAL_PORT_SPEED" "${tmpdir}/${results}/coreboot_console.txt"
fi