Change invocation of "gbb_utility" to "futility gbb"

Replace commands using gbb_utility by the new 'gbb' futility command.

BRANCH=none
BUG=None
TEST=USE=test emerge-$BOARD vboot_reference

Change-Id: I8c1547d295a955373413482509a33964b0e0c06f
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/538442
Reviewed-by: Stefan Reinauer <reinauer@google.com>
This commit is contained in:
Hung-Te Lin
2017-06-19 10:08:46 +08:00
committed by chrome-bot
parent 3522e574a2
commit 01dc818924
10 changed files with 73 additions and 72 deletions

View File

@@ -193,7 +193,8 @@ main() {
fi
debug_msg "Extract firmware version and data key version"
gbb_utility -g --rootkey="$expanded_firmware_dir/rootkey" "$IMAGE" >/dev/null 2>&1
futility gbb -g --rootkey="$expanded_firmware_dir/rootkey" "$IMAGE" \
>/dev/null 2>&1
local data_key_version firmware_version
# When we are going to flash directly from or to system, the versions stored
@@ -269,7 +270,7 @@ main() {
debug_msg "Extract current HWID"
local old_hwid
old_hwid="$(gbb_utility --get --hwid "$IMAGE" 2>"$EXEC_LOG" |
old_hwid="$(futility gbb --get --hwid "$IMAGE" 2>"$EXEC_LOG" |
sed -rne 's/^hardware_id: (.*)$/\1/p')"
debug_msg "Decide new HWID"
@@ -281,7 +282,7 @@ main() {
fi
local old_gbb_flags
old_gbb_flags="$(gbb_utility --get --flags "$IMAGE" 2>"$EXEC_LOG" |
old_gbb_flags="$(futility gbb --get --flags "$IMAGE" 2>"$EXEC_LOG" |
sed -rne 's/^flags: (.*)$/\1/p')"
debug_msg "Decide new GBB flags from: $old_gbb_flags"
[ -z "$old_gbb_flags" ] &&
@@ -289,8 +290,8 @@ main() {
# 0x30: GBB_FLAG_FORCE_DEV_BOOT_USB | GBB_FLAG_DISABLE_FW_ROLLBACK_CHECK
local new_gbb_flags="$((old_gbb_flags | 0x30))"
debug_msg "Replace GBB parts (gbb_utility allows changing on-the-fly)"
gbb_utility --set \
debug_msg "Replace GBB parts (futility gbb allows changing on-the-fly)"
futility gbb --set \
--hwid="$new_hwid" \
--rootkey="$root_pubkey" \
--recoverykey="$recovery_pubkey" \
@@ -300,7 +301,7 @@ main() {
# Old firmware does not support GBB flags, so let's make it an exception.
if [ "$FLAGS_mod_gbb_flags" = "$FLAGS_TRUE" ]; then
debug_msg "Changing GBB flags from $old_gbb_flags to $new_gbb_flags"
gbb_utility --set \
futility gbb --set \
--flags="$new_gbb_flags" \
"$IMAGE" >"$EXEC_LOG" 2>&1 ||
echo "Warning: GBB flags ($old_gbb_flags -> $new_gbb_flags) can't be set."