partinfo.c: Fix minor compilation bugs pointed out by Yann Dirson.
mke2fs.c: Don't turn on sparse superblocks by default on pre-2.2 kernels.
mke2fs.8.in: Add the possible valid block sizes for mke2fs. Document
the -n flag, and the new defaults for the -s flag.
dumpe2fs.c, dumpe2fs.8.in: Add new options -f (force) and -h (header-only).
mke2fs.c (PRS): Fix logic for turning on/off the sparse superblock option.
Many files:
Updated copyright statements to reflect the GPL with permission of the
original authors.
+1999-09-07 <tytso@rsts-11.mit.edu>
+
+ * Updated copyright statements to reflect the GPL with permission
+ of the original authors.
+
1999-07-18 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Release of E2fsprogs 1.15
# the Makefile.in file
#
error_message.o: $(srcdir)/error_message.c $(srcdir)/com_err.h \
- $(srcdir)/error_table.h $(srcdir)/mit-sipb-copyright.h $(srcdir)/internal.h
+ $(srcdir)/error_table.h $(srcdir)/internal.h
et_name.o: $(srcdir)/et_name.c $(srcdir)/com_err.h $(srcdir)/error_table.h \
- $(srcdir)/mit-sipb-copyright.h $(srcdir)/internal.h
-init_et.o: $(srcdir)/init_et.c $(srcdir)/com_err.h $(srcdir)/error_table.h \
- $(srcdir)/mit-sipb-copyright.h
-com_err.o: $(srcdir)/com_err.c $(srcdir)/com_err.h \
- $(srcdir)/mit-sipb-copyright.h $(srcdir)/error_table.h $(srcdir)/internal.h
+ $(srcdir)/internal.h
+init_et.o: $(srcdir)/init_et.c $(srcdir)/com_err.h $(srcdir)/error_table.h
+com_err.o: $(srcdir)/com_err.c $(srcdir)/com_err.h $(srcdir)/error_table.h \
+ $(srcdir)/internal.h
/*
* Copyright 1987, 1988 by MIT Student Information Processing Board.
*
- * For copyright info, see mit-sipb-copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#include <stdio.h>
#include "com_err.h"
-#include "mit-sipb-copyright.h"
#include "error_table.h"
#include "internal.h"
* Copyright 1987 by the Student Information Processing Board
* of the Massachusetts Institute of Technology
*
- * For copyright info, see "mit-sipb-copyright.h".
+ * This file may be copied under the terms of the GNU Public License.
*/
#include <stdio.h>
#include <errno.h>
#include "com_err.h"
#include "error_table.h"
-#include "mit-sipb-copyright.h"
#include "internal.h"
static char buffer[25];
* Copyright 1988 by the Student Information Processing Board of the
* Massachusetts Institute of Technology.
*
- * For copyright info, see mit-sipb-copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#ifndef _ET_H
/*
* Copyright 1987 by MIT Student Information Processing Board
*
- * For copyright info, see mit-sipb-copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#include "com_err.h"
#include "error_table.h"
-#include "mit-sipb-copyright.h"
#include "internal.h"
static const char char_set[] =
* Copyright 1986, 1987, 1988 by MIT Information Systems and
* the MIT Student Information Processing Board.
*
- * For copyright info, see mit-sipb-copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#include <stdio.h>
#endif
#include "com_err.h"
#include "error_table.h"
-#include "mit-sipb-copyright.h"
#ifndef __STDC__
#define const
/*
* internal include file for com_err package
+ *
+ * This file may be copied under the terms of the GNU Public License.
*/
-#include "mit-sipb-copyright.h"
#ifndef __STDC__
#undef const
#define const
+++ /dev/null
-/*
-
-Copyright 1987, 1988 by the Student Information Processing Board
- of the Massachusetts Institute of Technology
-
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is
-hereby granted, provided that the above copyright notice
-appear in all copies and that both that copyright notice and
-this permission notice appear in supporting documentation,
-and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
-used in advertising or publicity pertaining to distribution
-of the software without specific, written prior permission.
-M.I.T. and the M.I.T. S.I.P.B. make no representations about
-the suitability of this software for any purpose. It is
-provided "as is" without express or implied warranty.
-
-*/
-
+1999-09-07 <tytso@rsts-11.mit.edu>
+
+ * Updated copyright statements to reflect the GPL with permission
+ of the original authors.
+
1999-07-18 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Release of E2fsprogs 1.15
MKCMDSCSRCS= mk_cmds.c utils.c options.c ct.tab.c cmd_tbl.lex.c
-HFILES= ss.h ss_internal.h copyright.h
+HFILES= ss.h ss_internal.h
SHARE_FILES= ct_c.awk ct_c.sed
-INSTALL_HFILES= ss.h copyright.h
+INSTALL_HFILES= ss.h
# for 'tags' and dependencies
FILES= $(SRCS) $(MKCMDSFILES) $(HFILES) \
ss_err.et std_rqs.ct Makefile \
- test_ss.c ss copyright.h
+ test_ss.c ss
all:: libss.a # libss_p.a lint
$(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss \
$(DESTDIR)$(bindir)
-install:: libss.a $(INSTALL_HFILES) copyright.h installdirs ss_err.h mk_cmds
+install:: libss.a $(INSTALL_HFILES) installdirs ss_err.h mk_cmds
$(INSTALL_DATA) libss.a $(DESTDIR)$(libdir)/libss.a
$(CHMOD) 644 $(DESTDIR)$(libdir)/libss.a
-$(RANLIB) $(DESTDIR)$(libdir)/libss.a
$(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libss.a
$(RM) -f $(DESTDIR)$(includedir)/ss/*
- for i in $(INSTALL_HFILES) copyright.h; do \
+ for i in $(INSTALL_HFILES); do \
$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ss/$$i; \
done
$(INSTALL_DATA) ss_err.h $(DESTDIR)$(includedir)/ss/ss_err.h
# the Makefile.in file
#
invocation.o: $(srcdir)/invocation.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
- $(srcdir)/copyright.h $(top_builddir)/lib/ss/ss_err.h
+ $(top_builddir)/lib/ss/ss_err.h
help.o: $(srcdir)/help.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
- $(srcdir)/copyright.h $(top_builddir)/lib/ss/ss_err.h
+ $(top_builddir)/lib/ss/ss_err.h
execute_cmd.o: $(srcdir)/execute_cmd.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
- $(srcdir)/copyright.h $(top_builddir)/lib/ss/ss_err.h
-listen.o: $(srcdir)/listen.c $(srcdir)/copyright.h $(srcdir)/ss_internal.h \
- $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h
+ $(top_builddir)/lib/ss/ss_err.h
+listen.o: $(srcdir)/listen.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h
parse.o: $(srcdir)/parse.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
- $(srcdir)/copyright.h $(top_builddir)/lib/ss/ss_err.h
-error.o: $(srcdir)/error.c $(srcdir)/copyright.h $(srcdir)/../et/com_err.h \
- $(srcdir)/ss_internal.h $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h
-prompt.o: $(srcdir)/prompt.c $(srcdir)/copyright.h $(srcdir)/ss_internal.h \
+ $(top_builddir)/lib/ss/ss_err.h
+error.o: $(srcdir)/error.c $(srcdir)/../et/com_err.h $(srcdir)/ss_internal.h \
$(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h
-request_tbl.o: $(srcdir)/request_tbl.c $(srcdir)/copyright.h \
- $(srcdir)/ss_internal.h $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h
-list_rqs.o: $(srcdir)/list_rqs.c $(srcdir)/copyright.h \
- $(srcdir)/ss_internal.h $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h
+prompt.o: $(srcdir)/prompt.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h
+request_tbl.o: $(srcdir)/request_tbl.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h
+list_rqs.o: $(srcdir)/list_rqs.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h
pager.o: $(srcdir)/pager.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
- $(srcdir)/copyright.h $(top_builddir)/lib/ss/ss_err.h
-requests.o: $(srcdir)/requests.c $(srcdir)/copyright.h \
- $(srcdir)/ss_internal.h $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h
+ $(top_builddir)/lib/ss/ss_err.h
+requests.o: $(srcdir)/requests.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h
data.o: $(srcdir)/data.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
- $(srcdir)/copyright.h $(top_builddir)/lib/ss/ss_err.h
+ $(top_builddir)/lib/ss/ss_err.h
+++ /dev/null
-/*
-
-Copyright 1987, 1989 by the Student Information Processing Board
- of the Massachusetts Institute of Technology
-
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is
-hereby granted, provided that the above copyright notice
-appear in all copies and that both that copyright notice and
-this permission notice appear in supporting documentation,
-and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
-used in advertising or publicity pertaining to distribution
-of the software without specific, written prior permission.
-M.I.T. and the M.I.T. S.I.P.B. make no representations about
-the suitability of this software for any purpose. It is
-provided "as is" without express or implied warranty.
-
-*/
-
* Copyright 1987, 1988, 1989 Massachusetts Institute of Technology
* (Student Information Processing Board)
*
- * For copyright info, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#include <stdio.h>
#include "ss_internal.h"
-#include "copyright.h"
static const char copyright[] =
"Copyright 1987, 1988, 1989 by the Massachusetts Institute of Technology";
* Copyright 1987, 1988, 1989 by MIT Student Information Processing
* Board
*
- * For copyright information, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#include <stdio.h>
#define ss_error ss_error_external
#endif
-#include "copyright.h"
#include <com_err.h>
#include "ss_internal.h"
/*
* Copyright 1987, 1988, 1989 by Massachusetts Institute of Technology
*
- * For copyright info, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#ifdef HAS_STDLIB_H
#include <stdlib.h>
#endif
#include "ss_internal.h"
-#include "copyright.h"
#include <stdio.h>
/*
/*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
- * For copyright info, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#ifdef HAVE_UNISTD_H
#endif
#include <sys/wait.h>
#include "ss_internal.h"
-#include "copyright.h"
void ss_help (argc, argv, sci_idx, info_ptr)
int argc;
/*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
- * For copyright information, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#ifdef HAS_STDLIB_H
#include <stdlib.h>
#endif
#include "ss_internal.h"
-#include "copyright.h"
#define size sizeof(ss_data *)
int ss_create_invocation(subsystem_name, version_string, info_ptr,
/*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
- * For copyright information, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
-#include "copyright.h"
#include "ss_internal.h"
#include <signal.h>
#include <setjmp.h>
*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
- * For copyright information, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
-#include "copyright.h"
#include "ss_internal.h"
#include <stdio.h>
#include <setjmp.h>
*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
- * For copyright information, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#ifdef HAVE_UNISTD_H
#endif
#include "ss_internal.h"
-#include "copyright.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/file.h>
/*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
- * For copyright info, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#ifdef HAS_STDLIB_H
#endif
#include "ss_internal.h"
-#include "copyright.h"
enum parse_mode { WHITESPACE, TOKEN, QUOTED_STRING };
*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
- * For copyright information, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
-#include "copyright.h"
#include <stdio.h>
#include "ss_internal.h"
/*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
- * For copyright information, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
-#include "copyright.h"
#include "ss_internal.h"
#define ssrt ss_request_table /* for some readable code... */
*
* Copyright 1987, 1988, 1989 by MIT
*
- * For copyright information, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
-#include "copyright.h"
#include <stdio.h>
#include "ss_internal.h"
/*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
- * For copyright information, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#ifndef _ss_h
#define _ss_h __FILE__
-#include <ss/copyright.h>
#include <ss/ss_err.h>
#ifdef __STDC__
/*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
- * For copyright information, see copyright.h.
+ * This file may be copied under the terms of the GNU Public License.
*/
#ifndef _ss_ss_internal_h
-1999-07-18 Theodore Ts'o <tytso@rsts-11.mit.edu>
+1999-09-08 <tytso@valinux.com>
+
+ * partinfo.c: Fix minor compilation bugs pointed out by Yann
+ Dirson.
+
+ * mke2fs.c: Don't turn on sparse superblocks by default on pre-2.2
+ kernels.
+
+ * mke2fs.8.in: Add the possible valid block sizes for mke2fs.
+ Document the -n flag, and the new defaults for the -s
+ flag.
+
+ * dumpe2fs.c, dumpe2fs.8.in: Add new options -f (force) and -h
+ (header-only).
+
+1999-08-13 <tytso@valinux.com>
+
+ * mke2fs.c (PRS): Fix logic for turning on/off the sparse
+ superblock option.
+
+1999-07-18 Theodore Ts'o <tytso@valinux.com>
* Release of E2fsprogs 1.15
.SH SYNOPSIS
.B dumpe2fs
[
-.B -b
+.B -bfhV
]
[
.B -ob superblock
[
.B -oB blocksize
]
-[
-.B -V
-]
device
.SH DESCRIPTION
.BI dumpe2fs
This option is not usually needed except by a filesystem wizard who
is examining the remains of a very badly corupted filesystem.
.TP
+.I -f
+force dumpe2fs to display a filesystem even though it may have some
+filesystem feature flags which dumpe2fs may not understand (and which
+can cause some of dumpe2fs's display to be suspect).
+.TP
+.I -h
+only display the superblock information and not any of the block
+group descriptor detail information.
+.TP
.I -V
print the version number of
.B dumpe2fs
int print_badblocks = 0;
int use_superblock = 0;
int use_blocksize = 0;
+ int force = 0;
+ int header_only = 0;
int big_endian;
int c;
if (argc && *argv)
program_name = *argv;
- while ((c = getopt (argc, argv, "bVo:")) != EOF) {
+ while ((c = getopt (argc, argv, "bfhVo:")) != EOF) {
switch (c) {
case 'b':
print_badblocks++;
break;
+ case 'f':
+ force++;
+ break;
+ case 'h':
+ header_only++;
+ break;
case 'o':
if (optarg[0] == 'b')
use_superblock = atoi(optarg+1);
device_name = argv[optind++];
if (use_superblock && !use_blocksize)
use_blocksize = 1024;
- retval = ext2fs_open (device_name, 0, use_superblock,
- use_blocksize, unix_io_manager, &fs);
+ retval = ext2fs_open (device_name, force ? EXT2_FLAG_FORCE : 0,
+ use_superblock, use_blocksize,
+ unix_io_manager, &fs);
if (retval) {
com_err (program_name, retval, "while trying to open %s",
device_name);
if (print_badblocks) {
dump_bad_blocks(fs);
} else {
+ big_endian = ((fs->flags & EXT2_FLAG_SWAP_BYTES) != 0);
+ if (!i386_byteorder())
+ big_endian = !big_endian;
+ if (big_endian)
+ printf("Note: This is a byte-swapped filesystem\n");
+ list_super (fs->super);
+ list_bad_blocks (fs);
+ if (header_only) {
+ ext2fs_close (fs);
+ exit (0);
+ }
retval = ext2fs_read_bitmaps (fs);
if (retval) {
com_err (program_name, retval,
ext2fs_close (fs);
exit (1);
}
- big_endian = ((fs->flags & EXT2_FLAG_SWAP_BYTES) != 0);
- if (!i386_byteorder())
- big_endian = !big_endian;
- if (big_endian)
- printf("Note: This is a byte-swapped filesystem\n");
- list_super (fs->super);
- list_bad_blocks (fs);
list_desc (fs);
}
ext2fs_close (fs);
.I number-of-inodes
]
[
+.B -n
+]
+[
.B \-m
.I reserved-blocks-percentage
]
.SH OPTIONS
.TP
.I -b block-size
-Specify the size of blocks in bytes.
+Specify the size of blocks in bytes. Valid block size vales are 1024,
+2048 and 4096 bytes per block.
.TP
.I -c
Check the device for bad blocks before creating the file system, using a
filesystem after it is created, so be careful decided the correct
value for this parameter.
.TP
+.I -n
+causes mke2fs to not actually create a filesystem, but display what it
+would do if it were to create a filesystem.
+.TP
.I -N number-of-inodes
overrides the default calculation of the number of inodes that should be
reserved for the filesystem (which is based on the number of blocks and
.I -s sparse-super-flag
If sparse-super-flag is 1, then turn on the sparse superblock flag.
If 0, then turn off the sparse superblock flag. (Currently, the sparse
-superblock flag defaults to off.)
+superblock flag is off by default if the kernel version is less than
+2.2; otherwise it defaults to on.)
.B Warning:
-The Linux 2.0 kernel does not properly support this feature. Neither do
-all Linux 2.1 kernels; please don't use this unless you know what you're
-doing!
+The Linux 2.0 kernel (and some Linux 2.1 kernel) does not properly
+support sparse superblocks. Filesystems that may need to mounted
+on pre-2.2 kernels should not be created with the sparse superblocks
+feature.
.TP
.I -v
Verbose execution.
#include <ctype.h>
#include <termios.h>
#include <time.h>
+#ifdef linux
+#include <sys/utsname.h>
+#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
/*
* This function sets the default parameters for a filesystem
*
- * The type is specified by the user. The size is minimum size for
- * which a set of parameters applies, with a size of zero meaning that
- * it is the default parameter for the type. Note that order is
- * important in the table below.
+ * The type is specified by the user. The size is the maximum size
+ * (in megabytes) for which a set of parameters applies, with a size
+ * of zero meaning that it is the default parameter for the type.
+ * Note that order is important in the table below.
*/
static char default_str[] = "default";
struct mke2fs_defaults {
char *raid_opts = 0;
char *fs_type = 0;
blk_t dev_size;
-
+#ifdef linux
+ struct utsname ut;
+
+ if (uname(&ut)) {
+ perror("uname");
+ exit(1);
+ }
+ if (ut.release[0] == '2' && ut.release[1] == '.' &&
+ ut.release[2] < '2' && ut.release[3] == '.')
+ sparse_option = 0;
+#endif
/* Update our PATH to include /sbin */
if (oldpath) {
char *newpath;
*/
param.s_r_blocks_count = (param.s_blocks_count * reserved_ratio) / 100;
- /*
- * If we are using revision #1, use the sparse super feature
- * by default
- */
#ifdef EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER
- if ((sparse_option == 1)
-#ifdef EXT2_DYNAMIC_REV
- || ((param.s_rev_level >= EXT2_DYNAMIC_REV) && (!sparse_option))
-#endif
- )
+ if (sparse_option)
param_ext2->s_feature_ro_compat |=
EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
#endif
#include <linux/hdreg.h>
#include <unistd.h>
#include <stdlib.h>
+#include <errno.h>
void print_error(char *operation, int error, char *device)
{
fd = open(argv[i], O_RDONLY);
if (fd < 0) {
- print_error("open", errno, argv[1]);
+ print_error("open", errno, argv[i]);
continue;
}
if (ioctl(fd, HDIO_GETGEO, &loc) < 0) {
- print_error("HDIO_GETGEO ioctl", errno, argv[1]);
+ print_error("HDIO_GETGEO ioctl", errno, argv[i]);
close(fd);
continue;
}
if (ioctl(fd, BLKGETSIZE, &size) < 0) {
- print_error("BLKGETSIZE ioctl", errno, argv[1]);
+ print_error("BLKGETSIZE ioctl", errno, argv[i]);
close(fd);
continue;
}