diff options
author | Jaegeuk Kim <jaegeuk@google.com> | 2018-04-02 22:37:35 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@google.com> | 2018-04-04 23:26:23 +0200 |
commit | 4358262b757a39fe7939369be4afa6869e8caa3a (patch) | |
tree | 6f9967cea64c2e31d125dbf86eb8101f4f3b38b0 | |
parent | update_verifier: Support verifying product partition. (diff) | |
download | android_bootable_recovery-4358262b757a39fe7939369be4afa6869e8caa3a.tar android_bootable_recovery-4358262b757a39fe7939369be4afa6869e8caa3a.tar.gz android_bootable_recovery-4358262b757a39fe7939369be4afa6869e8caa3a.tar.bz2 android_bootable_recovery-4358262b757a39fe7939369be4afa6869e8caa3a.tar.lz android_bootable_recovery-4358262b757a39fe7939369be4afa6869e8caa3a.tar.xz android_bootable_recovery-4358262b757a39fe7939369be4afa6869e8caa3a.tar.zst android_bootable_recovery-4358262b757a39fe7939369be4afa6869e8caa3a.zip |
-rw-r--r-- | roots.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -324,19 +324,34 @@ int format_volume(const char* volume, const char* directory) { } // Has to be f2fs because we checked earlier. + static constexpr int kSectorSize = 4096; std::string cmd("/sbin/mkfs.f2fs"); - std::vector<std::string> make_f2fs_cmd = { cmd, "-d1", "-f", "-O", - "encrypt", "-O", "quota", v->blk_device }; - if (length >= 512) { - make_f2fs_cmd.push_back(std::to_string(length / 512)); + // clang-format off + std::vector<std::string> make_f2fs_cmd = { + cmd, + "-d1", + "-f", + "-O", "encrypt", + "-O", "quota", + "-w", std::to_string(kSectorSize), + v->blk_device, + }; + // clang-format on + if (length >= kSectorSize) { + make_f2fs_cmd.push_back(std::to_string(length / kSectorSize)); } int result = exec_cmd(make_f2fs_cmd); if (result == 0 && directory != nullptr) { cmd = "/sbin/sload.f2fs"; + // clang-format off std::vector<std::string> sload_f2fs_cmd = { - cmd, "-f", directory, "-t", volume, v->blk_device, + cmd, + "-f", directory, + "-t", volume, + v->blk_device, }; + // clang-format on result = exec_cmd(sload_f2fs_cmd); } if (result != 0) { |