diff options
-rw-r--r-- | futility/cmd_show.c | 1 | ||||
-rw-r--r-- | futility/cmd_sign.c | 1 | ||||
-rw-r--r-- | futility/cmd_vbutil_kernel.c | 1 | ||||
-rw-r--r-- | futility/futility.c | 11 | ||||
-rw-r--r-- | futility/misc.c | 3 | ||||
-rwxr-xr-x | tests/futility/test_sign_fw_main.sh | 2 | ||||
-rwxr-xr-x | tests/futility/test_sign_kernel.sh | 24 | ||||
-rwxr-xr-x | tests/futility/test_sign_keyblocks.sh | 8 |
8 files changed, 26 insertions, 25 deletions
diff --git a/futility/cmd_show.c b/futility/cmd_show.c index aa0ac6bc..f4681f37 100644 --- a/futility/cmd_show.c +++ b/futility/cmd_show.c @@ -597,6 +597,7 @@ static const struct option long_opts[] = { {"fv", 1, 0, 'f'}, {"pad", 1, NULL, OPT_PADDING}, {"verify", 0, &option.strict, 1}, + {"debug", 0, &debugging_enabled, 1}, {NULL, 0, NULL, 0}, }; static char *short_opts = ":f:k:t"; diff --git a/futility/cmd_sign.c b/futility/cmd_sign.c index 0c428bf9..192305f7 100644 --- a/futility/cmd_sign.c +++ b/futility/cmd_sign.c @@ -693,6 +693,7 @@ static const struct option long_opts[] = { {"pem_algo", 1, NULL, OPT_PEM_ALGO}, {"pem_external", 1, NULL, OPT_PEM_EXTERNAL}, {"vblockonly", 0, &option.vblockonly, 1}, + {"debug", 0, &debugging_enabled, 1}, {NULL, 0, NULL, 0}, }; static char *short_opts = ":s:b:k:S:B:v:f:d:l:"; diff --git a/futility/cmd_vbutil_kernel.c b/futility/cmd_vbutil_kernel.c index ab5c8d7f..c7b3c78c 100644 --- a/futility/cmd_vbutil_kernel.c +++ b/futility/cmd_vbutil_kernel.c @@ -85,6 +85,7 @@ static const struct option long_opts[] = { {"vblockonly", 0, 0, OPT_VBLOCKONLY}, {"pad", 1, 0, OPT_PAD}, {"verbose", 0, &opt_verbose, 1}, + {"debug", 0, &debugging_enabled, 1}, {"vmlinuz-out", 1, 0, OPT_VMLINUZ_OUT}, {"flags", 1, 0, OPT_FLAGS}, {NULL, 0, 0, 0} diff --git a/futility/futility.c b/futility/futility.c index e11cbadf..02f61af9 100644 --- a/futility/futility.c +++ b/futility/futility.c @@ -176,6 +176,9 @@ static void log_args(int argc, char *argv[]) /******************************************************************************/ +/* Default is to support everything we can */ +enum vboot_version vboot_version = VBOOT_VERSION_ALL; + static const char *const usage = "\n" "Usage: " MYNAME " [options] COMMAND [args...]\n" "\n" @@ -193,7 +196,6 @@ static const char *const options = "\n" " --vb1 Use only vboot v1.0 binary formats\n" " --vb21 Use only vboot v2.1 binary formats\n" -" --debug Be noisy about what's going on\n" "\n"; static const struct futil_cmd_t *find_command(const char *name) @@ -269,7 +271,7 @@ DECLARE_FUTIL_COMMAND(version, do_version, VBOOT_VERSION_ALL, "Show the futility source revision and build date", NULL); -static int run_command(const struct futil_cmd_t *cmd, int argc, char *argv[]) +int run_command(const struct futil_cmd_t *cmd, int argc, char *argv[]) { /* Handle the "CMD --help" case ourselves */ if (2 == argc && 0 == strcmp(argv[1], "--help")) { @@ -300,9 +302,8 @@ int main(int argc, char *argv[], char *envp[]) int i, errorcnt = 0; int vb_ver = VBOOT_VERSION_ALL; struct option long_opts[] = { - {"debug", 0, &debugging_enabled, 1}, - {"vb1" , 0, &vb_ver, VBOOT_VERSION_1_0}, - {"vb21", 0, &vb_ver, VBOOT_VERSION_2_1}, + {"vb1" , 0, &vb_ver, VBOOT_VERSION_1_0}, + {"vb21", 0, &vb_ver, VBOOT_VERSION_2_1}, { 0, 0, 0, 0}, }; diff --git a/futility/misc.c b/futility/misc.c index c01cb97b..3d85f691 100644 --- a/futility/misc.c +++ b/futility/misc.c @@ -25,9 +25,6 @@ #include "futility.h" #include "gbb_header.h" -/* Default is to support everything we can */ -enum vboot_version vboot_version = VBOOT_VERSION_ALL; - int debugging_enabled; void Debug(const char *format, ...) { diff --git a/tests/futility/test_sign_fw_main.sh b/tests/futility/test_sign_fw_main.sh index face8016..eec68a6c 100755 --- a/tests/futility/test_sign_fw_main.sh +++ b/tests/futility/test_sign_fw_main.sh @@ -29,7 +29,7 @@ ${FUTILITY} vbutil_firmware --verify ${TMP}.vblock.old \ --fv ${TMP}.fw_main # and the new way -${FUTILITY} --debug sign \ +${FUTILITY} sign --debug \ --signprivate ${KEYDIR}/firmware_data_key.vbprivk \ --keyblock ${KEYDIR}/firmware.keyblock \ --kernelkey ${KEYDIR}/kernel_subkey.vbpubk \ diff --git a/tests/futility/test_sign_kernel.sh b/tests/futility/test_sign_kernel.sh index 6ceab02f..73da5ddb 100755 --- a/tests/futility/test_sign_kernel.sh +++ b/tests/futility/test_sign_kernel.sh @@ -26,7 +26,7 @@ try_arch () { echo -n "${arch}: 1 " 1>&3 # pack it up the old way - ${FUTILITY} --debug vbutil_kernel \ + ${FUTILITY} vbutil_kernel --debug \ --pack ${TMP}.blob1.${arch} \ --keyblock ${DEVKEYS}/recovery_kernel.keyblock \ --signprivate ${DEVKEYS}/recovery_kernel_data_key.vbprivk \ @@ -44,7 +44,7 @@ try_arch () { --signpubkey ${DEVKEYS}/recovery_key.vbpubk > ${TMP}.verify1 # pack it up the new way - ${FUTILITY} --debug sign \ + ${FUTILITY} sign --debug \ --keyblock ${DEVKEYS}/recovery_kernel.keyblock \ --signprivate ${DEVKEYS}/recovery_kernel_data_key.vbprivk \ --version 1 \ @@ -67,7 +67,7 @@ try_arch () { echo -n "2 " 1>&3 # repack it the old way - ${FUTILITY} --debug vbutil_kernel \ + ${FUTILITY} vbutil_kernel --debug \ --repack ${TMP}.blob3.${arch} \ --oldblob ${TMP}.blob1.${arch} \ --signprivate ${DEVKEYS}/kernel_data_key.vbprivk \ @@ -83,7 +83,7 @@ try_arch () { --signpubkey ${DEVKEYS}/kernel_subkey.vbpubk > ${TMP}.verify3 # repack it the new way - ${FUTILITY} --debug sign \ + ${FUTILITY} sign --debug \ --signprivate ${DEVKEYS}/kernel_data_key.vbprivk \ --keyblock ${DEVKEYS}/kernel.keyblock \ --version 2 \ @@ -105,7 +105,7 @@ try_arch () { # repack it the new way, in-place cp ${TMP}.blob2.${arch} ${TMP}.blob5.${arch} - ${FUTILITY} --debug sign \ + ${FUTILITY} sign --debug \ --signprivate ${DEVKEYS}/kernel_data_key.vbprivk \ --keyblock ${DEVKEYS}/kernel.keyblock \ --version 2 \ @@ -144,7 +144,7 @@ try_arch () { cmp ${TMP}.blob1.${arch}.vb0 ${TMP}.blob1.${arch}.vb1 # pack the new way - ${FUTILITY} --debug sign \ + ${FUTILITY} sign --debug \ --keyblock ${DEVKEYS}/recovery_kernel.keyblock \ --signprivate ${DEVKEYS}/recovery_kernel_data_key.vbprivk \ --version 1 \ @@ -182,14 +182,14 @@ try_arch () { # extract just the kernel blob dd bs=${padding} skip=1 if=${TMP}.blob3.${arch} of=${TMP}.blob3.${arch}.kb0 # and verify it using the new vblock (no way to do that with vbutil_kernel) - ${FUTILITY} --debug verify \ + ${FUTILITY} verify --debug \ --pad ${padding} \ --publickey ${DEVKEYS}/kernel_subkey.vbpubk \ --fv ${TMP}.blob3.${arch}.kb0 \ ${TMP}.blob3.${arch}.vb1 > ${TMP}.verify3v # repack the new way - ${FUTILITY} --debug sign \ + ${FUTILITY} sign --debug \ --signprivate ${DEVKEYS}/kernel_data_key.vbprivk \ --keyblock ${DEVKEYS}/kernel.keyblock \ --version 2 \ @@ -207,7 +207,7 @@ try_arch () { # extract just the kernel blob dd bs=${padding} skip=1 if=${TMP}.blob4.${arch} of=${TMP}.blob4.${arch}.kb0 # and verify it using the new vblock (no way to do that with vbutil_kernel) - ${FUTILITY} --debug verify \ + ${FUTILITY} verify --debug \ --pad ${padding} \ --publickey ${DEVKEYS}/kernel_subkey.vbpubk \ --fv ${TMP}.blob4.${arch}.kb0 \ @@ -229,7 +229,7 @@ try_arch () { diff ${TMP}.verify1 ${TMP}.verify6 # repack it the old way - ${FUTILITY} --debug vbutil_kernel \ + ${FUTILITY} vbutil_kernel --debug \ --repack ${TMP}.part6.${arch} \ --oldblob ${TMP}.part1.${arch} \ --signprivate ${DEVKEYS}/kernel_data_key.vbprivk \ @@ -249,7 +249,7 @@ try_arch () { # repack it the new way, in-place cp ${TMP}.part1.${arch} ${TMP}.part6.${arch}.new1 - ${FUTILITY} --debug sign \ + ${FUTILITY} sign --debug \ --signprivate ${DEVKEYS}/kernel_data_key.vbprivk \ --keyblock ${DEVKEYS}/kernel.keyblock \ --version 2 \ @@ -273,7 +273,7 @@ try_arch () { # repack it the new way, from input to output cp ${TMP}.part1.${arch} ${TMP}.part1.${arch}.in - ${FUTILITY} --debug sign \ + ${FUTILITY} sign --debug \ --signprivate ${DEVKEYS}/kernel_data_key.vbprivk \ --keyblock ${DEVKEYS}/kernel.keyblock \ --version 2 \ diff --git a/tests/futility/test_sign_keyblocks.sh b/tests/futility/test_sign_keyblocks.sh index 7ba43afa..1cccd346 100755 --- a/tests/futility/test_sign_keyblocks.sh +++ b/tests/futility/test_sign_keyblocks.sh @@ -30,7 +30,7 @@ cmp ${DEVKEYS}/firmware.keyblock ${TMP}.keyblock0 # Now create it the new way -${FUTILITY} --debug sign \ +${FUTILITY} sign --debug \ --datapubkey ${DEVKEYS}/firmware_data_key.vbpubk \ --flags 7 \ --signprivate ${DEVKEYS}/root_key.vbprivk \ @@ -48,7 +48,7 @@ ${FUTILITY} vbutil_keyblock --pack ${TMP}.keyblock0 \ --flags 14 # new way -${FUTILITY} --debug sign \ +${FUTILITY} sign --debug \ --flags 14 \ ${DEVKEYS}/firmware_data_key.vbpubk \ ${TMP}.keyblock1 @@ -70,7 +70,7 @@ ${FUTILITY} vbutil_keyblock --unpack ${TMP}.keyblock2 \ --signpubkey ${TESTKEYS}/key_rsa4096.sha512.vbpubk # new way -${FUTILITY} --debug sign \ +${FUTILITY} sign --debug \ --pem_signpriv ${TESTKEYS}/key_rsa4096.pem \ --pem_algo 8 \ --flags 9 \ @@ -94,7 +94,7 @@ ${FUTILITY} vbutil_keyblock --unpack ${TMP}.keyblock4 \ --signpubkey ${TESTKEYS}/key_rsa4096.sha512.vbpubk # new way -${FUTILITY} --debug sign \ +${FUTILITY} sign --debug \ --pem_signpriv ${TESTKEYS}/key_rsa4096.pem \ --pem_algo 8 \ --pem_external ${SIGNER} \ |