From 2740156bd12747389eaf745529653b26a3a9d73d Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 14 Sep 1999 20:11:19 +0000 Subject: [PATCH] ChangeLog, dumpe2fs.8.in, dumpe2fs.c, mke2fs.8.in, mke2fs.c, partinfo.c: 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. --- lib/et/ChangeLog | 5 +++++ lib/et/Makefile.in | 11 +++++------ lib/et/com_err.c | 3 +-- lib/et/error_message.c | 3 +-- lib/et/error_table.h | 2 +- lib/et/et_name.c | 3 +-- lib/et/init_et.c | 3 +-- lib/et/internal.h | 3 ++- lib/et/mit-sipb-copyright.h | 19 ------------------- lib/ss/ChangeLog | 5 +++++ lib/ss/Makefile.in | 44 ++++++++++++++++++++++---------------------- lib/ss/copyright.h | 19 ------------------- lib/ss/data.c | 3 +-- lib/ss/error.c | 3 +-- lib/ss/execute_cmd.c | 3 +-- lib/ss/help.c | 3 +-- lib/ss/invocation.c | 3 +-- lib/ss/list_rqs.c | 3 +-- lib/ss/listen.c | 3 +-- lib/ss/pager.c | 3 +-- lib/ss/parse.c | 3 +-- lib/ss/prompt.c | 3 +-- lib/ss/request_tbl.c | 3 +-- lib/ss/requests.c | 3 +-- lib/ss/ss.h | 3 +-- lib/ss/ss_internal.h | 2 +- misc/ChangeLog | 22 +++++++++++++++++++++- misc/dumpe2fs.8.in | 14 ++++++++++---- misc/dumpe2fs.c | 33 +++++++++++++++++++++++---------- misc/mke2fs.8.in | 20 +++++++++++++++----- misc/mke2fs.c | 33 +++++++++++++++++++-------------- misc/partinfo.c | 7 ++++--- 32 files changed, 150 insertions(+), 140 deletions(-) delete mode 100644 lib/et/mit-sipb-copyright.h delete mode 100644 lib/ss/copyright.h diff --git a/lib/et/ChangeLog b/lib/et/ChangeLog index f4634d6..4c2759e 100644 --- a/lib/et/ChangeLog +++ b/lib/et/ChangeLog @@ -1,3 +1,8 @@ +1999-09-07 + + * Updated copyright statements to reflect the GPL with permission + of the original authors. + 1999-07-18 Theodore Ts'o * Release of E2fsprogs 1.15 diff --git a/lib/et/Makefile.in b/lib/et/Makefile.in index 2f55399..d7e16ff 100644 --- a/lib/et/Makefile.in +++ b/lib/et/Makefile.in @@ -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 diff --git a/lib/et/com_err.c b/lib/et/com_err.c index 8ee332a..bfa8dbc 100644 --- a/lib/et/com_err.c +++ b/lib/et/com_err.c @@ -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 #include "com_err.h" -#include "mit-sipb-copyright.h" #include "error_table.h" #include "internal.h" diff --git a/lib/et/error_message.c b/lib/et/error_message.c index 88ce15b..68d730c 100644 --- a/lib/et/error_message.c +++ b/lib/et/error_message.c @@ -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 @@ -14,7 +14,6 @@ #include #include "com_err.h" #include "error_table.h" -#include "mit-sipb-copyright.h" #include "internal.h" static char buffer[25]; diff --git a/lib/et/error_table.h b/lib/et/error_table.h index ea79e72..76480e0 100644 --- a/lib/et/error_table.h +++ b/lib/et/error_table.h @@ -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 diff --git a/lib/et/et_name.c b/lib/et/et_name.c index cf3cd5c..652bdb0 100644 --- a/lib/et/et_name.c +++ b/lib/et/et_name.c @@ -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[] = diff --git a/lib/et/init_et.c b/lib/et/init_et.c index 969ef36..42d8a42 100644 --- a/lib/et/init_et.c +++ b/lib/et/init_et.c @@ -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 @@ -16,7 +16,6 @@ #endif #include "com_err.h" #include "error_table.h" -#include "mit-sipb-copyright.h" #ifndef __STDC__ #define const diff --git a/lib/et/internal.h b/lib/et/internal.h index 112c016..eee26b6 100644 --- a/lib/et/internal.h +++ b/lib/et/internal.h @@ -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 index 2f7eb29..0000000 --- a/lib/et/mit-sipb-copyright.h +++ /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. - -*/ - diff --git a/lib/ss/ChangeLog b/lib/ss/ChangeLog index 6e57fb5..c56ac42 100644 --- a/lib/ss/ChangeLog +++ b/lib/ss/ChangeLog @@ -1,3 +1,8 @@ +1999-09-07 + + * Updated copyright statements to reflect the GPL with permission + of the original authors. + 1999-07-18 Theodore Ts'o * Release of E2fsprogs 1.15 diff --git a/lib/ss/Makefile.in b/lib/ss/Makefile.in index 63b997e..87825c7 100644 --- a/lib/ss/Makefile.in +++ b/lib/ss/Makefile.in @@ -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 index e0d1572..0000000 --- a/lib/ss/copyright.h +++ /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. - -*/ - diff --git a/lib/ss/data.c b/lib/ss/data.c index 45e49d7..b2ac631 100644 --- a/lib/ss/data.c +++ b/lib/ss/data.c @@ -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 #include "ss_internal.h" -#include "copyright.h" static const char copyright[] = "Copyright 1987, 1988, 1989 by the Massachusetts Institute of Technology"; diff --git a/lib/ss/error.c b/lib/ss/error.c index 7f2e96f..47f32a5 100644 --- a/lib/ss/error.c +++ b/lib/ss/error.c @@ -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 @@ -18,7 +18,6 @@ #define ss_error ss_error_external #endif -#include "copyright.h" #include #include "ss_internal.h" diff --git a/lib/ss/execute_cmd.c b/lib/ss/execute_cmd.c index 74b5969..c274882 100644 --- a/lib/ss/execute_cmd.c +++ b/lib/ss/execute_cmd.c @@ -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 #endif #include "ss_internal.h" -#include "copyright.h" #include /* diff --git a/lib/ss/help.c b/lib/ss/help.c index 5a17164..cbbe543 100644 --- a/lib/ss/help.c +++ b/lib/ss/help.c @@ -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 #include "ss_internal.h" -#include "copyright.h" void ss_help (argc, argv, sci_idx, info_ptr) int argc; diff --git a/lib/ss/invocation.c b/lib/ss/invocation.c index c4aecf1..582240f 100644 --- a/lib/ss/invocation.c +++ b/lib/ss/invocation.c @@ -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 #endif #include "ss_internal.h" -#include "copyright.h" #define size sizeof(ss_data *) int ss_create_invocation(subsystem_name, version_string, info_ptr, diff --git a/lib/ss/list_rqs.c b/lib/ss/list_rqs.c index 5a9abe5..3a2925b 100644 --- a/lib/ss/list_rqs.c +++ b/lib/ss/list_rqs.c @@ -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 #include diff --git a/lib/ss/listen.c b/lib/ss/listen.c index aab8733..a18fc85 100644 --- a/lib/ss/listen.c +++ b/lib/ss/listen.c @@ -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 #include diff --git a/lib/ss/pager.c b/lib/ss/pager.c index 1a70773..ddfdb40 100644 --- a/lib/ss/pager.c +++ b/lib/ss/pager.c @@ -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 #include #include diff --git a/lib/ss/parse.c b/lib/ss/parse.c index 80175d3..df420aa 100644 --- a/lib/ss/parse.c +++ b/lib/ss/parse.c @@ -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 }; diff --git a/lib/ss/prompt.c b/lib/ss/prompt.c index 67d79eb..d56d2ff 100644 --- a/lib/ss/prompt.c +++ b/lib/ss/prompt.c @@ -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 #include "ss_internal.h" diff --git a/lib/ss/request_tbl.c b/lib/ss/request_tbl.c index e1cbfe8..0b04185 100644 --- a/lib/ss/request_tbl.c +++ b/lib/ss/request_tbl.c @@ -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 #endif -#include "copyright.h" #include "ss_internal.h" #define ssrt ss_request_table /* for some readable code... */ diff --git a/lib/ss/requests.c b/lib/ss/requests.c index c214213..6ff4d09 100644 --- a/lib/ss/requests.c +++ b/lib/ss/requests.c @@ -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 #include "ss_internal.h" diff --git a/lib/ss/ss.h b/lib/ss/ss.h index 104e038..0e9a64b 100644 --- a/lib/ss/ss.h +++ b/lib/ss/ss.h @@ -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 #include #ifdef __STDC__ diff --git a/lib/ss/ss_internal.h b/lib/ss/ss_internal.h index 3bd5987..9f959ff 100644 --- a/lib/ss/ss_internal.h +++ b/lib/ss/ss_internal.h @@ -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 diff --git a/misc/ChangeLog b/misc/ChangeLog index 9356dae..c919cfb 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,4 +1,24 @@ -1999-07-18 Theodore Ts'o +1999-09-08 + + * 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 + + * mke2fs.c (PRS): Fix logic for turning on/off the sparse + superblock option. + +1999-07-18 Theodore Ts'o * Release of E2fsprogs 1.15 diff --git a/misc/dumpe2fs.8.in b/misc/dumpe2fs.8.in index d7d4149..1dac7e3 100644 --- a/misc/dumpe2fs.8.in +++ b/misc/dumpe2fs.8.in @@ -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 diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index e4ff27a..da02512 100644 --- a/misc/dumpe2fs.c +++ b/misc/dumpe2fs.c @@ -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); diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in index 4e0a3d9..62725e4 100644 --- a/misc/mke2fs.8.in +++ b/misc/mke2fs.8.in @@ -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. diff --git a/misc/mke2fs.c b/misc/mke2fs.c index d552993..c8ac45e 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -21,6 +21,9 @@ #include #include #include +#ifdef linux +#include +#endif #ifdef HAVE_GETOPT_H #include #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 diff --git a/misc/partinfo.c b/misc/partinfo.c index c85f30e..6ae850f 100644 --- a/misc/partinfo.c +++ b/misc/partinfo.c @@ -14,6 +14,7 @@ #include #include #include +#include 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; } -- 1.8.3.1