Loading tools/releasetools/add_img_to_target_files.py +34 −5 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,31 @@ Given a target-files zipfile that does not contain images (ie, does not have an IMAGES/ top-level subdirectory), produce the images and not have an IMAGES/ top-level subdirectory), produce the images and add them to the zipfile. add them to the zipfile. Usage: add_img_to_target_files target_files Usage: add_img_to_target_files [flag] target_files -a (--add_missing) Build and add missing images to "IMAGES/". If this option is not specified, this script will simply exit when "IMAGES/" directory exists in the target file. -r (--rebuild_recovery) Rebuild the recovery patch and write it to the system image. Only meaningful when system image needs to be rebuilt. --replace_verity_private_key Replace the private key used for verity signing. (same as the option in sign_target_files_apks) --replace_verity_public_key Replace the certificate (public key) used for verity verification. (same as the option in sign_target_files_apks) --is_signing Skip building & adding the images for "userdata" and "cache" if we are signing the target files. --verity_signer_path Specify the signer path to build verity metadata. """ """ import sys import sys Loading @@ -46,6 +70,7 @@ OPTIONS.add_missing = False OPTIONS.rebuild_recovery = False OPTIONS.rebuild_recovery = False OPTIONS.replace_verity_public_key = False OPTIONS.replace_verity_public_key = False OPTIONS.replace_verity_private_key = False OPTIONS.replace_verity_private_key = False OPTIONS.is_signing = False OPTIONS.verity_signer_path = None OPTIONS.verity_signer_path = None def AddSystem(output_zip, prefix="IMAGES/", recovery_img=None, boot_img=None): def AddSystem(output_zip, prefix="IMAGES/", recovery_img=None, boot_img=None): Loading Loading @@ -386,6 +411,7 @@ def AddImagesToTargetFiles(filename): if has_vendor: if has_vendor: banner("vendor") banner("vendor") AddVendor(output_zip) AddVendor(output_zip) if not OPTIONS.is_signing: banner("userdata") banner("userdata") AddUserdata(output_zip) AddUserdata(output_zip) banner("cache") banner("cache") Loading Loading @@ -438,6 +464,8 @@ def main(argv): OPTIONS.replace_verity_private_key = (True, a) OPTIONS.replace_verity_private_key = (True, a) elif o == "--replace_verity_public_key": elif o == "--replace_verity_public_key": OPTIONS.replace_verity_public_key = (True, a) OPTIONS.replace_verity_public_key = (True, a) elif o == "--is_signing": OPTIONS.is_signing = True elif o == "--verity_signer_path": elif o == "--verity_signer_path": OPTIONS.verity_signer_path = a OPTIONS.verity_signer_path = a else: else: Loading @@ -449,6 +477,7 @@ def main(argv): extra_long_opts=["add_missing", "rebuild_recovery", extra_long_opts=["add_missing", "rebuild_recovery", "replace_verity_public_key=", "replace_verity_public_key=", "replace_verity_private_key=", "replace_verity_private_key=", "is_signing", "verity_signer_path="], "verity_signer_path="], extra_option_handler=option_handler) extra_option_handler=option_handler) Loading tools/releasetools/sign_target_files_apks.py +3 −1 Original line number Original line Diff line number Diff line Loading @@ -713,7 +713,9 @@ def main(argv): common.ZipClose(input_zip) common.ZipClose(input_zip) common.ZipClose(output_zip) common.ZipClose(output_zip) add_img_to_target_files.AddImagesToTargetFiles(args[1]) # Skip building userdata.img and cache.img when signing the target files. new_args = ["--is_signing", args[1]] add_img_to_target_files.main(new_args) print "done." print "done." Loading Loading
tools/releasetools/add_img_to_target_files.py +34 −5 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,31 @@ Given a target-files zipfile that does not contain images (ie, does not have an IMAGES/ top-level subdirectory), produce the images and not have an IMAGES/ top-level subdirectory), produce the images and add them to the zipfile. add them to the zipfile. Usage: add_img_to_target_files target_files Usage: add_img_to_target_files [flag] target_files -a (--add_missing) Build and add missing images to "IMAGES/". If this option is not specified, this script will simply exit when "IMAGES/" directory exists in the target file. -r (--rebuild_recovery) Rebuild the recovery patch and write it to the system image. Only meaningful when system image needs to be rebuilt. --replace_verity_private_key Replace the private key used for verity signing. (same as the option in sign_target_files_apks) --replace_verity_public_key Replace the certificate (public key) used for verity verification. (same as the option in sign_target_files_apks) --is_signing Skip building & adding the images for "userdata" and "cache" if we are signing the target files. --verity_signer_path Specify the signer path to build verity metadata. """ """ import sys import sys Loading @@ -46,6 +70,7 @@ OPTIONS.add_missing = False OPTIONS.rebuild_recovery = False OPTIONS.rebuild_recovery = False OPTIONS.replace_verity_public_key = False OPTIONS.replace_verity_public_key = False OPTIONS.replace_verity_private_key = False OPTIONS.replace_verity_private_key = False OPTIONS.is_signing = False OPTIONS.verity_signer_path = None OPTIONS.verity_signer_path = None def AddSystem(output_zip, prefix="IMAGES/", recovery_img=None, boot_img=None): def AddSystem(output_zip, prefix="IMAGES/", recovery_img=None, boot_img=None): Loading Loading @@ -386,6 +411,7 @@ def AddImagesToTargetFiles(filename): if has_vendor: if has_vendor: banner("vendor") banner("vendor") AddVendor(output_zip) AddVendor(output_zip) if not OPTIONS.is_signing: banner("userdata") banner("userdata") AddUserdata(output_zip) AddUserdata(output_zip) banner("cache") banner("cache") Loading Loading @@ -438,6 +464,8 @@ def main(argv): OPTIONS.replace_verity_private_key = (True, a) OPTIONS.replace_verity_private_key = (True, a) elif o == "--replace_verity_public_key": elif o == "--replace_verity_public_key": OPTIONS.replace_verity_public_key = (True, a) OPTIONS.replace_verity_public_key = (True, a) elif o == "--is_signing": OPTIONS.is_signing = True elif o == "--verity_signer_path": elif o == "--verity_signer_path": OPTIONS.verity_signer_path = a OPTIONS.verity_signer_path = a else: else: Loading @@ -449,6 +477,7 @@ def main(argv): extra_long_opts=["add_missing", "rebuild_recovery", extra_long_opts=["add_missing", "rebuild_recovery", "replace_verity_public_key=", "replace_verity_public_key=", "replace_verity_private_key=", "replace_verity_private_key=", "is_signing", "verity_signer_path="], "verity_signer_path="], extra_option_handler=option_handler) extra_option_handler=option_handler) Loading
tools/releasetools/sign_target_files_apks.py +3 −1 Original line number Original line Diff line number Diff line Loading @@ -713,7 +713,9 @@ def main(argv): common.ZipClose(input_zip) common.ZipClose(input_zip) common.ZipClose(output_zip) common.ZipClose(output_zip) add_img_to_target_files.AddImagesToTargetFiles(args[1]) # Skip building userdata.img and cache.img when signing the target files. new_args = ["--is_signing", args[1]] add_img_to_target_files.main(new_args) print "done." print "done." Loading