diff options
author | Jaegeuk Kim | 2017-11-13 20:45:25 -0600 |
---|---|---|
committer | android-build-merger | 2017-11-13 20:45:25 -0600 |
commit | c418bfeae21a12df2a448217c77c67cac5eff0e0 (patch) | |
tree | fc072fe34d311e05b1d04671b6fa902797397762 | |
parent | e2296b7a25075f549e77553d04778ff295d3b80f (diff) | |
parent | d4b6e25fdda0bd19d65ba3babbaac73a10cfeb8f (diff) | |
download | platform-bootable-recovery-c418bfeae21a12df2a448217c77c67cac5eff0e0.tar.gz platform-bootable-recovery-c418bfeae21a12df2a448217c77c67cac5eff0e0.tar.xz platform-bootable-recovery-c418bfeae21a12df2a448217c77c67cac5eff0e0.zip |
Merge "recovery: format f2fs with encrypt/quota"
am: d4b6e25fdd
Change-Id: I1d17a488d2eea4d858fa31e7a00d694e20b011b3
-rw-r--r-- | roots.cpp | 4 | ||||
-rw-r--r-- | updater/install.cpp | 14 |
2 files changed, 13 insertions, 5 deletions
@@ -321,7 +321,9 @@ int format_volume(const char* volume, const char* directory) { | |||
321 | } | 321 | } |
322 | 322 | ||
323 | // Has to be f2fs because we checked earlier. | 323 | // Has to be f2fs because we checked earlier. |
324 | std::vector<std::string> f2fs_args = { "/sbin/mkfs.f2fs", "-t", "-d1", v->blk_device }; | 324 | std::vector<std::string> f2fs_args = { "/sbin/mkfs.f2fs", "-d1", "-f", |
325 | "-O", "encrypt", "-O", "quota", | ||
326 | v->blk_device }; | ||
325 | if (length >= 512) { | 327 | if (length >= 512) { |
326 | f2fs_args.push_back(std::to_string(length / 512)); | 328 | f2fs_args.push_back(std::to_string(length / 512)); |
327 | } | 329 | } |
diff --git a/updater/install.cpp b/updater/install.cpp index b865081b..a111f4b7 100644 --- a/updater/install.cpp +++ b/updater/install.cpp | |||
@@ -303,10 +303,16 @@ Value* FormatFn(const char* name, State* state, const std::vector<std::unique_pt | |||
303 | std::string num_sectors = std::to_string(size / 512); | 303 | std::string num_sectors = std::to_string(size / 512); |
304 | 304 | ||
305 | const char* f2fs_path = "/sbin/mkfs.f2fs"; | 305 | const char* f2fs_path = "/sbin/mkfs.f2fs"; |
306 | const char* f2fs_argv[] = { | 306 | const char* f2fs_argv[] = { "mkfs.f2fs", |
307 | "mkfs.f2fs", "-t", "-d1", location.c_str(), (size < 512) ? nullptr : num_sectors.c_str(), | 307 | "-d1", |
308 | nullptr | 308 | "-f", |
309 | }; | 309 | "-O", |
310 | "encrypt", | ||
311 | "-O", | ||
312 | "quota", | ||
313 | location.c_str(), | ||
314 | (size < 512) ? nullptr : num_sectors.c_str(), | ||
315 | nullptr }; | ||
310 | int status = exec_cmd(f2fs_path, const_cast<char**>(f2fs_argv)); | 316 | int status = exec_cmd(f2fs_path, const_cast<char**>(f2fs_argv)); |
311 | if (status != 0) { | 317 | if (status != 0) { |
312 | LOG(ERROR) << name << ": mkfs.f2fs failed (" << status << ") on " << location; | 318 | LOG(ERROR) << name << ": mkfs.f2fs failed (" << status << ") on " << location; |