History log of /external/vboot_reference/futility/cmd_sign.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1eae873b6194db25781233d7a4aaee6a34160eec 05-Feb-2015 Bill Richardson <wfrichar@chromium.org> futility: Add global args to specify vboot API and format

The host-side futility tool will need to support all extant vboot
implementations. Some legacy futility commands only support the
original vb1 format, but others ("show" or "sign", for example)
may need to be instructed which formats to expect or emit.

This change adds some global args to specify the preferred
formats. It also cleans up a few [unused AFAICT] one-letter args
to avoid conflicts.

BUG=chromium:231574
BRANCH=none
TEST=make runtests

Nothing makes use of this yet, except the "help" command.

Change-Id: Ib79fa12af72b8860b9494e5d9e90b9572c006107
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/246765
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
80e779d50b52cd97c9d5896a3b75fa8118ee488f 04-Feb-2015 Furquan Shaikh <furquan@google.com> kernel flags: Add flags field to kernel preamble.

1. Increase kernel preamble revision from 2.1 to 2.2.
2. Add flags field to kernel preamble.
3. Update futility to accept flags parameter for vbutil_kernel and
cmd_sign for kernel.
4. Pass in an extra flags field to SignKernelBlob and
CreateKernelPreamble.

BUG=chrome-os-partner:35861
BRANCH=None
TEST=1) "make runalltests" completes successfully. 2) vboot_reference
compiles successfully for ryu. 3) Verified flags field in header using
futility show.

Change-Id: If9f06f98778a7339194c77090cbef4807d5e34e2
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/245950
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
2559338dbdacbcbd3ae426337403196135bbc7e8 30-Jan-2015 Bill Richardson <wfrichar@chromium.org> futility: refactor file type detection into new files

This moves the what-kind-of-file-is-this logic into a separate
file, and makes it work by calling distinct recognizers until one
hits. A new "-t" option to the show command prints what it's
doing.

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

Change-Id: Id8f60bdf3fe6a9adf41b4555b3448a261fa52fea
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/245122
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
b406c1064b3a37002b3d4d953a4932628408f25b 03-Dec-2014 Bill Richardson <wfrichar@chromium.org> futility: Don't copy the entire kernel partition just to sign a blob

When re-signing a kernel partition and writing the result into a
new file, make sure we only emit the vblock and kernel blob
instead of creating a new file that's the size of the entire
partition.

Also add a test for that.

BUG=chromium:418647
BRANCH=none
TEST=make runtests

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I2c42aec6816e7e7abbeed360089c9b51fdcfe786
Reviewed-on: https://chromium-review.googlesource.com/233039
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
c540f59be047d69251b7f9ce0637a8a0c6fe150f 24-Sep-2014 Bill Richardson <wfrichar@chromium.org> futility: Allow signing raw firmware blob and keyblocks

BUG=none
BRANCH=ToT
TEST=make runtests

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Ib1cf55301fd4c54e3280ef01b7d67a780e7e56fe
Reviewed-on: https://chromium-review.googlesource.com/219731
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
5f2696d2ff09d7c9c5c6125e9f0a62e56e54e0b8 24-Sep-2014 Bill Richardson <wfrichar@chromium.org> futility: Add support for [re]signing kernel partitions

BUG=none
BRANCH=ToT
TEST=make runtests

This also modifies the tests to compare the futility sign command
results against the vbutil_kernel results.

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Ibc659f134cc83982e3f0c0bcc108cc0eddbe228e
Reviewed-on: https://chromium-review.googlesource.com/219730
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
b0f1cc5e22e87a3ef1655643116991673dd1b531 24-Sep-2014 Bill Richardson <wfrichar@chromium.org> futility: do traversal of a buffer, not a file

We have been traversing things by passing a file descriptor. Now
the caller should mmap the file first. This will allow the caller
to determine the file type before traversing into it, so we can
check args.

BUG=none
BRANCH=ToT
TEST=make runtests

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: If69799bde0133689dc9fb5111e6ecb5ac61639c7
Reviewed-on: https://chromium-review.googlesource.com/219649
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
e192e7f6cea5f2c4556b729bf57ef1f552e0242a 23-Sep-2014 Bill Richardson <wfrichar@chromium.org> futility: clean up a few shared functions

Move the Debug() function into a common place instead of several
copies in different files, rename shared functions to start with
"futil_"

BUG=none
BRANCH=ToT
TEST=make runtests

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I6b844553dff95c24894dae611102716a8da5312d
Reviewed-on: https://chromium-review.googlesource.com/219645
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
779796f57e1e0236ea502248ede2cbea986fca21 23-Sep-2014 Bill Richardson <wfrichar@chromium.org> futility: Improve help messages

This provides help messages for the futility commands similar to
the way git does. These show the available commands:

futility
futility help
futility --help

While these show help for a specific command:

futility help COMMAND
futility --help COMMAND
futility COMMAND --help

BUG=none
BRANCH=ToT
TEST=manual

make runtests

And manually look at help messages for each command.

Change-Id: I1126471e242784c6ca7a2f11694fa7c505d833e8
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/219528
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
a19b00dfd0c17681b71bd61994854dff3f3576a3 05-Sep-2014 Bill Richardson <wfrichar@chromium.org> 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>
/external/vboot_reference/futility/cmd_sign.c
08efd1ee358c546c968918a24b45219d7003ceca 05-Sep-2014 Bill Richardson <wfrichar@chromium.org> futility: preserve preamble flags when resigning BIOS images

If we're re-signing a valid BIOS image, we want to be sure that
we preserve the original firmware preamble flags (RO_NORMAL and
so forth) if the --flags option does not specifically override
it.

This change adds a test for that case, and makes it happen.

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

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I8cbde66abaf96ec82adf0205bedf57b1fd1b82a1
Reviewed-on: https://chromium-review.googlesource.com/216714
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
e051975c900caf43046a97cda682629915c62c7e 03-Sep-2014 Bill Richardson <wfrichar@chromium.org> futility: sign command works on unsigned images

This allows the sign command to work on BIOS images with
invalid VBLOCK areas. When re-signing an existing image, the
length of the firmware body is part of the firmware preamble
in the VBLOCK areas. If those are invalid, the BIOS can
still be signed, but it will have to sign the entire FW_MAIN
area. That's a little slower to verify, so we'd prefer not
to do that, but it works.

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

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: If58b5c86c5df12f004eabff72c22bfb1e84de7fd
Reviewed-on: https://chromium-review.googlesource.com/216229
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c
15dc6fc5eabc1b1756aca1dbed38cb9d26259bf2 02-Sep-2014 Bill Richardson <wfrichar@chromium.org> futility: add "sign" command to resign firmware images

The "sign" command can perform the same operation as the old
resign_firmwarefd.sh script, only about 20 times faster. The
test for that will use the new command instead.

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

Change-Id: Ie7f7a0ab6fc00d7e06cb263733bf6e7246fdb023
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/216227
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/futility/cmd_sign.c