From c6325aa8fea0c28db3a26700232e6b10b2654bc6 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 15 Aug 2021 10:42:03 -0400 Subject: [PATCH] mke2fs: allow the default creator os to be specified in /etc/mke2fs.conf This is useful for keeping the regression test results consistent when run on non-Linux systems, especially on GNU Hurd. Signed-off-by: Theodore Ts'o --- misc/mke2fs.c | 3 +++ misc/mke2fs.conf.5.in | 7 +++++++ tests/mke2fs.conf.in | 1 + 3 files changed, 11 insertions(+) diff --git a/misc/mke2fs.c b/misc/mke2fs.c index effe963..04b2fbc 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -2048,6 +2048,9 @@ profile_error: if (!usage_types) profile_get_string(profile, "devices", device_name, "usage_types", 0, &usage_types); + if (!creator_os) + profile_get_string(profile, "defaults", "creator_os", 0, + 0, &creator_os); /* * We have the file system (or device) size, so we can now diff --git a/misc/mke2fs.conf.5.in b/misc/mke2fs.conf.5.in index 0b57030..c67128a 100644 --- a/misc/mke2fs.conf.5.in +++ b/misc/mke2fs.conf.5.in @@ -118,6 +118,13 @@ The following relations are defined in the .I [defaults] stanza. .TP +.I creator_os +This relation specifies the "creator operating system" for the +file system unless it is overriden on the command line. +The default value is the OS for which the +.B mke2fs +executable was compiled. +.TP .I fs_type This relation specifies the default filesystem type if the user does not specify it via the diff --git a/tests/mke2fs.conf.in b/tests/mke2fs.conf.in index 46577f5..9075c6c 100644 --- a/tests/mke2fs.conf.in +++ b/tests/mke2fs.conf.in @@ -8,6 +8,7 @@ lazy_itable_init = false no_discard = true default_mntopts = ^acl + creator_os = Linux [fs_types] ext3 = { -- 1.8.3.1