summaryrefslogtreecommitdiffstats
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 3d2591391..b6955455a 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -74,6 +74,10 @@ LOCAL_CFLAGS := \
-Wall \
-Werror
+ifeq ($(BOARD_SUPPRESS_EMMC_WIPE),true)
+ LOCAL_CFLAGS += -DSUPPRESS_EMMC_WIPE
+endif
+
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH)/include
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index e93196b27..b44e1a219 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -1499,10 +1499,12 @@ static int PerformCommandErase(CommandParameters& params) {
// length in bytes
blocks[1] = (range.second - range.first) * static_cast<uint64_t>(BLOCKSIZE);
+#ifndef SUPPRESS_EMMC_WIPE
if (ioctl(params.fd, BLKDISCARD, &blocks) == -1) {
PLOG(ERROR) << "BLKDISCARD ioctl failed";
return -1;
}
+#endif
}
}