From 0ef6492518593eb1255e83723aaf9195fb582d6f Mon Sep 17 00:00:00 2001 From: andi34 Date: Sat, 9 May 2015 10:48:52 -0700 Subject: updater: Allow devices to suppress BLKDISCARD * On some devices TRIM is disabled for security reasons. Don't fail flashing the ROM because discard isn't possible in this case. Change-Id: I044619c3e0b01a496d967ef136501d0190240ad4 --- updater/blockimg.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'updater/blockimg.cpp') 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(BLOCKSIZE); +#ifndef SUPPRESS_EMMC_WIPE if (ioctl(params.fd, BLKDISCARD, &blocks) == -1) { PLOG(ERROR) << "BLKDISCARD ioctl failed"; return -1; } +#endif } } -- cgit v1.2.3