summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-12-04 19:06:35 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-22 22:45:53 +0000
commita77541f94f731f5f7755264e9b49b7826aa48dfe (patch)
treee37da28da60783037d6a7cba6799d8ceeb3f33c7
parent4dad690e082af98de8311566c197efbbfa1bc956 (diff)
downloadvboot-a77541f94f731f5f7755264e9b49b7826aa48dfe.tar.gz
futility: extract verify_kernel command to an external test
The verify_kernel command is used only in a host-side test. It doesn't need to be built into futility. This makes it a separate executable used just for that test. BUG=chromium:231547 BRANCH=none TEST=make runtests Note that the load_kernel_tests.sh still passes, using the external verify_kernel executable. Change-Id: I309d2561d65af7eb4f3708e9bc024852238deeec Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/235480 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--Makefile3
-rwxr-xr-xtests/load_kernel_tests.sh2
-rw-r--r--tests/verify_kernel.c (renamed from futility/cmd_verify_kernel.c)9
3 files changed, 5 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index f18051cd..9b1c2aaa 100644
--- a/Makefile
+++ b/Makefile
@@ -596,7 +596,6 @@ FUTIL_SRCS = \
futility/cmd_vbutil_kernel.c \
futility/cmd_vbutil_key.c \
futility/cmd_vbutil_keyblock.c \
- futility/cmd_verify_kernel.c \
futility/traversal.c \
futility/vb1_helper.c
@@ -662,6 +661,7 @@ TEST_NAMES = \
tests/vboot_firmware_tests \
tests/vboot_kernel_tests \
tests/vboot_nvstorage_test \
+ tests/verify_kernel \
tests/futility/binary_editor \
tests/futility/test_not_really
@@ -1130,6 +1130,7 @@ ${BUILD}/tests/vboot_common2_tests: LDLIBS += ${CRYPTO_LIBS}
${BUILD}/tests/vboot_common3_tests: LDLIBS += ${CRYPTO_LIBS}
${BUILD}/tests/vb20_common2_tests: LDLIBS += ${CRYPTO_LIBS}
${BUILD}/tests/vb20_common3_tests: LDLIBS += ${CRYPTO_LIBS}
+${BUILD}/tests/verify_kernel: LDLIBS += ${CRYPTO_LIBS}
${TEST21_BINS}: LDLIBS += ${CRYPTO_LIBS}
diff --git a/tests/load_kernel_tests.sh b/tests/load_kernel_tests.sh
index c8422fd3..d5f41f25 100755
--- a/tests/load_kernel_tests.sh
+++ b/tests/load_kernel_tests.sh
@@ -69,7 +69,7 @@ dd if=kernel.test of=disk.test bs=512 seek=64 conv=notrunc
# And verify it using futility
echo 'Verifying test disk image'
-${FUTILITY} verify_kernel disk.test \
+${BUILD_RUN}/tests/verify_kernel disk.test \
${SCRIPT_DIR}/devkeys/kernel_subkey.vbpubk
happy 'Image verification succeeded'
diff --git a/futility/cmd_verify_kernel.c b/tests/verify_kernel.c
index ffdf7d0f..2f5943d2 100644
--- a/futility/cmd_verify_kernel.c
+++ b/tests/verify_kernel.c
@@ -14,7 +14,6 @@
#include "vboot_common.h"
#include "vboot_api.h"
#include "vboot_kernel.h"
-#include "futility.h"
static uint8_t *diskbuf;
@@ -55,11 +54,11 @@ VbError_t VbExDiskWrite(VbExDiskHandle_t handle, uint64_t lba_start,
static void print_help(const char *progname)
{
- printf("\nUsage: " MYNAME " %s <disk_image> <kernel.vbpubk>\n\n",
+ printf("\nUsage: %s <disk_image> <kernel.vbpubk>\n\n",
progname);
}
-static int do_verify_kernel(int argc, char *argv[])
+int main(int argc, char *argv[])
{
VbPublicKey *kernkey;
uint64_t disk_bytes = 0;
@@ -136,7 +135,3 @@ static int do_verify_kernel(int argc, char *argv[])
printf("Yaay!\n");
return 0;
}
-
-DECLARE_FUTIL_COMMAND(verify_kernel, do_verify_kernel,
- "Verifies a kernel / disk image",
- print_help);