From 79735a6a82f7f3d60cd86bf293b8a6b4e1d92768 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 28 Aug 2015 10:52:03 -0700 Subject: [PATCH] Use the basename of file_contexts from the info dict. Changes in [1] break the backward compatibility of the OTA scripts. Fix the issue by extracting the file basename from the info dict in META/misc_info.txt. [1] commit d3a803e6680e86f7b4960d51ab0b620728b793ca Bug: 23620049 Change-Id: I40a5625bbe0beb295f34b2328906a4a4283fe59b --- tools/releasetools/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index d56c0fd265..0678a137ed 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -159,11 +159,12 @@ def LoadInfoDict(input_file, input_dir=None): # to build images than the one running on device, such as when enabling # system_root_image. In that case, we must have the one for image # generation copied to META/. - fc_config = os.path.join(input_dir, "META", "file_contexts.bin") + fc_basename = os.path.basename(d.get("selinux_fc", "file_contexts")) + fc_config = os.path.join(input_dir, "META", fc_basename) if d.get("system_root_image") == "true": assert os.path.exists(fc_config) if not os.path.exists(fc_config): - fc_config = os.path.join(input_dir, "BOOT", "RAMDISK", "file_contexts.bin") + fc_config = os.path.join(input_dir, "BOOT", "RAMDISK", fc_basename) if not os.path.exists(fc_config): fc_config = None