diff --git a/core/Makefile b/core/Makefile index 6c5634249cc..21ed8c527a6 100644 --- a/core/Makefile +++ b/core/Makefile @@ -229,7 +229,6 @@ $(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $( TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \ TARGET_AAPT_CHARACTERISTICS="$(TARGET_AAPT_CHARACTERISTICS)" \ TARGET_UNIFIED_DEVICE="$(TARGET_UNIFIED_DEVICE)" \ - TARGET_SETS_FSTAB="$(TARGET_SETS_FSTAB)" \ $(PRODUCT_BUILD_PROP_OVERRIDES) \ bash $(BUILDINFO_SH) > $@ $(hide) $(foreach file,$(system_prop_file), \ @@ -1412,12 +1411,6 @@ else $(INTERNAL_OTA_PACKAGE_TARGET): override_prop := true endif -ifneq ($(TARGET_SETS_FSTAB),) - $(INTERNAL_OTA_PACKAGE_TARGET): mount_by_label := true -else - $(INTERNAL_OTA_PACKAGE_TARGET): mount_by_label := false -endif - $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS) @echo -e ${PRT_HST}"Package OTA: $@"${CL_RST} MKBOOTIMG=$(BOARD_CUSTOM_BOOTIMG_MK) \ @@ -1427,7 +1420,6 @@ $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS) --backup=$(backuptool) \ --override_device=$(override_device) \ --override_prop=$(override_prop) \ - --mount_by_label=$(mount_by_label) \ $(BUILT_TARGET_FILES_PACKAGE) $@ CUSTOM_TARGET_PACKAGE := $(PRODUCT_OUT)/omni-$(ROM_VERSION).zip diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py index 29c05838a89..c3b6cda1959 100644 --- a/tools/releasetools/edify_generator.py +++ b/tools/releasetools/edify_generator.py @@ -152,17 +152,14 @@ def CacheFreeSpaceCheck(self, amount): self.script.append(('apply_patch_space(%d) || abort("Not enough free space ' 'on /system to apply patches.");') % (amount,)) - def Mount(self, mount_point, mount_by_label = False): + def Mount(self, mount_point): """Mount the partition with the given mount_point.""" fstab = self.info.get("fstab", None) if fstab: p = fstab[mount_point] - if mount_by_label: - self.script.append('run_program("/sbin/mount", "%s");' % (mount_point,)) - else: - self.script.append('mount("%s", "%s", "%s", "%s");' % - (p.fs_type, common.PARTITION_TYPES[p.fs_type], - p.device, p.mount_point)) + self.script.append('mount("%s", "%s", "%s", "%s");' % + (p.fs_type, common.PARTITION_TYPES[p.fs_type], + p.device, p.mount_point)) self.mounts.add(p.mount_point) def Unmount(self, mount_point): @@ -187,7 +184,7 @@ def Print(self, message): """Log a message to the screen (if the logs are visible).""" self.script.append('ui_print("%s");' % (message,)) - def FormatPartition(self, partition, mount_by_label = False): + def FormatPartition(self, partition): """Format the given partition, specified by its mount point (eg, "/system").""" @@ -195,14 +192,9 @@ def FormatPartition(self, partition, mount_by_label = False): fstab = self.info.get("fstab", None) if fstab: p = fstab[partition] - if mount_by_label: - if not p.mount_point in self.mounts: - self.script.mount(p.mount_point) - self.script.append('run_program("/sbin/rm", "-rf", "%s");' % (p.mount_point,)) - else: - self.script.append('format("%s", "%s", "%s", "%s", "%s");' % - (p.fs_type, common.PARTITION_TYPES[p.fs_type], - p.device, p.length, p.mount_point)) + self.script.append('format("%s", "%s", "%s", "%s", "%s");' % + (p.fs_type, common.PARTITION_TYPES[p.fs_type], + 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 5bc540cd8b5..8e9f8544112 100755 --- a/tools/releasetools/ota_from_target_files +++ b/tools/releasetools/ota_from_target_files @@ -63,10 +63,6 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package Override build.prop items with custom vendor init. Enabled when TARGET_UNIFIED_DEVICE is defined in BoardConfig - --mount_by_label - Force the OTA package to mount and format System by label - Can be enabled by defining TARGET_SETS_FSTAB. Defaults to false. - """ import sys @@ -106,7 +102,6 @@ OPTIONS.worker_threads = 3 OPTIONS.backuptool = False OPTIONS.override_device = 'auto' OPTIONS.override_prop = False -OPTIONS.mount_by_label = False def MostPopularKey(d, default): """Given a dict, return the key corresponding to the largest @@ -459,16 +454,15 @@ def WriteFullOTAPackage(input_zip, output_zip): device_specific.FullOTA_InstallBegin() if OPTIONS.backuptool: - script.Mount("/system", OPTIONS.mount_by_label) + script.Mount("/system") script.RunBackup("backup") - if not OPTIONS.mount_by_label: - script.Unmount("/system") + script.Unmount("/system") script.ShowProgress(0.5, 0) if OPTIONS.wipe_user_data: script.Print("Formatting /data") - script.FormatPartition("/data", OPTIONS.mount_by_label) + script.FormatPartition("/data") script.Print("#######################################"); script.Print("# _____ __ __ ______ #"); @@ -485,11 +479,9 @@ def WriteFullOTAPackage(input_zip, output_zip): WritePolicyConfig(OPTIONS.info_dict["selinux_fc"], output_zip) script.Print("Formatting /system") - script.FormatPartition("/system", OPTIONS.mount_by_label) - if not OPTIONS.mount_by_label: - script.Mount("/system") - -# script.UnpackPackageDir("recovery", "/system") + script.FormatPartition("/system") + script.Mount("/system") + script.UnpackPackageDir("recovery", "/system") script.Print("Extracting /system") script.UnpackPackageDir("system", "/system") @@ -651,7 +643,7 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip): metadata["pre-build"] = source_fp metadata["post-build"] = target_fp - script.Mount("/system", OPTIONS.mount_by_label) + script.Mount("/system") script.AssertSomeFingerprint(source_fp, target_fp) source_boot = common.GetBootableImage( @@ -720,7 +712,7 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip): if OPTIONS.wipe_user_data: script.Print("Erasing user data...") - script.FormatPartition("/data", OPTIONS.mount_by_label) + script.FormatPartition("/data") script.Print("Removing unneeded files...") script.DeleteFiles(["/"+i[0] for i in verbatim_targets] + @@ -886,8 +878,6 @@ def main(argv): OPTIONS.override_device = a elif o in ("--override_prop"): OPTIONS.override_prop = bool(a.lower() == 'true') - elif o in ("--mount_by_label"): - OPTIONS.mount_by_label = bool(a.lower() == 'true') else: return False return True @@ -904,8 +894,7 @@ def main(argv): "aslr_mode=", "backup=", "override_device=", - "override_prop=", - "mount_by_label="], + "override_prop="], extra_option_handler=option_handler) if len(args) != 2: