mirror of https://github.com/vitalif/e2fsprogs
mke2fs: Add support for [devices] stanza in mke2fs.conf
Add the [devices] stanza which allows device-specific defaults to be specified in the mke2fs.conf file. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>bitmap-optimize
parent
8f36e6925f
commit
4c2b28ab67
|
@ -1190,8 +1190,8 @@ static void PRS(int argc, char *argv[])
|
|||
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__
|
||||
|
@ -1448,10 +1448,10 @@ profile_error:
|
|||
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;
|
||||
|
@ -1589,6 +1589,13 @@ profile_error:
|
|||
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
|
||||
|
@ -1946,6 +1953,9 @@ profile_error:
|
|||
*/
|
||||
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)
|
||||
|
|
|
@ -395,6 +395,20 @@ on a per-filesystem type basis.
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue