summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--updater/Android.mk4
-rw-r--r--updater/blockimg.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/updater/Android.mk b/updater/Android.mk
index 1ea1fb7..6e224fb 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -35,6 +35,10 @@ ifneq ($(BOARD_RECOVERY_BLDRMSG_OFFSET),)
LOCAL_CFLAGS += -DBOARD_RECOVERY_BLDRMSG_OFFSET=$(BOARD_RECOVERY_BLDRMSG_OFFSET)
endif
+ifeq ($(BOARD_SUPPRESS_EMMC_WIPE),true)
+ LOCAL_CFLAGS += -DSUPPRESS_EMMC_WIPE
+endif
+
LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UPDATER_LIBS) $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS)
LOCAL_STATIC_LIBRARIES += libapplypatch libedify libmtdutils libminzip libz
LOCAL_STATIC_LIBRARIES += libmincrypt libbz
diff --git a/updater/blockimg.c b/updater/blockimg.c
index 8b9519d..a93bfcb 100644
--- a/updater/blockimg.c
+++ b/updater/blockimg.c
@@ -1521,10 +1521,12 @@ static int PerformCommandErase(CommandParameters* params) {
// length in bytes
blocks[1] = (tgt->pos[i * 2 + 1] - tgt->pos[i * 2]) * (uint64_t) BLOCKSIZE;
+#ifndef SUPPRESS_EMMC_WIPE
if (ioctl(params->fd, BLKDISCARD, &blocks) == -1) {
fprintf(stderr, "BLKDISCARD ioctl failed: %s\n", strerror(errno));
goto pceout;
}
+#endif
}
}