diff options
author | Baligh Uddin <baligh@google.com> | 2015-09-16 21:20:30 -0700 |
---|---|---|
committer | Baligh Uddin <baligh@google.com> | 2015-09-16 21:20:30 -0700 |
commit | 59f4ff109d7da6d608cb6b1248a4403b13d8b2bc (patch) | |
tree | 6ccb49b8644a886f356844440dda2c1d9f594f38 | |
parent | ca352f3623ed6e3afb1c70b1daedaa29ec3b73a5 (diff) | |
download | build-59f4ff109d7da6d608cb6b1248a4403b13d8b2bc.zip build-59f4ff109d7da6d608cb6b1248a4403b13d8b2bc.tar.gz build-59f4ff109d7da6d608cb6b1248a4403b13d8b2bc.tar.bz2 |
Add verity_signer and verity_key flags to add_img_to_target_files.
The signing process requires the boot and recovery images be signed
by CROS-Signer, which is done after a signed_target_files.zip is
available. Once the boot/recovery images are signed, we need
to insert it back into signed_target_files.zip and regenerate the
system.map and verity tree. The script (add_img_to_target_files) does
this operation and needs to be aware of verity specific flags.
Bug: 23831896
Change-Id: Id24e878161052c768b74da1231b97eb0574b4c8b
-rwxr-xr-x | tools/releasetools/add_img_to_target_files.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py index eab8113..f7332b2 100755 --- a/tools/releasetools/add_img_to_target_files.py +++ b/tools/releasetools/add_img_to_target_files.py @@ -40,6 +40,9 @@ OPTIONS = common.OPTIONS OPTIONS.add_missing = False OPTIONS.rebuild_recovery = False +OPTIONS.replace_verity_public_key = False +OPTIONS.replace_verity_private_key = False +OPTIONS.verity_signer_path = None def AddSystem(output_zip, prefix="IMAGES/", recovery_img=None, boot_img=None): """Turn the contents of SYSTEM into a system image and store it in @@ -296,18 +299,27 @@ def AddImagesToTargetFiles(filename): common.ZipClose(output_zip) def main(argv): - def option_handler(o, _): + def option_handler(o, a): if o in ("-a", "--add_missing"): OPTIONS.add_missing = True elif o in ("-r", "--rebuild_recovery",): OPTIONS.rebuild_recovery = True + elif o == "--replace_verity_private_key": + OPTIONS.replace_verity_private_key = (True, a) + elif o == "--replace_verity_public_key": + OPTIONS.replace_verity_public_key = (True, a) + elif o == "--verity_signer_path": + OPTIONS.verity_signer_path = a else: return False return True args = common.ParseOptions( argv, __doc__, extra_opts="ar", - extra_long_opts=["add_missing", "rebuild_recovery"], + extra_long_opts=["add_missing", "rebuild_recovery", + "replace_verity_public_key=", + "replace_verity_private_key=", + "verity_signer_path="], extra_option_handler=option_handler) |