From 397a8137a0074ade60eee5efb32cc5a46c8af73c Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 12 May 2017 11:02:27 -0700 Subject: [PATCH] updater: Update the mkfs.f2fs argument to match f2fs-tools 1.8.0. Commit adeb41a8c0da3122a2907acb4aafd7ff9bce26af has switched the argument for recovery. This CL handles the case for updater. Note that there's a chance the updater may run against the old recovery (and f2fs 1.4.1 binary). Not sending a 0-sector argument to f2fs 1.4.1 also works. Bug: 37758867 Test: Make an OTA package that calls format f2fs, with mkfs.f2fs 1.8.0 and 1.4.1 binaries respectively. Change-Id: I4d4bbe8c57544d1c514b7aa37fbf22a0aab14e2c --- updater/install.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/updater/install.cpp b/updater/install.cpp index 888239c8..c5f9a89b 100644 --- a/updater/install.cpp +++ b/updater/install.cpp @@ -317,9 +317,11 @@ Value* FormatFn(const char* name, State* state, const std::vector(f2fs_argv)); + const char* f2fs_argv[] = { + "mkfs.f2fs", "-t", "-d1", location.c_str(), (size < 512) ? nullptr : num_sectors.c_str(), + nullptr + }; + int status = exec_cmd(f2fs_path, const_cast(f2fs_argv)); if (status != 0) { LOG(ERROR) << name << ": mkfs.f2fs failed (" << status << ") on " << location; return StringValue("");