From ac7b7db12c76ad6840d74aa3cba65c2f2631158f Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 25 Aug 2017 11:23:31 -0700 Subject: [PATCH] Remove file_contexts.bin from non-A/B OTA package. This entry only exists in non-A/B full OTA path. However, this file has never been loaded by recovery - recovery was only reading the one from the recovery image (which also has been removed by a recent change in [1]). [1]: commit e35926e1aff2e6b9b54656bd59c8178e295a1b7e in platform/bootable/recovery. Bug: 63538434 Test: `m dist` on angler. file_contexts.bin is gone from full OTA package. Sideloading the generated full OTA on angler. Change-Id: Iec2e2d36599fa1ed499516a3e74f06cd36ade494 --- tools/releasetools/ota_from_target_files.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 1b0f68b73b..a492f7852e 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -470,11 +470,6 @@ else if get_stage("%(bcb_dev)s") == "3/3" then if HasVendorPartition(input_zip): system_progress -= 0.1 - # Place a copy of file_contexts.bin into the OTA package which will be used - # by the recovery program. - if "selinux_fc" in OPTIONS.info_dict: - WritePolicyConfig(OPTIONS.info_dict["selinux_fc"], output_zip) - recovery_mount_options = OPTIONS.info_dict.get("recovery_mount_options") script.ShowProgress(system_progress, 0) @@ -540,10 +535,6 @@ endif; WriteMetadata(metadata, output_zip) -def WritePolicyConfig(file_name, output_zip): - common.ZipWrite(output_zip, file_name, os.path.basename(file_name)) - - def WriteMetadata(metadata, output_zip): value = "".join(["%s=%s\n" % kv for kv in sorted(metadata.iteritems())]) common.ZipWriteStr(output_zip, METADATA_NAME, value,