aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--updater/Android.mk4
-rw-r--r--updater/blockimg.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/updater/Android.mk b/updater/Android.mk
index ed9aba70..f6bcaff2 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -93,6 +93,10 @@ LOCAL_CFLAGS := \
-Wno-unused-parameter \
-Werror
+ifeq ($(BOARD_SUPPRESS_EMMC_WIPE),true)
+ LOCAL_CFLAGS += -DSUPPRESS_EMMC_WIPE
+endif
+
LOCAL_STATIC_LIBRARIES := \
libupdater \
$(TARGET_RECOVERY_UPDATER_LIBS) \
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index c614ccc4..81eeabf1 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -1383,10 +1383,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) {
PLOG(ERROR) << "BLKDISCARD ioctl failed";
return -1;
}
+#endif
}
}