forked from openkylin/platform_build
Turn on ASLR by default. The "-a" option now takes an argument (on/off).
Change-Id: I4ddc70f2087c23586fc6aaaff3bb862f83d9779d
This commit is contained in:
parent
920e102d79
commit
dafb042755
|
@ -44,8 +44,8 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
|
||||||
-e (--extra_script) <file>
|
-e (--extra_script) <file>
|
||||||
Insert the contents of file at the end of the update script.
|
Insert the contents of file at the end of the update script.
|
||||||
|
|
||||||
-a (--use_aslr)
|
-a (--aslr_mode) <on|off>
|
||||||
Specify whether to build the package with ASLR enabled (off by default).
|
Specify whether to turn on ASLR for the package (on by default).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
@ -77,7 +77,7 @@ OPTIONS.patch_threshold = 0.95
|
||||||
OPTIONS.wipe_user_data = False
|
OPTIONS.wipe_user_data = False
|
||||||
OPTIONS.omit_prereq = False
|
OPTIONS.omit_prereq = False
|
||||||
OPTIONS.extra_script = None
|
OPTIONS.extra_script = None
|
||||||
OPTIONS.aslr_mode = False
|
OPTIONS.aslr_mode = True
|
||||||
OPTIONS.worker_threads = 3
|
OPTIONS.worker_threads = 3
|
||||||
|
|
||||||
def MostPopularKey(d, default):
|
def MostPopularKey(d, default):
|
||||||
|
@ -867,8 +867,11 @@ def main(argv):
|
||||||
OPTIONS.omit_prereq = True
|
OPTIONS.omit_prereq = True
|
||||||
elif o in ("-e", "--extra_script"):
|
elif o in ("-e", "--extra_script"):
|
||||||
OPTIONS.extra_script = a
|
OPTIONS.extra_script = a
|
||||||
elif o in ("-a", "--use_aslr"):
|
elif o in ("-a", "--aslr_mode"):
|
||||||
OPTIONS.aslr_mode = True
|
if a in ("on", "On", "true", "True", "yes", "Yes"):
|
||||||
|
OPTIONS.aslr_mode = True
|
||||||
|
else:
|
||||||
|
OPTIONS.aslr_mode = False
|
||||||
elif o in ("--worker_threads"):
|
elif o in ("--worker_threads"):
|
||||||
OPTIONS.worker_threads = int(a)
|
OPTIONS.worker_threads = int(a)
|
||||||
else:
|
else:
|
||||||
|
@ -876,7 +879,7 @@ def main(argv):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
args = common.ParseOptions(argv, __doc__,
|
args = common.ParseOptions(argv, __doc__,
|
||||||
extra_opts="b:k:i:d:wne:a",
|
extra_opts="b:k:i:d:wne:a:",
|
||||||
extra_long_opts=["board_config=",
|
extra_long_opts=["board_config=",
|
||||||
"package_key=",
|
"package_key=",
|
||||||
"incremental_from=",
|
"incremental_from=",
|
||||||
|
@ -884,7 +887,7 @@ def main(argv):
|
||||||
"no_prereq",
|
"no_prereq",
|
||||||
"extra_script=",
|
"extra_script=",
|
||||||
"worker_threads=",
|
"worker_threads=",
|
||||||
"use_aslr"],
|
"aslr_mode="],
|
||||||
extra_option_handler=option_handler)
|
extra_option_handler=option_handler)
|
||||||
|
|
||||||
if len(args) != 2:
|
if len(args) != 2:
|
||||||
|
|
Loading…
Reference in New Issue