From bad89b2af3ffa43c9570d93c3d9d9adacc194f9a Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 22 Aug 2008 21:57:29 -0400 Subject: [PATCH] mke2fs: Issue a warning if the mke2fs.conf file wasn't updated Many people are forgetting to update their mke2fs.conf file, and this means that filesystems aren't getting created with the proper features enabled. So detect this case and issue a warning. Signed-off-by: "Theodore Ts'o" --- misc/mke2fs.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 04c482e4..9cba3b5d 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -968,6 +968,20 @@ static char **parse_fs_type(const char *fs_type, ext_type = "ext3"; } + if (!strcmp(ext_type, "ext3") || !strcmp(ext_type, "ext4") || + !strcmp(ext_type, "ext4dev")) { + profile_get_string(profile, "fs_types", ext_type, "features", + 0, &t); + if (!t) { + printf(_("\nWarning! Your mke2fs.conf file does " + "not define the %s filesystem type.\n"), + ext_type); + printf(_("You probably need to install an updated " + "mke2fs.conf file.\n\n")); + sleep(5); + } + } + meg = (1024 * 1024) / EXT2_BLOCK_SIZE(fs_param); if (fs_param->s_blocks_count < 3 * meg) size_type = "floppy";