mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
The host-side futility tool will need to support all extant vboot
implementations. Some legacy futility commands only support the
original vb1 format, but others ("show" or "sign", for example)
may need to be instructed which formats to expect or emit.
This change adds some global args to specify the preferred
formats. It also cleans up a few [unused AFAICT] one-letter args
to avoid conflicts.
BUG=chromium:231574
BRANCH=none
TEST=make runtests
Nothing makes use of this yet, except the "help" command.
Change-Id: Ib79fa12af72b8860b9494e5d9e90b9572c006107
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/246765
Reviewed-by: Randall Spangler <rspangler@chromium.org>
53 lines
1.7 KiB
Bash
Executable File
53 lines
1.7 KiB
Bash
Executable File
#!/bin/bash -eux
|
|
# Copyright 2013 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
me=${0##*/}
|
|
TMP="$me.tmp"
|
|
|
|
# Work in scratch directory
|
|
cd "$OUTDIR"
|
|
|
|
# Good FMAP
|
|
"$FUTILITY" dump_fmap -F "${SCRIPTDIR}/data_fmap.bin" > "$TMP"
|
|
cmp "${SCRIPTDIR}/data_fmap_expect_f.txt" "$TMP"
|
|
|
|
"$FUTILITY" dump_fmap -p "${SCRIPTDIR}/data_fmap.bin" > "$TMP"
|
|
cmp "${SCRIPTDIR}/data_fmap_expect_p.txt" "$TMP"
|
|
|
|
"$FUTILITY" dump_fmap -h "${SCRIPTDIR}/data_fmap.bin" > "$TMP"
|
|
cmp "${SCRIPTDIR}/data_fmap_expect_h.txt" "$TMP"
|
|
|
|
|
|
# This should fail because the input file is truncated and doesn't really
|
|
# contain the stuff that the FMAP claims it does.
|
|
if "$FUTILITY" dump_fmap -x "${SCRIPTDIR}/data_fmap.bin" FMAP; then false; fi
|
|
|
|
# This should fail too
|
|
if "$FUTILITY" show "${SCRIPTDIR}/data_fmap.bin"; then false; fi
|
|
|
|
# However, this should work.
|
|
"$FUTILITY" dump_fmap -x "${SCRIPTDIR}/data_fmap.bin" SI_DESC > "$TMP"
|
|
cmp "${SCRIPTDIR}/data_fmap_expect_x.txt" "$TMP"
|
|
|
|
# Redirect dumping to a different place
|
|
"$FUTILITY" dump_fmap -x "${SCRIPTDIR}/data_fmap.bin" SI_DESC:FOO > "$TMP"
|
|
cmp "${SCRIPTDIR}/data_fmap_expect_x2.txt" "$TMP"
|
|
cmp SI_DESC FOO
|
|
|
|
# This FMAP has problems, and should fail.
|
|
if "$FUTILITY" dump_fmap -h "${SCRIPTDIR}/data_fmap2.bin" > "$TMP"; then false; fi
|
|
cmp "${SCRIPTDIR}/data_fmap2_expect_h.txt" "$TMP"
|
|
|
|
"$FUTILITY" dump_fmap -hh "${SCRIPTDIR}/data_fmap2.bin" > "$TMP"
|
|
cmp "${SCRIPTDIR}/data_fmap2_expect_hh.txt" "$TMP"
|
|
|
|
"$FUTILITY" dump_fmap -hhH "${SCRIPTDIR}/data_fmap2.bin" > "$TMP"
|
|
cmp "${SCRIPTDIR}/data_fmap2_expect_hhH.txt" "$TMP"
|
|
|
|
|
|
# cleanup
|
|
rm -f ${TMP}* FMAP SI_DESC FOO
|
|
exit 0
|