summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@google.com>2017-05-30 14:39:01 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-06-06 23:40:27 +0000
commitf3f89e05b84462a723e32cd098d296a63b5838c7 (patch)
tree8d080a4b6c63e5c7730129c4b817feb11965dc1d
parent2c66cb725b2a94e6832245d4225089006bfc4fbe (diff)
downloadchrome-ec-f3f89e05b84462a723e32cd098d296a63b5838c7.tar.gz
codesigner: accept the new command line option
The upcoming "real" signer update will introduce a version which is not backwards compatible with the existing one wrt the command line flags: the command line flag '-b' will have to be present. To keep the default "dummy" signer in sync let's make it accept and ignore the '-b' command line flag. BRANCH=none BUG=none TEST=verified that the updated signer and the dummy signer both work. Change-Id: Ia8ab6d7ae01d249046f267608b5971a7a7c95e29 Signed-off-by: Vadim Bendebury <vbendeb@google.com> Reviewed-on: https://chromium-review.googlesource.com/517678 Commit-Ready: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> (cherry picked from commit d89eeb6ec8cef355cd5c493c43b71c8dab1930f2) Reviewed-on: https://chromium-review.googlesource.com/526388 Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--Makefile.rules2
-rw-r--r--util/signer/codesigner.cc6
2 files changed, 6 insertions, 2 deletions
diff --git a/Makefile.rules b/Makefile.rules
index d8bfd68bc7..8809037f6b 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -61,7 +61,7 @@ cmd_flat_to_obj = $(CC) -T $(out)/firmware_image.lds -nostdlib $(CPPFLAGS) \
cmd_ec_elf_to_flat ?= $(OBJCOPY) --set-section-flags .roshared=share \
-O binary $< $@
cmd_elf_to_signed ?= sudo $(SIGNER) --key=util/signer/$(3) \
- --input=$< --format=bin --output=$@.signed $(SIGNER_EXTRAS) \
+ --b --input=$< --format=bin --output=$@.signed $(SIGNER_EXTRAS) \
&& sudo chown $(shell whoami) $@.signed && mv $@.signed $@
cmd_elf_to_dis = $(OBJDUMP) -D $< > $@
cmd_elf_to_hex = $(OBJCOPY) -O ihex $< $@
diff --git a/util/signer/codesigner.cc b/util/signer/codesigner.cc
index a2a840509b..f489851ee0 100644
--- a/util/signer/codesigner.cc
+++ b/util/signer/codesigner.cc
@@ -297,6 +297,7 @@ void usage(int argc, char* argv[]) {
"--input=$elf-filename\n"
"--output=output-filename\n"
"--key=$pem-filename\n"
+ "[--b] ignored option, could be included for forward compatibility\n"
"[--cros] to sign for the ChromeOS realm w/o manifest\n"
"[--xml=$xml-filename] typically 'havenTop.xml'\n"
"[--json=$json-filename] the signing manifest\n"
@@ -313,6 +314,7 @@ void usage(int argc, char* argv[]) {
int getOptions(int argc, char* argv[]) {
static struct option long_options[] = {
// name, has_arg
+ {"b", no_argument, NULL, 'b'},
{"cros", no_argument, NULL, 'c'},
{"format", required_argument, NULL, 'f'},
{"help", no_argument, NULL, 'h'},
@@ -330,7 +332,7 @@ int getOptions(int argc, char* argv[]) {
{0, 0, 0, 0}};
int c, option_index = 0;
outputFormat.assign("hex");
- while ((c = getopt_long(argc, argv, "i:o:p:k:x:j:f:s:H:chvr", long_options,
+ while ((c = getopt_long(argc, argv, "i:o:p:k:x:j:f:s:H:bchvr", long_options,
&option_index)) != -1) {
switch (c) {
case 0:
@@ -338,6 +340,8 @@ int getOptions(int argc, char* argv[]) {
if (optarg) fprintf(stderr, " with arg %s", optarg);
fprintf(stderr, "\n");
break;
+ case 'b':
+ break;
case 'c':
FLAGS_cros = true;
break;