aboutsummaryrefslogtreecommitdiff
path: root/sysutils/e2fsprogs
diff options
context:
space:
mode:
authorYen-Ming Lee <leeym@FreeBSD.org>2006-07-04 15:47:51 +0000
committerYen-Ming Lee <leeym@FreeBSD.org>2006-07-04 15:47:51 +0000
commitadcead7ff1903ae9292f48c23a6c31ad6934d5ee (patch)
tree76a04f17c1d87f1defe727ff4e852932460f01d1 /sysutils/e2fsprogs
parent4245abe9a3cc45397f316295b5c436b608d5b726 (diff)
downloadports-adcead7ff1903ae9292f48c23a6c31ad6934d5ee.tar.gz
ports-adcead7ff1903ae9292f48c23a6c31ad6934d5ee.zip
Notes
Diffstat (limited to 'sysutils/e2fsprogs')
-rw-r--r--sysutils/e2fsprogs/Makefile5
-rw-r--r--sysutils/e2fsprogs/files/fsck_ext2fs.896
-rw-r--r--sysutils/e2fsprogs/files/fsck_ext2fs.c10
3 files changed, 106 insertions, 5 deletions
diff --git a/sysutils/e2fsprogs/Makefile b/sysutils/e2fsprogs/Makefile
index d845511de283..4fc77bf286db 100644
--- a/sysutils/e2fsprogs/Makefile
+++ b/sysutils/e2fsprogs/Makefile
@@ -7,7 +7,7 @@
PORTNAME= e2fsprogs
PORTVERSION= 1.39
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES?= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -41,7 +41,7 @@ MAN5= e2fsck.conf.5 mke2fs.conf.5
MAN8= badblocks.8 debugfs.8 dumpe2fs.8 e2fsck.8 e2image.8 e2label.8 \
mke2fs.8 mklost+found.8 resize2fs.8 tune2fs.8 \
fsck.ext2.8 fsck.ext3.8 mkfs.ext2.8 mkfs.ext3.8 \
- findfs.8 blkid.8 logsave.8
+ findfs.8 blkid.8 logsave.8 fsck_ext2fs.8
pre-build:
@${ECHO_CMD} "-------------------------------------------------------------"
@@ -89,6 +89,7 @@ post-install:
${RM} ${PREFIX}/man/man8/filefrag.8
${RM} ${PREFIX}/info/libext2fs.info.gz
${INSTALL_PROGRAM} ${WRKSRC}/fsck_ext2fs ${PREFIX}/sbin/
+ ${INSTALL_MAN} ${FILESDIR}/fsck_ext2fs.8 ${PREFIX}/man/man8/
[ -f ${PREFIX}/etc/mke2fs.conf ] || \
${CP} -p ${PREFIX}/etc/mke2fs.conf.dist ${PREFIX}/etc/mke2fs.conf
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
diff --git a/sysutils/e2fsprogs/files/fsck_ext2fs.8 b/sysutils/e2fsprogs/files/fsck_ext2fs.8
new file mode 100644
index 000000000000..d208ecf95800
--- /dev/null
+++ b/sysutils/e2fsprogs/files/fsck_ext2fs.8
@@ -0,0 +1,96 @@
+.TH fsck_ext2fs 8 2006-07-02 "Matthias Andree" "FreeBSD Ports"
+.\"
+.\" fsck_ext2fs.8 - manual page for fsck_ext2fs wrapper
+.\"
+.\" (C) Copyright 2006 by Matthias Andree <matthias.andree@gmx.de>
+.\"
+.\" License: This file may be redistributed in accordance with the terms
+.\" of the GNU General Public License v2.
+.\"
+.\" Upstream $Id: fsck_ext2fs.8,v 1.3 2006/07/02 11:45:21 emma Exp $
+.\" $FreeBSD$
+.\"
+.SH NAME
+.B fsck_ext2fs
+\- compatibility wrapper for e2fsck
+.SH SYNOPSIS
+.P
+.B fsck_ext2fs
+[\fB\-Fpfnyv\fR] [\fB\-b\fR \fIblock\fR]
+.SH DESCRIPTION
+.P
+\fBfsck_ext2fs\fR maps the traditional FreeBSD \fBfsck_ffs\fR options to
+options with the same functionality for \fBe2fsck,\fR runs \fBe2fsck\fR
+and then maps its exit status to values that FreeBSD understands.
+\fBe2fsck\fR is a utility to check and repair ext2 and ext3 file
+systems.
+
+.SH OPTIONS
+.IP \fB\-F\fR
+(check foreground mode required) Immediately exits with status 1 to tell
+\fBfsck\fR that ext2fs cannot be checked in the background. \fBfsck\fR
+usually runs \fBfsck_*\fR programs twice, first with \fB\-F\fR to find
+out if they can do background checking, then either immediately without
+\fB\-F\fR for foreground checking or deferred in the background with
+\fB\-B\fR.
+.IP \fB\-p\fR
+(preen mode) This option suppresses adding the \fB\-f\fR option (unless
+\fB\-f\fR is also given) and adds the \fB\-p\fR option to the
+\fBe2fsck\fR command line. This causes \fBe2fsck\fR to automatically fix
+any filesystem problems that can safely be fixed without operator
+intervention. Without this option given, \fBe2fsck\fR will be run with
+the \fB\-f\fR option to force a check, since interactive scan and repair
+mode is the default on FreeBSD, but not on Linux where \fBe2fsck\fR
+comes from.
+.IP \fB\-f\fR
+(force check) This option forces the check of a clean file system while
+preening and is passed to \fBe2fsck\fR verbatim.
+.IP \fB\-n\fR
+("no" mode) This option causes the file system to be opened in read-only
+mode and assume "no" as answer to all questions. This is the only way to
+safely run \fBfsck\fR on a mounted ext2 or ext3 file system. This option
+is passed to \fBe2fsck\fR verbatim.
+.IP \fB\-y\fR
+("yes" mode) This option is passed verbatim to \fBe2fsck\fR and causes
+it to assume "yes" as answer to all questions. This allows the
+non-interactive use of e2fsck but is rather aggressive. Use with care.
+.IP \fB\-v\fR
+(verbose output) This option is passed verbatim to \fBe2fsck\fR and
+causes it to verbosely report its progress.
+.IP "\fB\-b\fR \fIblock\fR"
+(use alternate super block) This option is passed verbatim to
+\fBe2fsck\fR and selects an alternate super block, for use when the
+primary super block has been damaged. Please see the \fBe2fsck\fR(8)
+manual page for details.
+
+.SH EXIT STATUS
+If errors remain after \fBe2fsck\fR, an invalid option or too many
+options have been specified, \fBe2fsck\fR was killed with a signal or
+the \fIfork\fB system call failed, \fBfsck_ext2fs\fR exits with status
+EXIT_FAILURE (usually 1). If \fBe2fsck\fR cannot be started, exits with
+status 127. If the file system is clean after \fBe2fsck\fR operation,
+exits with status EXIT_SUCCESS (0).
+
+.SH NOTES
+.P
+This utility is merely meant as an adaptor so that \fBe2fsck\fR can be
+run during the boot process, it does not support all options that
+\fBe2fsck\fR offers. If you need one of its advanced options, please run
+\fBe2fsck\fR directly.
+
+.SH FILES
+.TP
+.I /sbin/e2fsck
+is the location of the \fBe2fsck\fR program to run.
+
+.SH AUTHOR
+.P
+Matthias Andree <matthias.andree@gmx.de> wrote the program and this
+manual page.
+.SH CONFORMING TO
+The FreeBSD 6.1 command line interface for \fBfsck_ufs\fR(8).
+.SH SEE ALSO
+.BR fsck (8),
+.BR e2fsck (8)
+and
+.BR fsck_ufs (8).
diff --git a/sysutils/e2fsprogs/files/fsck_ext2fs.c b/sysutils/e2fsprogs/files/fsck_ext2fs.c
index 9856530c7453..288b49f6540f 100644
--- a/sysutils/e2fsprogs/files/fsck_ext2fs.c
+++ b/sysutils/e2fsprogs/files/fsck_ext2fs.c
@@ -1,12 +1,12 @@
/*
* fsck_ext2fs - wrapper for e2fsck on FreeBSD
- * Copyright (C) 2004 Matthias Andree
+ * Copyright (C) 2004,2006 Matthias Andree <matthias.andree@gmx.de>
* redistributable in accordance with the
* GNU General Public License v2
*
* $FreeBSD$
*
- * Upstream: $Id: fsck_ext2fs.c,v 1.4 2004/03/20 15:51:01 emma Exp $
+ * Upstream: $Id: fsck_ext2fs.c,v 1.6 2006/07/02 11:37:49 emma Exp $
*
* format: gindent -kr
*/
@@ -57,8 +57,12 @@ int main(int argc, char **argv)
case 'v':
verbose++;
break;
- case 'B':
case 'F':
+ /* e2fsck does not support background checking,
+ * hence exit with nonzero status to force
+ * the foreground check. */
+ exit(1);
+ case 'B':
default:
fprintf(stderr, "%s: unknown option -%c\n",
argv[0], optopt);