summaryrefslogtreecommitdiff
path: root/misc/mke2fs.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-05-14 18:09:37 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-05-14 18:41:01 -0400
commit2d36358d665c87cbfb00a2d700690fa379f24956 (patch)
treec9420cdf2dc17ebbb5d5880e8a65789cd452feb0 /misc/mke2fs.c
parent9817a2ba2d408077dab12090b4b4250d0d9a282a (diff)
downloade2fsprogs-2d36358d665c87cbfb00a2d700690fa379f24956.tar.gz
mke2fs: Add the ability to configure default extended options in mke2fs.conf
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'misc/mke2fs.c')
-rw-r--r--misc/mke2fs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 83c2dd4f..a955af12 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);