summaryrefslogtreecommitdiffstats
path: root/roots.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-04-05 09:23:24 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-04-05 09:23:24 +0200
commit3ea872cc298c6936a3dcd35ff994561b415755f8 (patch)
treeeb377eca2baa25005af12df0839a9d2a1d5a049e /roots.cpp
parentSnap for 4677756 from 454d8cb805e633aaa1c6456a57ec9c2dc6c6e163 to pi-release (diff)
parentf2fs: support f2fs by setting unmovable bit for package file (diff)
downloadandroid_bootable_recovery-3ea872cc298c6936a3dcd35ff994561b415755f8.tar
android_bootable_recovery-3ea872cc298c6936a3dcd35ff994561b415755f8.tar.gz
android_bootable_recovery-3ea872cc298c6936a3dcd35ff994561b415755f8.tar.bz2
android_bootable_recovery-3ea872cc298c6936a3dcd35ff994561b415755f8.tar.lz
android_bootable_recovery-3ea872cc298c6936a3dcd35ff994561b415755f8.tar.xz
android_bootable_recovery-3ea872cc298c6936a3dcd35ff994561b415755f8.tar.zst
android_bootable_recovery-3ea872cc298c6936a3dcd35ff994561b415755f8.zip
Diffstat (limited to 'roots.cpp')
-rw-r--r--roots.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/roots.cpp b/roots.cpp
index 9ff5186c1..8907bbd9b 100644
--- a/roots.cpp
+++ b/roots.cpp
@@ -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) {