futility: make resign_firmwarefd.sh simply invoke futility

Since all of the functionality of the resign_firmwarefd.sh script
is built in to futility, let's just make that script invoke
futility to do the work. We'll come back and remove the script
entirely, once all outside references to it have been changed to
do the right thing.

BUG=chromium:224734
BRANCH=ToT
TEST=make runtests

Also tested by editing tests/futility/test_resign_firmware.sh to
invoke the resign_firmwarefd.sh script instead of futility.
Everything passed.

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Id068e551067a956cd7ddc3f9b9e23488261d8d94
Reviewed-on: https://chromium-review.googlesource.com/216716
Reviewed-by: Randall Spangler <rspangler@chromium.org>
diff --git a/futility/cmd_sign.c b/futility/cmd_sign.c
index f748175..8c59fb2 100644
--- a/futility/cmd_sign.c
+++ b/futility/cmd_sign.c
@@ -40,6 +40,7 @@
 	VbKeyBlockHeader *devkeyblock;
 	uint32_t version;
 	uint32_t flags;
+	int flags_specified;
 	char *loemdir;
 	char *loemid;
 } option = {
@@ -111,7 +112,7 @@
 	case CB_FMAP_VBLOCK_A:
 		fw_body_area = &state->cb_area[CB_FMAP_FW_MAIN_A];
 		/* Preserve the flags if they're not specified */
-		if (!option.flags)
+		if (!option.flags_specified)
 			option.flags = preamble->flags;
 		break;
 	case CB_FMAP_VBLOCK_B:
@@ -129,8 +130,6 @@
 	}
 
 	/* Update the firmware size */
-	fprintf(stderr, "HEY: set FW size from %d to %d\n",
-		fw_body_area->len, fw_size);
 	fw_body_area->len = fw_size;
 
 whatever:
@@ -376,12 +375,14 @@
 			break;
 
 		case 'f':
+			option.flags_specified = 1;
 			option.flags = strtoul(optarg, &e, 0);
 			if (!*optarg || (e && *e)) {
 				fprintf(stderr,
 					"Invalid --flags \"%s\"\n", optarg);
 				errorcnt++;
 			}
+			break;
 		case 'd':
 			option.loemdir = optarg;
 			break;