Merge "releasetools: Group the option descriptions in ota_from_target_files.py."

This commit is contained in:
Treehugger Robot
2018-04-24 00:54:05 +00:00
committed by Gerrit Code Review
2 changed files with 88 additions and 83 deletions

View File

@@ -966,17 +966,18 @@ def ReadApkCerts(tf_zip):
COMMON_DOCSTRING = """ COMMON_DOCSTRING = """
Global options
-p (--path) <dir> -p (--path) <dir>
Prepend <dir>/bin to the list of places to search for binaries Prepend <dir>/bin to the list of places to search for binaries run by this
run by this script, and expect to find jars in <dir>/framework. script, and expect to find jars in <dir>/framework.
-s (--device_specific) <file> -s (--device_specific) <file>
Path to the python module containing device-specific Path to the Python module containing device-specific releasetools code.
releasetools code.
-x (--extra) <key=value> -x (--extra) <key=value>
Add a key/value pair to the 'extras' dict, which device-specific Add a key/value pair to the 'extras' dict, which device-specific extension
extension code may look at. code may look at.
-v (--verbose) -v (--verbose)
Show command lines being executed. Show command lines being executed.

View File

@@ -15,37 +15,78 @@
# limitations under the License. # limitations under the License.
""" """
Given a target-files zipfile, produces an OTA package that installs Given a target-files zipfile, produces an OTA package that installs that build.
that build. An incremental OTA is produced if -i is given, otherwise An incremental OTA is produced if -i is given, otherwise a full OTA is produced.
a full OTA is produced.
Usage: ota_from_target_files [flags] input_target_files output_ota_package Usage: ota_from_target_files [options] input_target_files output_ota_package
-k (--package_key) <key> Key to use to sign the package (default is Common options that apply to both of non-A/B and A/B OTAs
the value of default_system_dev_certificate from the input
target-files's META/misc_info.txt, or --downgrade
"build/target/product/security/testkey" if that value is not Intentionally generate an incremental OTA that updates from a newer build
specified). to an older one (based on timestamp comparison). "post-timestamp" will be
replaced by "ota-downgrade=yes" in the metadata file. A data wipe will
always be enforced, so "ota-wipe=yes" will also be included in the
metadata file. The update-binary in the source build will be used in the
OTA package, unless --binary flag is specified. Please also check the doc
for --override_timestamp below.
-i (--incremental_from) <file>
Generate an incremental OTA using the given target-files zip as the
starting build.
-k (--package_key) <key>
Key to use to sign the package (default is the value of
default_system_dev_certificate from the input target-files's
META/misc_info.txt, or "build/target/product/security/testkey" if that
value is not specified).
For incremental OTAs, the default value is based on the source For incremental OTAs, the default value is based on the source
target-file, not the target build. target-file, not the target build.
-i (--incremental_from) <file> --override_timestamp
Generate an incremental OTA using the given target-files zip as Intentionally generate an incremental OTA that updates from a newer build
the starting build. to an older one (based on timestamp comparison), by overriding the
timestamp in package metadata. This differs from --downgrade flag: we know
for sure this is NOT an actual downgrade case, but two builds are cut in a
reverse order. A legit use case is that we cut a new build C (after having
A and B), but want to enfore an update path of A -> C -> B. Specifying
--downgrade may not help since that would enforce a data wipe for C -> B
update. The value of "post-timestamp" will be set to the newer timestamp
plus one, so that the package can be pushed and applied.
--full_radio --wipe_user_data
When generating an incremental OTA, always include a full copy of Generate an OTA package that will wipe the user data partition when
radio image. This option is only meaningful when -i is specified, installed.
because a full radio is always included in a full OTA if applicable.
Non-A/B OTA specific options
-b (--binary) <file>
Use the given binary as the update-binary in the output package, instead
of the binary in the build's target_files. Use for development only.
--block
Generate a block-based OTA for non-A/B device. We have deprecated the
support for file-based OTA since O. Block-based OTA will be used by
default for all non-A/B devices. Keeping this flag here to not break
existing callers.
-e (--extra_script) <file>
Insert the contents of file at the end of the update script.
--full_bootloader --full_bootloader
Similar to --full_radio. When generating an incremental OTA, always Similar to --full_radio. When generating an incremental OTA, always
include a full copy of bootloader image. include a full copy of bootloader image.
--verify --full_radio
Remount and verify the checksums of the files written to the system and When generating an incremental OTA, always include a full copy of radio
vendor (if used) partitions. Non-A/B incremental OTAs only. image. This option is only meaningful when -i is specified, because a full
radio is always included in a full OTA if applicable.
--log_diff <file>
Generate a log file that shows the differences in the source and target
builds for an incremental package. This option is only meaningful when -i
is specified.
-o (--oem_settings) <main_file[,additional_files...]> -o (--oem_settings) <main_file[,additional_files...]>
Comma seperated list of files used to specify the expected OEM-specific Comma seperated list of files used to specify the expected OEM-specific
@@ -55,42 +96,29 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
OEM-specific properties. OEM-specific properties.
--oem_no_mount --oem_no_mount
For devices with OEM-specific properties but without an OEM partition, For devices with OEM-specific properties but without an OEM partition, do
do not mount the OEM partition in the updater-script. This should be not mount the OEM partition in the updater-script. This should be very
very rarely used, since it's expected to have a dedicated OEM partition rarely used, since it's expected to have a dedicated OEM partition for
for OEM-specific properties. Only meaningful when -o is specified. OEM-specific properties. Only meaningful when -o is specified.
--wipe_user_data --stash_threshold <float>
Generate an OTA package that will wipe the user data partition Specify the threshold that will be used to compute the maximum allowed
when installed. stash size (defaults to 0.8).
--downgrade -t (--worker_threads) <int>
Intentionally generate an incremental OTA that updates from a newer Specify the number of worker-threads that will be used when generating
build to an older one (based on timestamp comparison). "post-timestamp" patches for incremental updates (defaults to 3).
will be replaced by "ota-downgrade=yes" in the metadata file. A data
wipe will always be enforced, so "ota-wipe=yes" will also be included in
the metadata file. The update-binary in the source build will be used in
the OTA package, unless --binary flag is specified. Please also check the
doc for --override_timestamp below.
--override_timestamp --verify
Intentionally generate an incremental OTA that updates from a newer Verify the checksums of the updated system and vendor (if any) partitions.
build to an older one (based on timestamp comparison), by overriding the Non-A/B incremental OTAs only.
timestamp in package metadata. This differs from --downgrade flag: we
know for sure this is NOT an actual downgrade case, but two builds are
cut in a reverse order. A legit use case is that we cut a new build C
(after having A and B), but want to enfore an update path of A -> C -> B.
Specifying --downgrade may not help since that would enforce a data wipe
for C -> B update. The value of "post-timestamp" will be set to the newer
timestamp plus one, so that the package can be pushed and applied.
-e (--extra_script) <file>
Insert the contents of file at the end of the update script.
-2 (--two_step) -2 (--two_step)
Generate a 'two-step' OTA package, where recovery is updated Generate a 'two-step' OTA package, where recovery is updated first, so
first, so that any changes made to the system partition are done that any changes made to the system partition are done using the new
using the new recovery (new kernel, etc.). recovery (new kernel, etc.).
A/B OTA specific options
--include_secondary --include_secondary
Additionally include the payload for secondary slot images (default: Additionally include the payload for secondary slot images (default:
@@ -110,30 +138,6 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
Due to the special install procedure, the secondary payload will be always Due to the special install procedure, the secondary payload will be always
generated as a full payload. generated as a full payload.
--block
Generate a block-based OTA for non-A/B device. We have deprecated the
support for file-based OTA since O. Block-based OTA will be used by
default for all non-A/B devices. Keeping this flag here to not break
existing callers.
-b (--binary) <file>
Use the given binary as the update-binary in the output package,
instead of the binary in the build's target_files. Use for
development only.
-t (--worker_threads) <int>
Specifies the number of worker-threads that will be used when
generating patches for incremental updates (defaults to 3).
--stash_threshold <float>
Specifies the threshold that will be used to compute the maximum
allowed stash size (defaults to 0.8).
--log_diff <file>
Generate a log file that shows the differences in the source and target
builds for an incremental package. This option is only meaningful when
-i is specified.
--payload_signer <signer> --payload_signer <signer>
Specify the signer when signing the payload and metadata for A/B OTAs. Specify the signer when signing the payload and metadata for A/B OTAs.
By default (i.e. without this flag), it calls 'openssl pkeyutl' to sign By default (i.e. without this flag), it calls 'openssl pkeyutl' to sign