Commit ea1e8f47 authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

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)
parent 484ae818
......@@ -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.
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment