Merge "recovery: format f2fs with encrypt/quota"
This commit is contained in:
@@ -321,7 +321,9 @@ int format_volume(const char* volume, const char* directory) {
|
||||
}
|
||||
|
||||
// Has to be f2fs because we checked earlier.
|
||||
std::vector<std::string> f2fs_args = { "/sbin/mkfs.f2fs", "-t", "-d1", v->blk_device };
|
||||
std::vector<std::string> f2fs_args = { "/sbin/mkfs.f2fs", "-d1", "-f",
|
||||
"-O", "encrypt", "-O", "quota",
|
||||
v->blk_device };
|
||||
if (length >= 512) {
|
||||
f2fs_args.push_back(std::to_string(length / 512));
|
||||
}
|
||||
|
||||
@@ -303,10 +303,16 @@ 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* f2fs_argv[] = {
|
||||
"mkfs.f2fs", "-t", "-d1", location.c_str(), (size < 512) ? nullptr : num_sectors.c_str(),
|
||||
nullptr
|
||||
};
|
||||
const char* f2fs_argv[] = { "mkfs.f2fs",
|
||||
"-d1",
|
||||
"-f",
|
||||
"-O",
|
||||
"encrypt",
|
||||
"-O",
|
||||
"quota",
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user