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
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 903f0c9..398a006 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -500,6 +500,9 @@
$(call add-clean-step, find $(PRODUCT_OUT) -type d -name "*product-services*" -print0 | xargs -0 rm -rf)
$(call add-clean-step, find $(PRODUCT_OUT) -type l -name "*product-services*" -print0 | xargs -0 rm -rf)
+# Remove obsolete recovery etc files
+$(call add-clean-step, rm -rf $(TARGET_RECOVERY_ROOT_OUT)/etc)
+
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/core/Makefile b/core/Makefile
index 6c5636c..8b74f9b 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1117,8 +1117,10 @@
$(hide) mkdir -p $(dir $@)
$(hide) openssl x509 -pubkey -noout -in $< > $@
-ALL_DEFAULT_INSTALLED_MODULES += $(TARGET_RECOVERY_ROOT_OUT)/etc/update_engine/update-payload-key.pub.pem
-$(TARGET_RECOVERY_ROOT_OUT)/etc/update_engine/update-payload-key.pub.pem: $(TARGET_OUT_ETC)/update_engine/update-payload-key.pub.pem
+ALL_DEFAULT_INSTALLED_MODULES += \
+ $(TARGET_RECOVERY_ROOT_OUT)/system/etc/update_engine/update-payload-key.pub.pem
+$(TARGET_RECOVERY_ROOT_OUT)/system/etc/update_engine/update-payload-key.pub.pem: \
+ $(TARGET_OUT_ETC)/update_engine/update-payload-key.pub.pem
$(hide) cp -f $< $@
endif
endif
@@ -1605,10 +1607,10 @@
define build-recoveryimage-target
# Making recovery image
$(hide) mkdir -p $(TARGET_RECOVERY_OUT)
- $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/etc $(TARGET_RECOVERY_ROOT_OUT)/sdcard $(TARGET_RECOVERY_ROOT_OUT)/tmp
+ $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sdcard $(TARGET_RECOVERY_ROOT_OUT)/tmp
# Copying baseline ramdisk...
# Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac.
- $(hide) rsync -a --exclude=etc --exclude=sdcard $(IGNORE_RECOVERY_SEPOLICY) $(IGNORE_CACHE_LINK) $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT)
+ $(hide) rsync -a --exclude=sdcard $(IGNORE_RECOVERY_SEPOLICY) $(IGNORE_CACHE_LINK) $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT)
# Modifying ramdisk contents...
$(if $(BOARD_RECOVERY_KERNEL_MODULES), \
$(call build-image-kernel-modules,$(BOARD_RECOVERY_KERNEL_MODULES),$(TARGET_RECOVERY_ROOT_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_recovery)))
@@ -1623,9 +1625,9 @@
$(hide) $(foreach item,$(TARGET_PRIVATE_RES_DIRS), \
cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline))
$(hide) $(foreach item,$(recovery_fstab), \
- cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.fstab)
+ cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.fstab)
$(if $(strip $(recovery_wipe)), \
- $(hide) cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.wipe)
+ $(hide) cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.wipe)
$(hide) cp $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys
$(hide) ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop
$(BOARD_RECOVERY_IMAGE_PREPARE)
diff --git a/target/product/mainline_system.mk b/target/product/mainline_system.mk
index a0d14c6..60a3b8d 100644
--- a/target/product/mainline_system.mk
+++ b/target/product/mainline_system.mk
@@ -25,8 +25,7 @@
PRODUCT_BRAND := generic
PRODUCT_SHIPPING_API_LEVEL := 28
-_base_mk_whitelist := \
- recovery/root/etc/mke2fs.conf \
+_base_mk_whitelist :=
_my_whitelist := $(_base_mk_whitelist)
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 4195900..e543857 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -239,11 +239,11 @@
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:
diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py
index 393c33d..5c6c8e1 100755
--- a/tools/releasetools/sign_target_files_apks.py
+++ b/tools/releasetools/sign_target_files_apks.py
@@ -370,13 +370,14 @@
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 @@
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