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.
This commit is contained in:
+10
-1
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user