Whamcloud - gitweb
ChangeLog, dumpe2fs.8.in, dumpe2fs.c, mke2fs.8.in, mke2fs.c, partinfo.c:
authorTheodore Ts'o <tytso@mit.edu>
Tue, 14 Sep 1999 20:11:19 +0000 (20:11 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 14 Sep 1999 20:11:19 +0000 (20:11 +0000)
  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.

32 files changed:
lib/et/ChangeLog
lib/et/Makefile.in
lib/et/com_err.c
lib/et/error_message.c
lib/et/error_table.h
lib/et/et_name.c
lib/et/init_et.c
lib/et/internal.h
lib/et/mit-sipb-copyright.h [deleted file]
lib/ss/ChangeLog
lib/ss/Makefile.in
lib/ss/copyright.h [deleted file]
lib/ss/data.c
lib/ss/error.c
lib/ss/execute_cmd.c
lib/ss/help.c
lib/ss/invocation.c
lib/ss/list_rqs.c
lib/ss/listen.c
lib/ss/pager.c
lib/ss/parse.c
lib/ss/prompt.c
lib/ss/request_tbl.c
lib/ss/requests.c
lib/ss/ss.h
lib/ss/ss_internal.h
misc/ChangeLog
misc/dumpe2fs.8.in
misc/dumpe2fs.c
misc/mke2fs.8.in
misc/mke2fs.c
misc/partinfo.c

index f4634d6..4c2759e 100644 (file)
@@ -1,3 +1,8 @@
+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
index 2f55399..d7e16ff 100644 (file)
@@ -121,10 +121,9 @@ distclean:: clean
 # 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
index 8ee332a..bfa8dbc 100644 (file)
@@ -1,12 +1,11 @@
 /*
  * 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"
 
index 88ce15b..68d730c 100644 (file)
@@ -6,7 +6,7 @@
  * 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>
@@ -14,7 +14,6 @@
 #include <errno.h>
 #include "com_err.h"
 #include "error_table.h"
-#include "mit-sipb-copyright.h"
 #include "internal.h"
 
 static char buffer[25];
index ea79e72..76480e0 100644 (file)
@@ -2,7 +2,7 @@
  * 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
index cf3cd5c..652bdb0 100644 (file)
@@ -1,12 +1,11 @@
 /*
  * 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[] =
index 969ef36..42d8a42 100644 (file)
@@ -6,7 +6,7 @@
  * 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>
@@ -16,7 +16,6 @@
 #endif
 #include "com_err.h"
 #include "error_table.h"
-#include "mit-sipb-copyright.h"
 
 #ifndef __STDC__
 #define const
index 112c016..eee26b6 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * 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
diff --git a/lib/et/mit-sipb-copyright.h b/lib/et/mit-sipb-copyright.h
deleted file mode 100644 (file)
index 2f7eb29..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-
-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.
-
-*/
-
index 6e57fb5..c56ac42 100644 (file)
@@ -1,3 +1,8 @@
+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
index 63b997e..87825c7 100644 (file)
@@ -91,10 +91,10 @@ MKCMDSFILES=        mk_cmds.c utils.c options.c ct.y cmd_tbl.lex.l
 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
 
@@ -104,7 +104,7 @@ CFILES=     $(SRCS) $(MKCMDSCSRCS) test_ss.c
 
 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
 
@@ -133,13 +133,13 @@ installdirs::
                $(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
@@ -166,26 +166,26 @@ distclean:: clean
 # 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
diff --git a/lib/ss/copyright.h b/lib/ss/copyright.h
deleted file mode 100644 (file)
index e0d1572..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-
-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.
-
-*/
-
index 45e49d7..b2ac631 100644 (file)
@@ -2,12 +2,11 @@
  * 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";
index 7f2e96f..47f32a5 100644 (file)
@@ -2,7 +2,7 @@
  * 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>
@@ -18,7 +18,6 @@
 #define ss_error ss_error_external
 #endif
 
-#include "copyright.h"
 #include <com_err.h>
 #include "ss_internal.h"
 
index 74b5969..c274882 100644 (file)
@@ -1,14 +1,13 @@
 /*
  * 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>
 
 /*
index 5a17164..cbbe543 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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
@@ -25,7 +25,6 @@ extern int errno;
 #endif
 #include <sys/wait.h>
 #include "ss_internal.h"
-#include "copyright.h"
 
 void ss_help (argc, argv, sci_idx, info_ptr)
     int argc;
index c4aecf1..582240f 100644 (file)
@@ -1,14 +1,13 @@
 /*
  * 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,
index 5a9abe5..3a2925b 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * 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>
index aab8733..a18fc85 100644 (file)
@@ -6,10 +6,9 @@
  * 
  * 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>
index 1a70773..ddfdb40 100644 (file)
@@ -4,7 +4,7 @@
  *
  * 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
@@ -17,7 +17,6 @@ extern int errno;
 #endif
 
 #include "ss_internal.h"
-#include "copyright.h"
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/file.h>
index 80175d3..df420aa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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
@@ -13,7 +13,6 @@
 #endif
 
 #include "ss_internal.h"
-#include "copyright.h"
 
 enum parse_mode { WHITESPACE, TOKEN, QUOTED_STRING };
 
index 67d79eb..d56d2ff 100644 (file)
@@ -6,10 +6,9 @@
  *
  * 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"
 
index e1cbfe8..0b04185 100644 (file)
@@ -1,14 +1,13 @@
 /*
  * 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... */
index c214213..6ff4d09 100644 (file)
@@ -3,10 +3,9 @@
  *
  * 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"
 
index 104e038..0e9a64b 100644 (file)
@@ -1,13 +1,12 @@
 /*
  * 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__
index 3bd5987..9f959ff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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
index 9356dae..c919cfb 100644 (file)
@@ -1,4 +1,24 @@
-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
 
index d7d4149..1dac7e3 100644 (file)
@@ -8,7 +8,7 @@ dumpe2fs \- dump filesystem information
 .SH SYNOPSIS
 .B dumpe2fs
 [
-.B -b
+.B -bfhV
 ]
 [
 .B -ob superblock
@@ -16,9 +16,6 @@ dumpe2fs \- dump filesystem information
 [
 .B -oB blocksize
 ]
-[
-.B -V
-]
 device
 .SH DESCRIPTION
 .BI dumpe2fs
@@ -45,6 +42,15 @@ use the blocksize specified on the command line when examining the filesystem.
 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
index e4ff27a..da02512 100644 (file)
@@ -180,6 +180,8 @@ int main (int argc, char ** argv)
        int             print_badblocks = 0;
        int             use_superblock = 0;
        int             use_blocksize = 0;
+       int             force = 0;
+       int             header_only = 0;
        int             big_endian;
        int             c;
 
@@ -190,11 +192,17 @@ int main (int argc, char ** argv)
        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);
@@ -217,8 +225,9 @@ int main (int argc, char ** argv)
        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);
@@ -228,6 +237,17 @@ int main (int argc, char ** argv)
        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,
@@ -236,13 +256,6 @@ int main (int argc, char ** argv)
                        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);
index 4e0a3d9..62725e4 100644 (file)
@@ -33,6 +33,9 @@ mke2fs \- create a Linux second extended file system
 .I number-of-inodes
 ]
 [
+.B -n
+]
+[
 .B \-m
 .I reserved-blocks-percentage
 ]
@@ -95,7 +98,8 @@ automagically figures the file system size.
 .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
@@ -117,6 +121,10 @@ Be warned that is not possible to expand the number of inodes on 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 
@@ -151,11 +159,13 @@ is run in a script.
 .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.
index d552993..c8ac45e 100644 (file)
@@ -21,6 +21,9 @@
 #include <ctype.h>
 #include <termios.h>
 #include <time.h>
+#ifdef linux
+#include <sys/utsname.h>
+#endif
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #endif
@@ -190,10 +193,10 @@ static void check_mount(NOARGS)
 /*
  * 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 {
@@ -716,7 +719,17 @@ static void PRS(int argc, char *argv[])
        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;
@@ -936,16 +949,8 @@ static void PRS(int argc, char *argv[])
         */
        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
index c85f30e..6ae850f 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/hdreg.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <errno.h>
 
 void print_error(char *operation, int error, char *device)
 {
@@ -40,19 +41,19 @@ int main(int argc, char **argv)
                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;
                }