OSDN Git Service

Add support for TARGET_RECOVERY_BRICK.
authorTao Bao <tbao@google.com>
Wed, 1 Jun 2016 06:56:23 +0000 (23:56 -0700)
committerTao Bao <tbao@google.com>
Wed, 1 Jun 2016 22:18:06 +0000 (15:18 -0700)
TARGET_RECOVERY_BRICK specifies the file that lists all the partitions
to be bricked under recovery. The file, if present, will be copied to
'$(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.brick'.

Bug: 27253717
Change-Id: Id84195b5ee1031a83bf7a077be070a3728416580

core/Makefile

index 6d90801..32c1755 100644 (file)
@@ -883,6 +883,11 @@ recovery_fstab := $(TARGET_RECOVERY_FSTAB)
 else
 recovery_fstab := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery.fstab))
 endif
+ifdef TARGET_RECOVERY_BRICK
+recovery_brick := $(TARGET_RECOVERY_BRICK)
+else
+recovery_brick :=
+endif
 
 # Prior to A/B update, we used to have:
 #   boot.img + recovery-from-boot.p + recovery-resource.dat = recovery.img.
@@ -968,6 +973,8 @@ define build-recoveryimage-target
     cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline))
   $(hide) $(foreach item,$(recovery_fstab), \
     cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.fstab)
+  $(if $(strip $(recovery_brick)), \
+    $(hide) cp -f $(recovery_brick) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.brick)
   $(hide) cp $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys
   $(hide) cat $(INSTALLED_DEFAULT_PROP_TARGET) $(recovery_build_prop) \
           > $(TARGET_RECOVERY_ROOT_OUT)/default.prop