Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5975ee6a authored by Jin Qian's avatar Jin Qian Committed by android-build-merger
Browse files

Merge "recovery: update mkfs.f2fs args to match f2fs-tools 1.8.0" am: f347c1ab

am: d6f506e7

Change-Id: I3f07419c0ccb380770220b201981b0fc7c88cc8f
parents 4ab07dfc d6f506e7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -232,14 +232,14 @@ int format_volume(const char* volume, const char* directory) {
                           << ") not supported on " << v->fs_type;
                return -1;
            }
            char *num_sectors;
            if (asprintf(&num_sectors, "%zd", length / 512) <= 0) {
            char *num_sectors = nullptr;
            if (length >= 512 && asprintf(&num_sectors, "%zd", length / 512) <= 0) {
                LOG(ERROR) << "format_volume: failed to create " << v->fs_type
                           << " command for " << v->blk_device;
                return -1;
            }
            const char *f2fs_path = "/sbin/mkfs.f2fs";
            const char* const f2fs_argv[] = {"mkfs.f2fs", "-t", "-d1", v->blk_device, num_sectors, NULL};
            const char* const f2fs_argv[] = {"mkfs.f2fs", "-t", "-d1", v->blk_device, num_sectors, nullptr};

            result = exec_cmd(f2fs_path, (char* const*)f2fs_argv);
            free(num_sectors);