errcode_t retval;
char * oldpath = getenv("PATH");
char * extended_opts = 0;
- const char * fs_type = 0;
- const char * usage_types = 0;
+ char * fs_type = 0;
+ char * usage_types = 0;
blk64_t dev_size;
blk64_t fs_blocks_count = 0;
#ifdef __linux__
super_only = 1;
break;
case 't':
- fs_type = optarg;
+ fs_type = strdup(optarg);
break;
case 'T':
- usage_types = optarg;
+ usage_types = strdup(optarg);
break;
case 'U':
fs_uuid = optarg;
proceed_question();
}
+ if (!fs_type)
+ profile_get_string(profile, "devices", device_name,
+ "fs_type", 0, &fs_type);
+ if (!usage_types)
+ profile_get_string(profile, "devices", device_name,
+ "usage_types", 0, &usage_types);
+
/*
* We have the file system (or device) size, so we can now
* determine the appropriate file system types so the fs can
*/
ext2fs_r_blocks_count_set(&fs_param, reserved_ratio *
ext2fs_blocks_count(&fs_param) / 100.0);
+
+ free(fs_type);
+ free(usage_types);
}
static int should_do_undo(const char *name)
document.
.TP
.I [defaults]
-Contains relations which define the default parameters
+Contains relations which define the default parameters
used by
.BR mke2fs (8).
In general, these defaults may be overridden by a definition in the
This relation is a boolean which specifies whether the
.BR mke2fs (8)
should attempt to discard device prior to filesystem creation.
+.SH THE [devices] STANZA
+Each tag in the
+.I [devices]
+stanza names device name so that per-device defaults can be specified.
+.TP
+.I fs_type
+This relation specifies the default parameter for the
+.B \-t
+option, if this option isn't specified on the command line.
+.TP
+.I usage_types
+This relation specifies the default parameter for the
+.B \-T
+option, if this option isn't specified on the command line.
.SH FILES
.TP
.I /etc/mke2fs.conf