From 8e93a614e7c20ee28f1d3b4aa51c0e4200aa2c52 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 8 Nov 2021 12:18:30 +0100 Subject: [PATCH] makefs: also set uuid/label for ext2/ext3 We were only "supporting" ext4. Let's add "support", i.e. pass our optimization options and uuid/label for the other two fses in the same family. Nowadays there is separate code in the kernel, all three fs types are handled by ext4 code. ext2 in particular is useful for in-memory devices: the journal is just a waste of space there. ext3 is added for completeness mostly, since ext4 should probably be used instead. But people might use it for testing or for compatibility with older systems and I don't see much reason to not add "support" here. --- src/shared/mkfs-util.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/shared/mkfs-util.c b/src/shared/mkfs-util.c index b9c2f147bc1..1056de1bec2 100644 --- a/src/shared/mkfs-util.c +++ b/src/shared/mkfs-util.c @@ -68,7 +68,16 @@ int make_filesystem( return r; if (r == 0) { /* Child */ - if (streq(fstype, "ext4")) + if (streq(fstype, "ext2")) + (void) execlp(mkfs, mkfs, + "-L", label, + "-U", ID128_TO_UUID_STRING(uuid), + "-I", "256", + "-m", "0", + "-E", discard ? "discard,lazy_itable_init=1" : "nodiscard,lazy_itable_init=1", + node, NULL); + + else if (STR_IN_SET(fstype, "ext3", "ext4")) (void) execlp(mkfs, mkfs, "-L", label, "-U", ID128_TO_UUID_STRING(uuid), -- 2.47.3