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:
@@ -500,6 +500,9 @@ $(call add-clean-step, find $(PRODUCT_OUT) -type f -name "*product-services*" -p
|
|||||||
$(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 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)
|
$(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
|
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
|
||||||
# ************************************************
|
# ************************************************
|
||||||
|
@@ -1117,8 +1117,10 @@ $(TARGET_OUT_ETC)/update_engine/update-payload-key.pub.pem: $(addsuffix .x509.pe
|
|||||||
$(hide) mkdir -p $(dir $@)
|
$(hide) mkdir -p $(dir $@)
|
||||||
$(hide) openssl x509 -pubkey -noout -in $< > $@
|
$(hide) openssl x509 -pubkey -noout -in $< > $@
|
||||||
|
|
||||||
ALL_DEFAULT_INSTALLED_MODULES += $(TARGET_RECOVERY_ROOT_OUT)/etc/update_engine/update-payload-key.pub.pem
|
ALL_DEFAULT_INSTALLED_MODULES += \
|
||||||
$(TARGET_RECOVERY_ROOT_OUT)/etc/update_engine/update-payload-key.pub.pem: $(TARGET_OUT_ETC)/update_engine/update-payload-key.pub.pem
|
$(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 $< $@
|
$(hide) cp -f $< $@
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -1605,10 +1607,10 @@ RECOVERYIMAGE_ID_FILE := $(PRODUCT_OUT)/recovery.id
|
|||||||
define build-recoveryimage-target
|
define build-recoveryimage-target
|
||||||
# Making recovery image
|
# Making recovery image
|
||||||
$(hide) mkdir -p $(TARGET_RECOVERY_OUT)
|
$(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...
|
# Copying baseline ramdisk...
|
||||||
# Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac.
|
# 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...
|
# Modifying ramdisk contents...
|
||||||
$(if $(BOARD_RECOVERY_KERNEL_MODULES), \
|
$(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)))
|
$(call build-image-kernel-modules,$(BOARD_RECOVERY_KERNEL_MODULES),$(TARGET_RECOVERY_ROOT_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_recovery)))
|
||||||
@@ -1623,9 +1625,9 @@ define build-recoveryimage-target
|
|||||||
$(hide) $(foreach item,$(TARGET_PRIVATE_RES_DIRS), \
|
$(hide) $(foreach item,$(TARGET_PRIVATE_RES_DIRS), \
|
||||||
cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline))
|
cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline))
|
||||||
$(hide) $(foreach item,$(recovery_fstab), \
|
$(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)), \
|
$(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) cp $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys
|
||||||
$(hide) ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop
|
$(hide) ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop
|
||||||
$(BOARD_RECOVERY_IMAGE_PREPARE)
|
$(BOARD_RECOVERY_IMAGE_PREPARE)
|
||||||
|
@@ -25,8 +25,7 @@ PRODUCT_NAME := mainline_system
|
|||||||
PRODUCT_BRAND := generic
|
PRODUCT_BRAND := generic
|
||||||
PRODUCT_SHIPPING_API_LEVEL := 28
|
PRODUCT_SHIPPING_API_LEVEL := 28
|
||||||
|
|
||||||
_base_mk_whitelist := \
|
_base_mk_whitelist :=
|
||||||
recovery/root/etc/mke2fs.conf \
|
|
||||||
|
|
||||||
_my_whitelist := $(_base_mk_whitelist)
|
_my_whitelist := $(_base_mk_whitelist)
|
||||||
|
|
||||||
|
@@ -239,11 +239,11 @@ def LoadInfoDict(input_file, input_dir=None):
|
|||||||
|
|
||||||
system_root_image = d.get("system_root_image") == "true"
|
system_root_image = d.get("system_root_image") == "true"
|
||||||
if d.get("no_recovery") != "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(
|
d["fstab"] = LoadRecoveryFSTab(
|
||||||
read_helper, d["fstab_version"], recovery_fstab_path, system_root_image)
|
read_helper, d["fstab_version"], recovery_fstab_path, system_root_image)
|
||||||
elif d.get("recovery_as_boot") == "true":
|
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(
|
d["fstab"] = LoadRecoveryFSTab(
|
||||||
read_helper, d["fstab_version"], recovery_fstab_path, system_root_image)
|
read_helper, d["fstab_version"], recovery_fstab_path, system_root_image)
|
||||||
else:
|
else:
|
||||||
|
@@ -370,10 +370,11 @@ def ProcessTargetFiles(input_tf_zip, output_tf_zip, misc_info,
|
|||||||
OPTIONS.rebuild_recovery = True
|
OPTIONS.rebuild_recovery = True
|
||||||
|
|
||||||
# Don't copy OTA keys if we're replacing them.
|
# Don't copy OTA keys if we're replacing them.
|
||||||
elif (OPTIONS.replace_ota_keys and
|
elif (
|
||||||
|
OPTIONS.replace_ota_keys and
|
||||||
filename in (
|
filename in (
|
||||||
"BOOT/RAMDISK/res/keys",
|
"BOOT/RAMDISK/res/keys",
|
||||||
"BOOT/RAMDISK/etc/update_engine/update-payload-key.pub.pem",
|
"BOOT/RAMDISK/system/etc/update_engine/update-payload-key.pub.pem",
|
||||||
"RECOVERY/RAMDISK/res/keys",
|
"RECOVERY/RAMDISK/res/keys",
|
||||||
"SYSTEM/etc/security/otacerts.zip",
|
"SYSTEM/etc/security/otacerts.zip",
|
||||||
"SYSTEM/etc/update_engine/update-payload-key.pub.pem")):
|
"SYSTEM/etc/update_engine/update-payload-key.pub.pem")):
|
||||||
@@ -635,7 +636,7 @@ def ReplaceOtaKeys(input_tf_zip, output_tf_zip, misc_info):
|
|||||||
pubkey)
|
pubkey)
|
||||||
common.ZipWriteStr(
|
common.ZipWriteStr(
|
||||||
output_tf_zip,
|
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)
|
pubkey)
|
||||||
|
|
||||||
return new_recovery_keys
|
return new_recovery_keys
|
||||||
|
Reference in New Issue
Block a user