diff options
author | Kenny Root <kroot@google.com> | 2012-04-08 10:42:34 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2012-04-09 14:59:04 -0700 |
commit | f32dc71e49656e16fc8e178f7436706a47e8af52 (patch) | |
tree | e4fbc6e4ebf445499d418228c3c46ace81865ce5 /tools/releasetools | |
parent | 135c3af45af3d18ebda5aa9f66562191f3da55a1 (diff) | |
parent | a86fcc2980caa4ef7701d73610deba3ab94c984e (diff) | |
download | build-f32dc71e49656e16fc8e178f7436706a47e8af52.zip build-f32dc71e49656e16fc8e178f7436706a47e8af52.tar.gz build-f32dc71e49656e16fc8e178f7436706a47e8af52.tar.bz2 |
resolved conflicts for merge of a86fcc29 to master
Change-Id: I3868c19bfd309b5b43b5642152a120931fe37315
Diffstat (limited to 'tools/releasetools')
-rwxr-xr-x | tools/releasetools/build_image.py | 6 | ||||
-rw-r--r-- | tools/releasetools/edify_generator.py | 4 | ||||
-rwxr-xr-x | tools/releasetools/ota_from_target_files | 15 |
3 files changed, 20 insertions, 5 deletions
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py index 15acddc..a615d1a 100755 --- a/tools/releasetools/build_image.py +++ b/tools/releasetools/build_image.py @@ -46,12 +46,17 @@ def BuildImage(in_dir, prop_dict, out_file): prop_dict["mount_point"]]) if "partition_size" in prop_dict: build_command.append(prop_dict["partition_size"]) + if "selinux_fc" in prop_dict: + build_command.append(prop_dict["selinux_fc"]) else: build_command = ["mkyaffs2image", "-f"] if prop_dict.get("mkyaffs2_extra_flags", None): build_command.extend(prop_dict["mkyaffs2_extra_flags"].split()) build_command.append(in_dir) build_command.append(out_file) + if "selinux_fc" in prop_dict: + build_command.append(prop_dict["selinux_fc"]) + build_command.append(prop_dict["mount_point"]) print "Running: ", " ".join(build_command) p = subprocess.Popen(build_command); @@ -75,6 +80,7 @@ def ImagePropFromGlobalDict(glob_dict, mount_point): common_props = ( "extfs_sparse_flag", "mkyaffs2_extra_flags", + "selinux_fc", ) for p in common_props: copy_prop(p, p) diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py index 8c31927..5672b5a 100644 --- a/tools/releasetools/edify_generator.py +++ b/tools/releasetools/edify_generator.py @@ -165,9 +165,9 @@ class EdifyGenerator(object): fstab = self.info.get("fstab", None) if fstab: p = fstab[partition] - self.script.append('format("%s", "%s", "%s", "%s");' % + self.script.append('format("%s", "%s", "%s", "%s", "%s");' % (p.fs_type, common.PARTITION_TYPES[p.fs_type], - p.device, p.length)) + p.device, p.length, p.mount_point)) def DeleteFiles(self, file_list): """Delete all files in file_list.""" diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files index 7e855ce..3dcfbee 100755 --- a/tools/releasetools/ota_from_target_files +++ b/tools/releasetools/ota_from_target_files @@ -48,6 +48,10 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package -e (--extra_script) <file> Insert the contents of file at the end of the update script. + + -a (--aslr_mode) <on|off> + Specify whether to turn on ASLR for the package (on by default). + """ import sys @@ -381,6 +385,9 @@ def WriteFullOTAPackage(input_zip, output_zip): if OPTIONS.wipe_user_data: script.FormatPartition("/data") + if "selinux_fc" in OPTIONS.info_dict: + WritePolicyConfig(OPTIONS.info_dict["selinux_fc"], output_zip) + script.FormatPartition("/system") script.Mount("/system") script.UnpackPackageDir("recovery", "/system") @@ -415,15 +422,17 @@ def WriteFullOTAPackage(input_zip, output_zip): script.AddToZip(input_zip, output_zip) WriteMetadata(metadata, output_zip) +def WritePolicyConfig(file_context, output_zip): + f = open(file_context, 'r'); + basename = os.path.basename(file_context) + common.ZipWriteStr(output_zip, basename, f.read()) + def WriteMetadata(metadata, output_zip): common.ZipWriteStr(output_zip, "META-INF/com/android/metadata", "".join(["%s=%s\n" % kv for kv in sorted(metadata.iteritems())])) - - - def LoadSystemFiles(z): """Load all the files from SYSTEM/... in a given target-files ZipFile, and return a dict of {filename: File object}.""" |