diff options
author | Sam McNally <sammc@chromium.org> | 2022-02-11 19:18:34 +1100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-02-17 00:48:05 +0000 |
commit | e35fb64df248c030d4aea1768a7aec68766b3e0c (patch) | |
tree | 2039ca49b6e7887f677615c53f41f4f14a28b9c3 /scripts/image_signing/get_gbb_flags.sh | |
parent | bd2971326ee94fc52d208feaf07336b679cbbfc2 (diff) | |
download | vboot-e35fb64df248c030d4aea1768a7aec68766b3e0c.tar.gz |
vboot: Add --programmer and --servo flags to {get,set}_gbb_flags.sh.stabilize-quickfix-14526.91.Bstabilize-14528.Bstabilize-14526.89.Bstabilize-14526.84.Bstabilize-14526.73.Bstabilize-14526.67.Bstabilize-14526.57.Brelease-R100-14526.B
Allow custom programmers to be used instead of host for getting and
setting GBB flags via a --programmer/-p flag similar to the same flag
for futility. Also support --servo with the same semantics as the
futility flag - detecting the programmer to use from the current servod
instance mirroring the logic in futility. Only CCD is supported at this
stage.
When reading, include the FMAP section as well as the GBB section. For
writes over CCD, avoiding rescanning for the FMAP can save up to 1.8s.
BUG=None
TEST={get,set}_gbb_flags.sh --servo with and without servod running
BRANCH=None
Change-Id: Iecedf4c3d0cad6923aed4405ef4a72910f3f9f05
Signed-off-by: Sam McNally <sammc@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3455562
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Diffstat (limited to 'scripts/image_signing/get_gbb_flags.sh')
-rwxr-xr-x | scripts/image_signing/get_gbb_flags.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/image_signing/get_gbb_flags.sh b/scripts/image_signing/get_gbb_flags.sh index 2b78af61..1191e9f7 100755 --- a/scripts/image_signing/get_gbb_flags.sh +++ b/scripts/image_signing/get_gbb_flags.sh @@ -13,6 +13,8 @@ SCRIPT_BASE="$(dirname "$0")" # DEFINE_string name default_value description flag DEFINE_string file "" "Path to firmware image. Default to system firmware." "f" DEFINE_boolean explicit ${FLAGS_FALSE} "Print list of what flags are set." "e" +DEFINE_string programmer "host" "Programmer to use when setting GBB flags" "p" +DEFINE_boolean servo "${FLAGS_FALSE}" "Determine programmer using servo" "" set -e @@ -23,10 +25,14 @@ main() { fi local image_file="${FLAGS_file}" + local programmer="${FLAGS_programmer}" if [ -z "${FLAGS_file}" ]; then image_file="$(make_temp_file)" - flashrom_read "${image_file}" + if [ "${FLAGS_servo}" = "${FLAGS_TRUE}" ]; then + programmer=$(get_programmer_for_servo) + fi + flashrom_read "${image_file}" "${programmer}" fi # Process file. |