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
This commit is contained in:
Tianjie Xu
2017-06-20 16:52:54 -07:00
parent 6cb7688e85
commit 78de9f173d

View File

@@ -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)