summaryrefslogtreecommitdiffstats
path: root/updater/install.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-05-12 23:26:34 +0200
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-05-12 23:26:36 +0200
commit494d97fe6b456e516cf210f01a4436d488658306 (patch)
treed81f7976eb40bfbd7a32f47274532d1230ead02e /updater/install.cpp
parentMerge "Don't write to /sys/class/android_usb/android0/enable with configfs." (diff)
parentupdater: Update the mkfs.f2fs argument to match f2fs-tools 1.8.0. (diff)
downloadandroid_bootable_recovery-494d97fe6b456e516cf210f01a4436d488658306.tar
android_bootable_recovery-494d97fe6b456e516cf210f01a4436d488658306.tar.gz
android_bootable_recovery-494d97fe6b456e516cf210f01a4436d488658306.tar.bz2
android_bootable_recovery-494d97fe6b456e516cf210f01a4436d488658306.tar.lz
android_bootable_recovery-494d97fe6b456e516cf210f01a4436d488658306.tar.xz
android_bootable_recovery-494d97fe6b456e516cf210f01a4436d488658306.tar.zst
android_bootable_recovery-494d97fe6b456e516cf210f01a4436d488658306.zip
Diffstat (limited to 'updater/install.cpp')
-rw-r--r--updater/install.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/updater/install.cpp b/updater/install.cpp
index 888239c83..c5f9a89bb 100644
--- a/updater/install.cpp
+++ b/updater/install.cpp
@@ -317,9 +317,11 @@ Value* FormatFn(const char* name, State* state, const std::vector<std::unique_pt
std::string num_sectors = std::to_string(size / 512);
const char* f2fs_path = "/sbin/mkfs.f2fs";
- const char* const f2fs_argv[] = { "mkfs.f2fs", "-t", "-d1", location.c_str(),
- num_sectors.c_str(), nullptr };
- int status = exec_cmd(f2fs_path, const_cast<char* const*>(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<char**>(f2fs_argv));
if (status != 0) {
LOG(ERROR) << name << ": mkfs.f2fs failed (" << status << ") on " << location;
return StringValue("");