From: Theodore Ts'o Date: Wed, 14 May 2008 22:09:37 +0000 (-0400) Subject: mke2fs: Add the ability to configure default extended options in mke2fs.conf X-Git-Tag: v1.41-WIP-0617~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d36358d665c87cbfb00a2d700690fa379f24956;p=thirdparty%2Fe2fsprogs.git mke2fs: Add the ability to configure default extended options in mke2fs.conf Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 83c2dd4ff..a955af126 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1048,7 +1048,7 @@ static void PRS(int argc, char *argv[]) { int b, c; int size; - char *tmp, *tmp2; + char *tmp, *tmp2, **cpp; int blocksize = 0; int inode_ratio = 0; int inode_size = 0; @@ -1472,8 +1472,6 @@ static void PRS(int argc, char *argv[]) tmp = NULL; if (fs_param.s_rev_level != EXT2_GOOD_OLD_REV) { - char **cpp; - tmp = get_string_from_profile(fs_types, "base_features", "sparse_super,filetype,resize_inode,dir_index"); edit_feature(tmp, &fs_param.s_feature_compat); @@ -1592,6 +1590,16 @@ static void PRS(int argc, char *argv[]) lazy_itable_init = get_bool_from_profile(fs_types, "lazy_itable_init", 0); + /* Get options from profile */ + for (cpp = fs_types; *cpp; cpp++) { + tmp = NULL; + profile_get_string(profile, "fs_types", *cpp, "options", "", &tmp); + if (tmp && *tmp) + parse_extended_opts(&fs_param, tmp); + if (tmp) + free(tmp); + } + if (extended_opts) parse_extended_opts(&fs_param, extended_opts); diff --git a/misc/mke2fs.conf.5.in b/misc/mke2fs.conf.5.in index 40efb42fb..04bffc5ba 100644 --- a/misc/mke2fs.conf.5.in +++ b/misc/mke2fs.conf.5.in @@ -324,6 +324,16 @@ together to create one large virtual block group on an ext4 filesystem. This improves meta-data locality and performance on meta-data heavy workloads. The number of goups must be a power of 2 and may only be specified if the flex_bg filesystem feature is enabled. +.I options +This relation specifies additional extended options which should be +treated by +.BR mke2fs (8) +as if they were prepended to the argument of the +.B -E +option. This can be used to configure the default extended options used +by +.BR mke2fs (8) +on a per-filesystem type basis. .SH FILES .TP .I /etc/mke2fs.conf