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."

View File

@@ -389,7 +389,7 @@ sanity_check_live_firmware() {
local rootkey_file="$(make_temp_file)"
info "checking system firmware..."
sudo flashrom -p host -i GBB -r "$bios_image" >/dev/null 2>&1
gbb_utility -g --rootkey="$rootkey_file" "$bios_image" >/dev/null 2>&1
futility gbb -g --rootkey="$rootkey_file" "$bios_image" >/dev/null 2>&1
if [ ! -s "$rootkey_file" ]; then
debug_msg "failed to read root key from system firmware..."
else

View File

@@ -90,9 +90,9 @@ main() {
fi
# Process file
local old_value="$(gbb_utility -g --flags "$image_file")"
local old_value="$(futility gbb -g --flags "$image_file")"
printf "Setting GBB flags from %s to 0x%x.." "$old_value" "$value" >&2
gbb_utility -s --flags="$value" "$image_file"
futility gbb -s --flags="$value" "$image_file"
if [ -z "$FLAGS_file" ]; then
if [ "$FLAGS_check_wp" = "$FLAGS_TRUE" ]; then

View File

@@ -37,7 +37,7 @@ gbb_update() {
# firmware. Note: This needs to happen after calling resign_firmwarefd.sh
# since it needs to be able to verify the firmware using the root key to
# determine the preamble flags.
gbb_utility \
futility gbb \
-s \
--recoverykey="${key_dir}/recovery_key.vbpubk" \
--rootkey="${rootkey}" \

View File

@@ -8,7 +8,7 @@
#
# Prerequisite tools needed in the system path:
#
# gbb_utility (from src/platform/vboot_reference)
# futility (from src/platform/vboot_reference)
# vbutil_kernel (from src/platform/vboot_reference)
# cgpt (from src/platform/vboot_reference)
# dump_kernel_config (from src/platform/vboot_reference)
@@ -84,7 +84,7 @@ set -e
PATH=$PATH:/usr/sbin:/sbin
# Make sure the tools we need are available.
for prereqs in gbb_utility vbutil_kernel cgpt dump_kernel_config verity \
for prereqs in futility vbutil_kernel cgpt dump_kernel_config verity \
load_kernel_test dumpe2fs sha1sum e2fsck; do
type -P "${prereqs}" &>/dev/null || \
die "${prereqs} tool not found."