diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-03-07 12:54:29 -0800 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-03-11 08:38:46 -0700 |
commit | feb2518166b1cd181e607c611cbb610f0c7300da (patch) | |
tree | 33a22857fad5a1f2246caf064b3b4eec8867e00f /utility | |
parent | 5fed2a667096341160db8643a4a057e328953a1d (diff) | |
download | vboot-feb2518166b1cd181e607c611cbb610f0c7300da.tar.gz |
Wrap all vboot utilities with futility.firmware-spring-3833.Bfactory-spring-3842.B
This moves all the old userspace utilities generated by vboot_reference into
a subdirectory not in $PATH, and replaces them with symlinks to a single
executable named 'futility'. At the moment that utility just execs the
original utilities (optionally logging that fact first).
Ultimately, the old utilities will be subsumed into a single binary instead
of multiple separate executables.
There is a matching CL needed to make the recovery image creation work.
BUG=chromium-os:37062
BRANCH=none
CQ-DEPEND=CL:44864
TEST=auto
To test, build everything, test everything. It should work as before in all
cases. I have built normal images, test images, factory installers, recovery
images; they all seem to work.
I've run trybots on daisy-paladin link-paladin lumpy-paladin and alex-paladin.
Change-Id: Ie93db676f2ed2a64e4b13b3b5dc6b65a77db0f8c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44871
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'utility')
-rw-r--r-- | utility/dumpRSAPublicKey.c | 8 | ||||
-rw-r--r-- | utility/gbb_utility.cc | 7 | ||||
-rw-r--r-- | utility/tpmc.c | 11 |
3 files changed, 22 insertions, 4 deletions
diff --git a/utility/dumpRSAPublicKey.c b/utility/dumpRSAPublicKey.c index da8597af..113e9a0b 100644 --- a/utility/dumpRSAPublicKey.c +++ b/utility/dumpRSAPublicKey.c @@ -141,9 +141,15 @@ int main(int argc, char* argv[]) { X509* cert = NULL; RSA* pubkey = NULL; EVP_PKEY* key; + char *progname; if (argc != 3 || (strcmp(argv[1], "-cert") && strcmp(argv[1], "-pub"))) { - fprintf(stderr, "Usage: %s <-cert | -pub> <file>\n", argv[0]); + progname = strrchr(argv[0], '/'); + if (progname) + progname++; + else + progname = argv[0]; + fprintf(stderr, "Usage: %s <-cert | -pub> <file>\n", progname); return -1; } diff --git a/utility/gbb_utility.cc b/utility/gbb_utility.cc index 52135d01..e68bd9b1 100644 --- a/utility/gbb_utility.cc +++ b/utility/gbb_utility.cc @@ -486,6 +486,11 @@ using vboot_reference::GoogleBinaryBlockUtil; // utility function: provide usage of this utility and exit. static void usagehelp_exit(const char *prog_name) { + const char *basename = strrchr(prog_name, '/'); + if (basename) + basename++; + else + basename = prog_name; fprintf(stderr, "Utility to manage Google Binary Block (GBB)\n" "Usage: %s [-g|-s|-c] [OPTIONS] bios_file [output_file]\n" @@ -516,7 +521,7 @@ static void usagehelp_exit(const char *prog_name) { " %s -g bios.bin\n" " %s --set --hwid='New Model' -k key.bin bios.bin newbios.bin\n" " %s -c 0x100,0x1000,0x03DE80,0x1000 gbb.blob\n", - prog_name, prog_name, prog_name, prog_name); + basename, basename, basename, basename); exit(1); } diff --git a/utility/tpmc.c b/utility/tpmc.c index 898e2552..9302dd1e 100644 --- a/utility/tpmc.c +++ b/utility/tpmc.c @@ -412,9 +412,16 @@ command_record command_table[] = { static int n_commands = sizeof(command_table) / sizeof(command_table[0]); int main(int argc, char* argv[]) { + char *progname; + progname = strrchr(argv[0], '/'); + if (progname) + progname++; + else + progname = argv[0]; + if (argc < 2) { fprintf(stderr, "usage: %s <TPM command> [args]\n or: %s help\n", - argv[0], argv[0]); + progname, progname); return OTHER_ERROR; } else { command_record* c; @@ -439,7 +446,7 @@ int main(int argc, char* argv[]) { } /* No command matched. */ - fprintf(stderr, "%s: unknown command: %s\n", argv[0], cmd); + fprintf(stderr, "%s: unknown command: %s\n", progname, cmd); return OTHER_ERROR; } } |