From 78de9f173dc41d7a81131024fce52bdecb227866 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Tue, 20 Jun 2017 16:52:54 -0700 Subject: [PATCH] Remove the obsolete location check for install-recovery.sh The script has been moved to /system/bin since L. Bug: 35411009 Test: Generate a exact same OTA for bullhead. Change-Id: Iaecb86e3dabc5b659605837bb06f16d20fa80334 --- tools/releasetools/common.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 652fadf56e..a9a004b8e5 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -1596,7 +1596,6 @@ def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img, info_dict = OPTIONS.info_dict full_recovery_image = info_dict.get("full_recovery_image", None) == "true" - system_root_image = info_dict.get("system_root_image", None) == "true" if full_recovery_image: output_sink("etc/recovery.img", recovery_img.data) @@ -1652,30 +1651,8 @@ fi 'bonus_args': bonus_args} # The install script location moved from /system/etc to /system/bin - # in the L release. Parse init.*.rc files to find out where the - # target-files expects it to be, and put it there. - sh_location = "etc/install-recovery.sh" - found = False - if system_root_image: - init_rc_dir = os.path.join(input_dir, "ROOT") - else: - init_rc_dir = os.path.join(input_dir, "BOOT", "RAMDISK") - init_rc_files = os.listdir(init_rc_dir) - for init_rc_file in init_rc_files: - if (not init_rc_file.startswith('init.') or - not init_rc_file.endswith('.rc')): - continue - - with open(os.path.join(init_rc_dir, init_rc_file)) as f: - for line in f: - m = re.match(r"^service flash_recovery /system/(\S+)\s*$", line) - if m: - sh_location = m.group(1) - found = True - break - - if found: - break + # in the L release. + sh_location = "bin/install-recovery.sh" print("putting script in", sh_location)