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>
diff --git a/Makefile b/Makefile
index f18051c..9b1c2aa 100644
--- a/Makefile
+++ b/Makefile
@@ -596,7 +596,6 @@
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 @@
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_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 c8422fd..d5f41f2 100755
--- a/tests/load_kernel_tests.sh
+++ b/tests/load_kernel_tests.sh
@@ -69,7 +69,7 @@
# 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
similarity index 92%
rename from futility/cmd_verify_kernel.c
rename to tests/verify_kernel.c
index ffdf7d0..2f5943d 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 @@
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 @@
printf("Yaay!\n");
return 0;
}
-
-DECLARE_FUTIL_COMMAND(verify_kernel, do_verify_kernel,
- "Verifies a kernel / disk image",
- print_help);