diff options
author | David Hendricks <dhendrix@chromium.org> | 2015-11-19 13:04:27 -0800 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-02-23 00:49:16 +0100 |
commit | 1173bf30fa174f9ae32551223660b1b0f0082cec (patch) | |
tree | da6d9f239adbc3423b8abf5214acf5782b7c817d /util | |
parent | 10104685c50d05353318932f183864f3fca37489 (diff) | |
download | coreboot-1173bf30fa174f9ae32551223660b1b0f0082cec.tar.xz |
board_status.sh: Allow user to override coreboot image path
Some users may wish to run this script using a coreboot image
that does get built in the usual build/ directory, for example
if abuild is used to generate the image.
Change-Id: I7e98780f8b7b57ebbf3babd6a289f0e4fd4103d8
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://review.coreboot.org/12489
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'util')
-rwxr-xr-x | util/board_status/board_status.sh | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh index 95bc536ce2..058a3d9394 100755 --- a/util/board_status/board_status.sh +++ b/util/board_status/board_status.sh @@ -10,6 +10,7 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Stuff from command-line switches +COREBOOT_IMAGE="build/coreboot.rom" REMOTE_HOST="" CLOBBER_OUTPUT=0 UPLOAD_RESULTS=0 @@ -174,6 +175,8 @@ Options Show this message. -C Clobber temporary output when finished. Useful for debugging. + -i <image> + Path to coreboot image (Default is $COREBOOT_IMAGE). -r <host> Obtain machine information from remote host (using ssh). -s </dev/xxx> @@ -185,7 +188,7 @@ Options " } -while getopts "Chr:s:S:u" opt; do +while getopts "Chi:r:s:S:u" opt; do case "$opt" in h) show_help @@ -194,6 +197,9 @@ while getopts "Chr:s:S:u" opt; do C) CLOBBER_OUTPUT=1 ;; + i) + COREBOOT_IMAGE="$OPTARG" + ;; r) REMOTE_HOST="$OPTARG" ;; @@ -239,24 +245,24 @@ fi test_cmd $LOCAL "$cbfstool_cmd" tmpcfg=$(mktemp coreboot_config.XXXXXX) -echo "Extracting config.txt from build/coreboot.rom" -$cbfstool_cmd build/coreboot.rom extract -n config -f "${tmpdir}/config.txt" >/dev/null 2>&1 +echo "Extracting config.txt from $COREBOOT_IMAGE" +$cbfstool_cmd "$COREBOOT_IMAGE" extract -n config -f "${tmpdir}/config.txt" >/dev/null 2>&1 mv "${tmpdir}/config.txt" "${tmpdir}/config.short.txt" cp "${tmpdir}/config.short.txt" "${tmpcfg}" yes "" | make "DOTCONFIG=${tmpcfg}" oldconfig 2>/dev/null >/dev/null mv "${tmpcfg}" "${tmpdir}/config.txt" rm -f "${tmpcfg}.old" -$cbfstool_cmd build/coreboot.rom print > "${tmpdir}/cbfs.txt" -rom_contents=$($cbfstool_cmd build/coreboot.rom print 2>&1) +$cbfstool_cmd "$COREBOOT_IMAGE" print > "${tmpdir}/cbfs.txt" +rom_contents=$($cbfstool_cmd "$COREBOOT_IMAGE" print 2>&1) if [ -n "$(echo $rom_contents | grep payload_config)" ]; then - echo "Extracting payload_config from build/coreboot.rom" - $cbfstool_cmd build/coreboot.rom extract -n payload_config -f "${tmpdir}/payload_config.txt" >/dev/null 2>&1 + echo "Extracting payload_config from $COREBOOT_IMAGE" + $cbfstool_cmd "$COREBOOT_IMAGE" extract -n payload_config -f "${tmpdir}/payload_config.txt" >/dev/null 2>&1 fi if [ -n "$(echo $rom_contents | grep payload_version)" ]; then - echo "Extracting payload_version from build/coreboot.rom" - $cbfstool_cmd build/coreboot.rom extract -n payload_version -f "${tmpdir}/payload_version.txt" >/dev/null 2>&1 + echo "Extracting payload_version from $COREBOOT_IMAGE" + $cbfstool_cmd "$COREBOOT_IMAGE" extract -n payload_version -f "${tmpdir}/payload_version.txt" >/dev/null 2>&1 fi -md5sum -b build/coreboot.rom > "${tmpdir}/rom_checksum.txt" +md5sum -b "$COREBOOT_IMAGE" > "${tmpdir}/rom_checksum.txt" if test $do_clean_cbfstool -eq 1; then make -C util/cbfstool clean |