resolved conflicts for merge of a86fcc29 to master

Change-Id: I3868c19bfd309b5b43b5642152a120931fe37315
This commit is contained in:
Kenny Root
2012-04-08 10:42:34 -07:00
4 changed files with 31 additions and 11 deletions

View File

@@ -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)

View File

@@ -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."""

View File

@@ -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}."""