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>
This commit is contained in:
David Hendricks 2017-09-16 12:59:23 -07:00
parent 693315160e
commit c863be7ba4
1 changed files with 20 additions and 5 deletions

View File

@ -24,6 +24,9 @@ REMOTE=1
FATAL=0 FATAL=0
NONFATAL=1 NONFATAL=1
# Used if cbmem is not in default $PATH, e.g. not installed or when using `sudo`
CBMEM_PATH=""
# test a command # test a command
# #
# $1: 0 ($LOCAL) to run command locally, # $1: 0 ($LOCAL) to run command locally,
@ -172,6 +175,8 @@ show_help() {
${0} <option> ${0} <option>
Options Options
-c, --cbmem
Path to cbmem on device under test (DUT).
-C, --clobber -C, --clobber
Clobber temporary output when finished. Useful for debugging. Clobber temporary output when finished. Useful for debugging.
-h, --help -h, --help
@ -199,16 +204,20 @@ if [ $? -ne 4 ]; then
exit $EXIT_FAILURE exit $EXIT_FAILURE
fi 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},serial-device:,serial-speed:"
LONGOPTS="${LONGOPTS},ssh-port:" 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 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$ARGS" eval set -- "$ARGS"
while true ; do while true ; do
case "$1" in case "$1" in
# generic options # generic options
-c|--cbmem)
shift
CBMEM_PATH="$1"
;;
-C|--clobber) -C|--clobber)
CLOBBER_OUTPUT=1 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 "Upstream URL: %s\n" "$($getrevision -U)" >> "${tmpdir}/${results}/revision.txt"
printf "Timestamp: %s\n" "$timestamp" >> "${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 if [ -z "$SERIAL_DEVICE" ]; then
echo "Verifying that CBMEM is available on remote device" echo "Verifying that CBMEM is available on remote device"
test_cmd $REMOTE "cbmem" test_cmd $REMOTE "$cbmem_cmd"
echo "Getting coreboot boot log" 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" 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 else
get_serial_bootlog "$SERIAL_DEVICE" "$SERIAL_PORT_SPEED" "${tmpdir}/${results}/coreboot_console.txt" get_serial_bootlog "$SERIAL_DEVICE" "$SERIAL_PORT_SPEED" "${tmpdir}/${results}/coreboot_console.txt"
fi fi