Merge "Remove the obsolete location check for install-recovery.sh"

This commit is contained in:
Tianjie Xu 2017-06-22 18:12:41 +00:00 committed by Gerrit Code Review
commit 8fb65a5d63
1 changed files with 2 additions and 25 deletions

View File

@ -1605,7 +1605,6 @@ def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img,
info_dict = OPTIONS.info_dict info_dict = OPTIONS.info_dict
full_recovery_image = info_dict.get("full_recovery_image", None) == "true" 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: if full_recovery_image:
output_sink("etc/recovery.img", recovery_img.data) output_sink("etc/recovery.img", recovery_img.data)
@ -1661,30 +1660,8 @@ fi
'bonus_args': bonus_args} 'bonus_args': bonus_args}
# The install script location moved from /system/etc to /system/bin # The install script location moved from /system/etc to /system/bin
# in the L release. Parse init.*.rc files to find out where the # in the L release.
# target-files expects it to be, and put it there. sh_location = "bin/install-recovery.sh"
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
print("putting script in", sh_location) print("putting script in", sh_location)