From 1173bf30fa174f9ae32551223660b1b0f0082cec Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Thu, 19 Nov 2015 13:04:27 -0800 Subject: 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 Reviewed-on: https://review.coreboot.org/12489 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer Reviewed-by: Paul Menzel --- util/board_status/board_status.sh | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'util/board_status') 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 + Path to coreboot image (Default is $COREBOOT_IMAGE). -r Obtain machine information from remote host (using ssh). -s @@ -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 -- cgit v1.2.3