Merge change 488 into donut
* changes: add -n option to turn off prereq check when build OTA packages
This commit is contained in:
@@ -37,6 +37,11 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
|
|||||||
Generate an OTA package that will wipe the user data partition
|
Generate an OTA package that will wipe the user data partition
|
||||||
when installed.
|
when installed.
|
||||||
|
|
||||||
|
-n (--no_prereq)
|
||||||
|
Omit the timestamp prereq check normally included at the top of
|
||||||
|
the build scripts (used for developer OTA packages which
|
||||||
|
legitimately need to go back and forth).
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@@ -63,6 +68,7 @@ OPTIONS.require_verbatim = set()
|
|||||||
OPTIONS.prohibit_verbatim = set(("system/build.prop",))
|
OPTIONS.prohibit_verbatim = set(("system/build.prop",))
|
||||||
OPTIONS.patch_threshold = 0.95
|
OPTIONS.patch_threshold = 0.95
|
||||||
OPTIONS.wipe_user_data = False
|
OPTIONS.wipe_user_data = False
|
||||||
|
OPTIONS.omit_prereq = False
|
||||||
|
|
||||||
def MostPopularKey(d, default):
|
def MostPopularKey(d, default):
|
||||||
"""Given a dict, return the key corresponding to the largest
|
"""Given a dict, return the key corresponding to the largest
|
||||||
@@ -323,9 +329,10 @@ def IncludeBinary(name, input_zip, output_zip):
|
|||||||
def WriteFullOTAPackage(input_zip, output_zip):
|
def WriteFullOTAPackage(input_zip, output_zip):
|
||||||
script = []
|
script = []
|
||||||
|
|
||||||
ts = GetBuildProp("ro.build.date.utc", input_zip)
|
if not OPTIONS.omit_prereq:
|
||||||
script.append("run_program PACKAGE:check_prereq %s" % (ts,))
|
ts = GetBuildProp("ro.build.date.utc", input_zip)
|
||||||
IncludeBinary("check_prereq", input_zip, output_zip)
|
script.append("run_program PACKAGE:check_prereq %s" % (ts,))
|
||||||
|
IncludeBinary("check_prereq", input_zip, output_zip)
|
||||||
|
|
||||||
AppendAssertions(script, input_zip)
|
AppendAssertions(script, input_zip)
|
||||||
|
|
||||||
@@ -619,16 +626,19 @@ def main(argv):
|
|||||||
OPTIONS.incremental_source = a
|
OPTIONS.incremental_source = a
|
||||||
elif o in ("-w", "--wipe_user_data"):
|
elif o in ("-w", "--wipe_user_data"):
|
||||||
OPTIONS.wipe_user_data = True
|
OPTIONS.wipe_user_data = True
|
||||||
|
elif o in ("-n", "--no_prereq"):
|
||||||
|
OPTIONS.omit_prereq = True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
args = common.ParseOptions(argv, __doc__,
|
args = common.ParseOptions(argv, __doc__,
|
||||||
extra_opts="b:k:i:d:w",
|
extra_opts="b:k:i:d:wn",
|
||||||
extra_long_opts=["board_config=",
|
extra_long_opts=["board_config=",
|
||||||
"package_key=",
|
"package_key=",
|
||||||
"incremental_from=",
|
"incremental_from=",
|
||||||
"wipe_user_data"],
|
"wipe_user_data",
|
||||||
|
"no_prereq"],
|
||||||
extra_option_handler=option_handler)
|
extra_option_handler=option_handler)
|
||||||
|
|
||||||
if len(args) != 2:
|
if len(args) != 2:
|
||||||
|
Reference in New Issue
Block a user