Add interpretation of OS Creator values for FreeBSD and Lites in mke2fs

and dumpe2fs.

Eventually, we should fold this into a single function for converting
numbers to creator os codes, and vice versa (in TODO file)
bitmap-optimize
Theodore Ts'o 2005-01-19 18:18:44 -05:00
parent 484ae818e4
commit ea1e8f471e
3 changed files with 13 additions and 0 deletions

5
TODO
View File

@ -202,3 +202,8 @@ From e2fsprogs Debian TODO file as of 1.10-13.
Add --lba option to debian icheck command, and have ways of making it
easier to translate LBA to filesystem block numbers.
-------------------------------------------------------
Move creator_os string parsing and unparsing from mke2fs and e2p/ls.c
to a centralized e2p library function.

View File

@ -192,6 +192,8 @@ void list_super2(struct ext2_super_block * sb, FILE *f)
case EXT2_OS_LINUX: os = "Linux"; break;
case EXT2_OS_HURD: os = "GNU/Hurd"; break;
case EXT2_OS_MASIX: os = "Masix"; break;
case EXT2_OS_FREEBSD: os = "FreeBSD"; break;
case EXT2_OS_LITES: os = "Lites"; break;
default: os = "unknown"; break;
}
fprintf(f, "Filesystem OS type: %s\n", os);

View File

@ -702,6 +702,8 @@ static void show_stats(ext2_filsys fs)
case EXT2_OS_LINUX: fputs("Linux", stdout); break;
case EXT2_OS_HURD: fputs("GNU/Hurd", stdout); break;
case EXT2_OS_MASIX: fputs ("Masix", stdout); break;
case EXT2_OS_FREEBSD: fputs ("FerrBSD", stdout); break;
case EXT2_OS_LITES: fputs ("Lites", stdout); break;
default: fputs(_("(unknown os)"), stdout);
}
printf("\n");
@ -767,6 +769,10 @@ static int set_os(struct ext2_super_block *sb, char *os)
sb->s_creator_os = EXT2_OS_HURD;
else if (strcasecmp(os, "masix") == 0)
sb->s_creator_os = EXT2_OS_MASIX;
else if (strcasecmp(os, "freebsd") == 0)
sb->s_creator_os = EXT2_OS_FREEBSD;
else if (strcasecmp(os, "lites") == 0)
sb->s_creator_os = EXT2_OS_LITES;
else
return 0;
return 1;