summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.com>2018-09-11 00:02:36 +0300
committerPatrick Georgi <pgeorgi@google.com>2020-03-10 20:20:27 +0000
commitb8634685337b3730f474953e07fe9afd4f94007e (patch)
tree594080ece04e750adf7dfbb90e7c459d486b382d /util
parent549a33091a39de94998caa74f41d372118f5c12b (diff)
downloadcoreboot-b8634685337b3730f474953e07fe9afd4f94007e.tar.xz
util/board_status: Add support of CMOS values dump
Change-Id: I89f9a0e9622557b01dda52378f8f1323777bce39 Signed-off-by: Evgeny Zinoviev <me@ch1p.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/28565 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Peter Lemenkov <lemenkov@gmail.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util')
-rwxr-xr-xutil/board_status/board_status.sh48
1 files changed, 47 insertions, 1 deletions
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh
index 0dc96e8bd7..6d6854d071 100755
--- a/util/board_status/board_status.sh
+++ b/util/board_status/board_status.sh
@@ -27,6 +27,9 @@ NONFATAL=1
# Used if cbmem is not in default $PATH, e.g. not installed or when using `sudo`
CBMEM_PATH=""
+# Used if nvramtool is not in default $PATH, e.g. not installed or when using `sudo`
+NVRAMTOOL_PATH=""
+
# test a command
#
# $1: 0 ($LOCAL) to run command locally,
@@ -176,6 +179,8 @@ show_help() {
Options
-c, --cbmem
Path to cbmem on device under test (DUT).
+ -n, --nvramtool
+ Path to nvramtool on device under test (DUT).
-C, --clobber
Clobber temporary output when finished. Useful for debugging.
-h, --help
@@ -207,7 +212,7 @@ LONGOPTS="cbmem:,clobber,help,image:,remote-host:,upload-results"
LONGOPTS="${LONGOPTS},serial-device:,serial-speed:"
LONGOPTS="${LONGOPTS},ssh-port:"
-ARGS=$(getopt -o c:Chi:r:s:S:u -l "$LONGOPTS" -n "$0" -- "$@");
+ARGS=$(getopt -o c:n:Chi:r:s:S:u -l "$LONGOPTS" -n "$0" -- "$@");
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$ARGS"
while true ; do
@@ -217,6 +222,10 @@ while true ; do
shift
CBMEM_PATH="$1"
;;
+ -n|--nvramtool)
+ shift
+ NVRAMTOOL_PATH="$1"
+ ;;
-C|--clobber)
CLOBBER_OUTPUT=1
;;
@@ -370,6 +379,17 @@ else
cbmem_cmd="cbmem"
fi
+cmos_enabled=0
+if grep -q "CONFIG_USE_OPTION_TABLE=y" "${tmpdir}/${results}/config.short.txt" > /dev/null; then
+ cmos_enabled=1
+fi
+
+if [ -n "$NVRAMTOOL_PATH" ]; then
+ nvramtool_cmd="$NVRAMTOOL_PATH"
+else
+ nvramtool_cmd="nvramtool"
+fi
+
if [ -n "$SERIAL_DEVICE" ]; then
get_serial_bootlog "$SERIAL_DEVICE" "$SERIAL_PORT_SPEED" "${tmpdir}/${results}/coreboot_console.txt"
elif [ -n "$REMOTE_HOST" ]; then
@@ -380,6 +400,13 @@ elif [ -n "$REMOTE_HOST" ]; then
echo "Getting timestamp data"
cmd_nonfatal $REMOTE "$cbmem_cmd -t" "${tmpdir}/${results}/coreboot_timestamps.txt"
+ if [ "$cmos_enabled" -eq 1 ]; then
+ echo "Verifying that nvramtool is available on remote device"
+ test_cmd $REMOTE "$nvramtool_cmd"
+ echo "Getting all CMOS values"
+ cmd $REMOTE "$nvramtool_cmd -a" "${tmpdir}/${results}/cmos_values.txt"
+ fi
+
echo "Getting remote dmesg"
cmd $REMOTE dmesg "${tmpdir}/${results}/kernel_log.txt"
else
@@ -402,6 +429,25 @@ else
echo "Getting timestamp data"
cmd_nonfatal $LOCAL "$cbmem_cmd -t" "${tmpdir}/${results}/coreboot_timestamps.txt"
+ if [ "$cmos_enabled" -eq 1 ]; then
+ echo "Verifying that nvramtool is available"
+ if [ $(id -u) -ne 0 ]; then
+ command -v "$nvramtool_cmd" >/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Failed to run $nvramtool_cmd. Check \$PATH or" \
+ "use -n to specify path to nvramtool binary."
+ exit $EXIT_FAILURE
+ else
+ nvramtool_cmd="sudo $nvramtool_cmd"
+ fi
+ else
+ test_cmd $LOCAL "$nvramtool_cmd"
+ fi
+
+ echo "Getting all CMOS values"
+ cmd $LOCAL "$nvramtool_cmd -a" "${tmpdir}/${results}/cmos_values.txt"
+ fi
+
echo "Getting local dmesg"
cmd $LOCAL "sudo dmesg" "${tmpdir}/${results}/kernel_log.txt"
fi