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

@@ -347,9 +347,13 @@ INTERNAL_RAMDISK_FILES := $(filter $(TARGET_ROOT_OUT)/%, \
BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img
ifeq ($(HAVE_SELINUX),true)
SELINUX_DEPENDS := sepolicy file_contexts seapp_contexts
endif
# We just build this directly to the install location. # We just build this directly to the install location.
INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET) INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET)
$(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES) | $(MINIGZIP) $(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES) $(SELINUX_DEPENDS) | $(MINIGZIP)
$(call pretty,"Target ram disk: $@") $(call pretty,"Target ram disk: $@")
$(hide) $(MKBOOTFS) $(TARGET_ROOT_OUT) | $(MINIGZIP) > $@ $(hide) $(MKBOOTFS) $(TARGET_ROOT_OUT) | $(MINIGZIP) > $@
@@ -558,6 +562,7 @@ $(if $(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "cache_fs_type=$(BOARD_CA
$(if $(BOARD_CACHEIMAGE_PARTITION_SIZE),$(hide) echo "cache_size=$(BOARD_CACHEIMAGE_PARTITION_SIZE)" >> $(1)) $(if $(BOARD_CACHEIMAGE_PARTITION_SIZE),$(hide) echo "cache_size=$(BOARD_CACHEIMAGE_PARTITION_SIZE)" >> $(1))
$(if $(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG),$(hide) echo "extfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG)" >> $(1)) $(if $(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG),$(hide) echo "extfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG)" >> $(1))
$(if $(mkyaffs2_extra_flags),$(hide) echo "mkyaffs2_extra_flags=$(mkyaffs2_extra_flags)" >> $(1)) $(if $(mkyaffs2_extra_flags),$(hide) echo "mkyaffs2_extra_flags=$(mkyaffs2_extra_flags)" >> $(1))
$(if $(filter true, $(strip $(HAVE_SELINUX))), echo "selinux_fc=$(TARGET_ROOT_OUT)/file_contexts" >> $(1))
endef endef
# ----------------------------------------------------------------- # -----------------------------------------------------------------
@@ -695,7 +700,7 @@ ifdef is_tests_build
# $(tests_MODULES)) # $(tests_MODULES))
endif endif
FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS) FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS) $(SELINUX_DEPENDS)
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# installed file list # installed file list
# Depending on anything that $(BUILT_SYSTEMIMAGE) depends on. # Depending on anything that $(BUILT_SYSTEMIMAGE) depends on.
@@ -1130,7 +1135,7 @@ INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
$(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) $(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR)
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS) $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS) $(SELINUX_DEPENDS)
@echo "Package OTA: $@" @echo "Package OTA: $@"
$(hide) ./build/tools/releasetools/ota_from_target_files -v \ $(hide) ./build/tools/releasetools/ota_from_target_files -v \
-p $(HOST_OUT) \ -p $(HOST_OUT) \
@@ -1158,7 +1163,7 @@ else
$(INTERNAL_UPDATE_PACKAGE_TARGET): extensions := $(TARGET_RELEASETOOLS_EXTENSIONS) $(INTERNAL_UPDATE_PACKAGE_TARGET): extensions := $(TARGET_RELEASETOOLS_EXTENSIONS)
endif endif
$(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS) $(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS) $(SELINUX_DEPENDS)
@echo "Package: $@" @echo "Package: $@"
$(hide) ./build/tools/releasetools/img_from_target_files -v \ $(hide) ./build/tools/releasetools/img_from_target_files -v \
-s $(extensions) \ -s $(extensions) \

View File

@@ -46,12 +46,17 @@ def BuildImage(in_dir, prop_dict, out_file):
prop_dict["mount_point"]]) prop_dict["mount_point"]])
if "partition_size" in prop_dict: if "partition_size" in prop_dict:
build_command.append(prop_dict["partition_size"]) build_command.append(prop_dict["partition_size"])
if "selinux_fc" in prop_dict:
build_command.append(prop_dict["selinux_fc"])
else: else:
build_command = ["mkyaffs2image", "-f"] build_command = ["mkyaffs2image", "-f"]
if prop_dict.get("mkyaffs2_extra_flags", None): if prop_dict.get("mkyaffs2_extra_flags", None):
build_command.extend(prop_dict["mkyaffs2_extra_flags"].split()) build_command.extend(prop_dict["mkyaffs2_extra_flags"].split())
build_command.append(in_dir) build_command.append(in_dir)
build_command.append(out_file) 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) print "Running: ", " ".join(build_command)
p = subprocess.Popen(build_command); p = subprocess.Popen(build_command);
@@ -75,6 +80,7 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
common_props = ( common_props = (
"extfs_sparse_flag", "extfs_sparse_flag",
"mkyaffs2_extra_flags", "mkyaffs2_extra_flags",
"selinux_fc",
) )
for p in common_props: for p in common_props:
copy_prop(p, p) copy_prop(p, p)

View File

@@ -165,9 +165,9 @@ class EdifyGenerator(object):
fstab = self.info.get("fstab", None) fstab = self.info.get("fstab", None)
if fstab: if fstab:
p = fstab[partition] 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.fs_type, common.PARTITION_TYPES[p.fs_type],
p.device, p.length)) p.device, p.length, p.mount_point))
def DeleteFiles(self, file_list): def DeleteFiles(self, file_list):
"""Delete all files in 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> -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 (--aslr_mode) <on|off>
Specify whether to turn on ASLR for the package (on by default).
""" """
import sys import sys
@@ -381,6 +385,9 @@ def WriteFullOTAPackage(input_zip, output_zip):
if OPTIONS.wipe_user_data: if OPTIONS.wipe_user_data:
script.FormatPartition("/data") script.FormatPartition("/data")
if "selinux_fc" in OPTIONS.info_dict:
WritePolicyConfig(OPTIONS.info_dict["selinux_fc"], output_zip)
script.FormatPartition("/system") script.FormatPartition("/system")
script.Mount("/system") script.Mount("/system")
script.UnpackPackageDir("recovery", "/system") script.UnpackPackageDir("recovery", "/system")
@@ -415,15 +422,17 @@ def WriteFullOTAPackage(input_zip, output_zip):
script.AddToZip(input_zip, output_zip) script.AddToZip(input_zip, output_zip)
WriteMetadata(metadata, 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): def WriteMetadata(metadata, output_zip):
common.ZipWriteStr(output_zip, "META-INF/com/android/metadata", common.ZipWriteStr(output_zip, "META-INF/com/android/metadata",
"".join(["%s=%s\n" % kv "".join(["%s=%s\n" % kv
for kv in sorted(metadata.iteritems())])) for kv in sorted(metadata.iteritems())]))
def LoadSystemFiles(z): def LoadSystemFiles(z):
"""Load all the files from SYSTEM/... in a given target-files """Load all the files from SYSTEM/... in a given target-files
ZipFile, and return a dict of {filename: File object}.""" ZipFile, and return a dict of {filename: File object}."""