diff options
Diffstat (limited to 'util/board_status')
-rwxr-xr-x | util/board_status/board_status.sh | 25 |
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 |