fs_mgr: Support 16k F2FS

This passes the block size to mkfs. Currently f2fs must have page size
equal to block size. If this changes, we may want to revisit this.

Change-Id: I1ecdffcb2a271aa80c0bd07fd095941720fb48d0
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 279820706
Test: Boot 16K device
This commit is contained in:
Daniel Rosenberg 2023-11-17 17:14:14 -08:00
parent d922df36b2
commit d01ca43d6b

View file

@ -136,6 +136,7 @@ static int format_f2fs(const std::string& fs_blkdev, uint64_t dev_sz, bool needs
/* Format the partition using the calculated length */
const auto size_str = std::to_string(dev_sz / getpagesize());
std::string block_size = std::to_string(getpagesize());
std::vector<const char*> args = {"/system/bin/make_f2fs", "-g", "android"};
if (needs_projid) {
@ -154,6 +155,10 @@ static int format_f2fs(const std::string& fs_blkdev, uint64_t dev_sz, bool needs
args.push_back("-O");
args.push_back("extra_attr");
}
args.push_back("-w");
args.push_back(block_size.c_str());
args.push_back("-b");
args.push_back(block_size.c_str());
if (!zoned_device.empty()) {
args.push_back("-c");
args.push_back(zoned_device.c_str());