import initial fat mke2fs

This commit is contained in:
Mike Frysinger 2005-06-11 05:29:40 +00:00
parent 174808cedb
commit 6447ac0ef4
5 changed files with 1536 additions and 3 deletions

View File

@ -17,6 +17,13 @@ config CONFIG_LSATTR
help
lsattr lists the file attributes on a second extended file system.
config CONFIG_MKE2FS
bool "mke2fs"
default n
help
mke2fs is used to create an ext2/ext3 filesystem. The normal compat
symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided.
config CONFIG_TUNE2FS
bool "tune2fs (and e2label/findfs)"
default n

View File

@ -26,19 +26,23 @@ srcdir=$(top_srcdir)/e2fsprogs
E2FSPROGS_CFLAGS := -I$(E2FSPROGS_DIR) -include $(E2FSPROGS_DIR)e2fsbb.h
BLKID_SRC := cache.c dev.c devname.c devno.c getsize.c llseek.c probe.c \
read.c resolve.c save.c tag.c
read.c resolve.c save.c tag.c resolve.c
BLKID_SRCS := $(patsubst %,blkid/%, $(BLKID_SRC))
BLKID_OBJS := $(patsubst %.c,%.o, $(BLKID_SRCS))
E2P_SRC := fgetsetflags.c fgetsetversion.c pf.c iod.c mntopts.c \
feature.c ls.c uuid.c pe.c ostype.c ps.c hashstr.c
feature.c ls.c uuid.c pe.c ostype.c ps.c hashstr.c \
parse_num.c
E2P_SRCS := $(patsubst %,e2p/%, $(E2P_SRC))
E2P_OBJS := $(patsubst %.c,%.o, $(E2P_SRCS))
EXT2FS_SRC := gen_bitmap.c bitops.c ismounted.c mkjournal.c unix_io.c \
llseek.c rw_bitmaps.c initialize.c bitmaps.c block.c \
ind_block.c inode.c freefs.c alloc_stats.c closefs.c \
openfs.c io_manager.c finddev.c read_bb.c alloc.c badblocks.c
openfs.c io_manager.c finddev.c read_bb.c alloc.c badblocks.c \
getsize.c getsectsize.c alloc_tables.c read_bb_file.c mkdir.c \
bb_inode.c newdir.c alloc_sb.c lookup.c dirblock.c expanddir.c \
dir_iterate.c link.c res_gdt.c
EXT2FS_SRCS := $(patsubst %,ext2fs/%, $(EXT2FS_SRC))
EXT2FS_OBJS := $(patsubst %.c,%.o, $(EXT2FS_SRCS))
@ -50,6 +54,7 @@ UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS))
E2FSPROGS-:=
E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS)
E2FSPROGS-$(CONFIG_LSATTR) += lsattr.o $(E2P_OBJS)
E2FSPROGS-$(CONFIG_MKE2FS) += mke2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
E2FSPROGS-$(CONFIG_TUNE2FS) += tune2fs.o util.o $(E2P_OBJS) $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
libraries-y+=$(E2FSPROGS_DIR)$(E2FSPROGS_AR)

1483
e2fsprogs/mke2fs.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -395,9 +395,16 @@
#ifdef CONFIG_MKDIR
APPLET(mkdir, mkdir_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_MKE2FS
APPLET(mke2fs, mke2fs_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_MKFIFO
APPLET(mkfifo, mkfifo_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_MKE2FS
APPLET_NOUSAGE("mkfs.ext2", mke2fs_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
APPLET_NOUSAGE("mkfs.ext3", mke2fs_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_MKFS_MINIX
APPLET_ODDNAME("mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN, _BB_SUID_NEVER, mkfs_minix)
#endif

View File

@ -1705,6 +1705,37 @@
"/tmp/foo/bar/baz: No such file or directory\n" \
"$ mkdir -p /tmp/foo/bar/baz\n"
#define mke2fs_trivial_usage \
"[-c|-l filename] [-b block-size] [-f fragment-size] [-g blocks-per-group] " \
"[-i bytes-per-inode] [-j] [-J journal-options] [-N number-of-inodes] [-n] " \
"[-m reserved-blocks-percentage] [-o creator-os] [-O feature[,...]] [-q] " \
"[r fs-revision-level] [-E extended-options] [-v] [-F] [-L volume-label] " \
"[-M last-mounted-directory] [-S] [-T filesystem-type] " \
"device [blocks-count]"
#define mke2fs_full_usage \
"\t-b size\tblock size in bytes\n" \
"\t-c\tcheck for bad blocks before creating\n" \
"\t-E opts\tset extended options\n" \
"\t-f size\tfragment size in bytes\n" \
"\t-F\tforce (ignore sanity checks)\n" \
"\t-g num\tnumber of blocks in a block group\n" \
"\t-i ratio\tthe bytes/inode ratio\n" \
"\t-j\tcreate a journal (ext3)\n" \
"\t-J opts\tset journal options (size/device)\n" \
"\t-l file\tread bad blocks list from file\n" \
"\t-L lbl\tset the volume label\n" \
"\t-m percent\tpercent of fs blocks to reserve for admin\n" \
"\t-M dir\tset last mounted directory\n" \
"\t-n\tdo not actually create anything\n" \
"\t-N num\tnumber of inodes to create\n" \
"\t-o os\tset the 'creator os' field\n" \
"\t-O features\tdir_index/filetype/has_journal/journal_dev/sparse_super\n" \
"\t-q\tquiet execution\n" \
"\t-r rev\tset filesystem revision\n" \
"\t-S\twrite superblock and group descriptors only\n" \
"\t-T fs-type\tset usage type (news/largefile/largefile4)\n" \
"\t-v\tverbose execution"
#define mkfifo_trivial_usage \
"[OPTIONS] name"
#define mkfifo_full_usage \