futility: implement vbutil_kernel using buffers, not files
The original vbutil_kernel command used file read and write to
make changes. Futility prefers to use memory-mapped files. This
rewrites cmd_vbutil_kernel.c to use that scheme.
BUG=none
BRANCH=ToT
TEST=make runtests
The original cmd_vbutil_kernel.c is renamed, and a test written
to ensure that the refactored version produces identical results.
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Ic6c3e12429a5dcb271f8136a9edac70807d66120
Reviewed-on: https://chromium-review.googlesource.com/219647
Reviewed-by: Randall Spangler <rspangler@chromium.org>
diff --git a/Makefile b/Makefile
index b65c692..d5f0088 100644
--- a/Makefile
+++ b/Makefile
@@ -541,14 +541,16 @@
futility/cmd_dev_sign_file.c \
futility/cmd_dump_kernel_config.c \
futility/cmd_load_fmap.c \
+ futility/cmd_show.c \
+ futility/cmd_sign.c \
futility/cmd_vbutil_firmware.c \
futility/cmd_vbutil_kernel.c \
+ futility/cmd_vbutil_kernel0.c \
futility/cmd_vbutil_key.c \
futility/cmd_vbutil_keyblock.c \
futility/cmd_verify_kernel.c \
- futility/cmd_show.c \
- futility/cmd_sign.c \
- futility/traversal.c
+ futility/traversal.c \
+ futility/vb1_helper.c
ifneq (${VBOOT2},)
FUTIL_SRCS += \