summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-04-06 11:31:14 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-04-06 11:31:14 +0200
commit4911321bd5d63d051ac1d61f9910413647038069 (patch)
treee50c9e3de55dbf95e3c34b6990255cc8803c9725
parentSnap for 4696223 from 90336bc85ec12352b8a3720286474bf84b507594 to qt-release (diff)
parentinstall: mkfs.f2fs: specify sector size for target image size am: 1224544806 (diff)
downloadandroid_bootable_recovery-4911321bd5d63d051ac1d61f9910413647038069.tar
android_bootable_recovery-4911321bd5d63d051ac1d61f9910413647038069.tar.gz
android_bootable_recovery-4911321bd5d63d051ac1d61f9910413647038069.tar.bz2
android_bootable_recovery-4911321bd5d63d051ac1d61f9910413647038069.tar.lz
android_bootable_recovery-4911321bd5d63d051ac1d61f9910413647038069.tar.xz
android_bootable_recovery-4911321bd5d63d051ac1d61f9910413647038069.tar.zst
android_bootable_recovery-4911321bd5d63d051ac1d61f9910413647038069.zip
-rw-r--r--roots.cpp25
-rw-r--r--updater/install.cpp2
2 files changed, 22 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) {
diff --git a/updater/install.cpp b/updater/install.cpp
index 2b6c20fe3..6732ab897 100644
--- a/updater/install.cpp
+++ b/updater/install.cpp
@@ -548,6 +548,8 @@ Value* FormatFn(const char* name, State* state, const std::vector<std::unique_pt
"encrypt",
"-O",
"quota",
+ "-w",
+ "512",
location.c_str(),
(size < 512) ? nullptr : num_sectors.c_str(),
nullptr };