Install recovery etc files to recovery/root/system/etc.

They used to be installed under recovery/root/etc. This CL moves the
files to the new location and creates a symlink from /etc to /system/etc
(done by the rule in system/core/rootdir). This gives similar layout
between normal boot and recovery, and allows installing prebuilt_etc
files with Soong (`recovery_available: true`).

As part of the change, we no longer need the whitelisting rule for
mke2fs.conf.

Bug: 112780007
Test: Build with other changes in the topic (aosp_taimen-userdebug).
      Check the generated files under recovery (/etc being a symlink to
      /system/etc).
Test: Boot into recovery. Verify basic functionalities (`adb shell` and
      `adb sideload`, factory reset).
Test: `build/soong/build_test.bash --dist`
Change-Id: Ibb6dea6f179a339f0c2d0fd8ba05ec0085b79a12
This commit is contained in:
Tao Bao
2018-08-17 16:27:01 -07:00
parent e56d112bd0
commit 696bb33676
5 changed files with 23 additions and 18 deletions

View File

@@ -239,11 +239,11 @@ def LoadInfoDict(input_file, input_dir=None):
system_root_image = d.get("system_root_image") == "true"
if d.get("no_recovery") != "true":
recovery_fstab_path = "RECOVERY/RAMDISK/etc/recovery.fstab"
recovery_fstab_path = "RECOVERY/RAMDISK/system/etc/recovery.fstab"
d["fstab"] = LoadRecoveryFSTab(
read_helper, d["fstab_version"], recovery_fstab_path, system_root_image)
elif d.get("recovery_as_boot") == "true":
recovery_fstab_path = "BOOT/RAMDISK/etc/recovery.fstab"
recovery_fstab_path = "BOOT/RAMDISK/system/etc/recovery.fstab"
d["fstab"] = LoadRecoveryFSTab(
read_helper, d["fstab_version"], recovery_fstab_path, system_root_image)
else:

View File

@@ -370,13 +370,14 @@ def ProcessTargetFiles(input_tf_zip, output_tf_zip, misc_info,
OPTIONS.rebuild_recovery = True
# Don't copy OTA keys if we're replacing them.
elif (OPTIONS.replace_ota_keys and
filename in (
"BOOT/RAMDISK/res/keys",
"BOOT/RAMDISK/etc/update_engine/update-payload-key.pub.pem",
"RECOVERY/RAMDISK/res/keys",
"SYSTEM/etc/security/otacerts.zip",
"SYSTEM/etc/update_engine/update-payload-key.pub.pem")):
elif (
OPTIONS.replace_ota_keys and
filename in (
"BOOT/RAMDISK/res/keys",
"BOOT/RAMDISK/system/etc/update_engine/update-payload-key.pub.pem",
"RECOVERY/RAMDISK/res/keys",
"SYSTEM/etc/security/otacerts.zip",
"SYSTEM/etc/update_engine/update-payload-key.pub.pem")):
pass
# Skip META/misc_info.txt since we will write back the new values later.
@@ -635,7 +636,7 @@ def ReplaceOtaKeys(input_tf_zip, output_tf_zip, misc_info):
pubkey)
common.ZipWriteStr(
output_tf_zip,
"BOOT/RAMDISK/etc/update_engine/update-payload-key.pub.pem",
"BOOT/RAMDISK/system/etc/update_engine/update-payload-key.pub.pem",
pubkey)
return new_recovery_keys