summaryrefslogtreecommitdiff
path: root/sys-fs/e2fsprogs/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-fs/e2fsprogs/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/e2fsprogs/files')
-rw-r--r--sys-fs/e2fsprogs/files/e2fsck.conf6
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch11
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch10
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.42.13-fix-build-cflags.patch13
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.43-sysmacros.patch125
-rw-r--r--sys-fs/e2fsprogs/files/fsck_ext2fs.896
-rw-r--r--sys-fs/e2fsprogs/files/fsck_ext2fs.c147
7 files changed, 408 insertions, 0 deletions
diff --git a/sys-fs/e2fsprogs/files/e2fsck.conf b/sys-fs/e2fsprogs/files/e2fsck.conf
new file mode 100644
index 000000000000..401cec45eec1
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsck.conf
@@ -0,0 +1,6 @@
+# See the e2fsck.conf man page for more info
+
+[options]
+
+# allow fsck to run sanely at any point in time #142850
+buggy_init_scripts = yes
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch
new file mode 100644
index 000000000000..7d0919600d05
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch
@@ -0,0 +1,11 @@
+--- a/lib/ext2fs/ext2_fs.h
++++ b/lib/ext2fs/ext2_fs.h
+@@ -414,7 +414,7 @@
+
+ #define i_size_high i_dir_acl
+
+-#if defined(__KERNEL__) || defined(__linux__)
++#if defined(__KERNEL__) || defined(__linux__) || defined(__FreeBSD__)
+ #define i_reserved1 osd1.linux1.l_i_reserved1
+ #define i_frag osd2.linux2.l_i_frag
+ #define i_fsize osd2.linux2.l_i_fsize
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch
new file mode 100644
index 000000000000..b7d3d96856b5
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch
@@ -0,0 +1,10 @@
+--- e2fsprogs-1.41.5/Makefile.in
++++ e2fsprogs-1.41.5/Makefile.in
+@@ -281,6 +66,7 @@
+ uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
+
+ install-libs: install-libs-recursive
++install-libs-recursive: | install-shlibs-libs-recursive
+
+ uninstall-libs: uninstall-libs-recursive
+
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.42.13-fix-build-cflags.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.42.13-fix-build-cflags.patch
new file mode 100644
index 000000000000..dcab9a34de09
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.42.13-fix-build-cflags.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/516854
+
+--- e2fsprogs-1.42.13/configure
++++ e2fsprogs-1.42.13/configure
+@@ -1315,6 +1315,8 @@
+ if test $cross_compiling = no; then
+ BUILD_CFLAGS="$CFLAGS $CPPFLAGS $INCLUDES -DHAVE_CONFIG_H"
+ BUILD_LDFLAGS="$LDFLAGS"
++else
++ BUILD_CFLAGS="$INCLUDES"
+ fi
+
+
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.43-sysmacros.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.43-sysmacros.patch
new file mode 100644
index 000000000000..2dbb40c1bd6e
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.43-sysmacros.patch
@@ -0,0 +1,125 @@
+From 30ef41f68703b6a16027cc8787118b87f1462dff Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 28 Mar 2016 20:31:33 -0400
+Subject: [PATCH e2fsprogs] include sys/sysmacros.h as needed
+
+The minor/major/makedev macros are not entirely standard. glibc has had
+the definitions in sys/sysmacros.h since the start, and wants to move away
+from always defining them implicitly via sys/types.h (as this pollutes the
+namespace in violation of POSIX). Other C libraries have already dropped
+them. Since the configure script already checks for this header, use that
+to pull in the header in files that use these macros.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ debugfs/debugfs.c | 3 +++
+ lib/blkid/devname.c | 3 +++
+ lib/blkid/devno.c | 3 +++
+ lib/ext2fs/finddev.c | 3 +++
+ lib/ext2fs/ismounted.c | 3 +++
+ misc/create_inode.c | 4 ++++
+ misc/mk_hugefiles.c | 3 +++
+ 7 files changed, 22 insertions(+)
+
+diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
+index ba8be40..7d481bc 100644
+--- a/debugfs/debugfs.c
++++ b/debugfs/debugfs.c
+@@ -26,6 +26,9 @@ extern char *optarg;
+ #include <errno.h>
+ #endif
+ #include <fcntl.h>
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+
+ #include "debugfs.h"
+ #include "uuid/uuid.h"
+diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c
+index 3e2efa9..671e781 100644
+--- a/lib/blkid/devname.c
++++ b/lib/blkid/devname.c
+@@ -36,6 +36,9 @@
+ #if HAVE_SYS_MKDEV_H
+ #include <sys/mkdev.h>
+ #endif
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+ #include <time.h>
+
+ #include "blkidP.h"
+diff --git a/lib/blkid/devno.c b/lib/blkid/devno.c
+index 479d977..61e6fc7 100644
+--- a/lib/blkid/devno.c
++++ b/lib/blkid/devno.c
+@@ -31,6 +31,9 @@
+ #if HAVE_SYS_MKDEV_H
+ #include <sys/mkdev.h>
+ #endif
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+
+ #include "blkidP.h"
+
+diff --git a/lib/ext2fs/finddev.c b/lib/ext2fs/finddev.c
+index 311608d..62fa0db 100644
+--- a/lib/ext2fs/finddev.c
++++ b/lib/ext2fs/finddev.c
+@@ -31,6 +31,9 @@
+ #if HAVE_SYS_MKDEV_H
+ #include <sys/mkdev.h>
+ #endif
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+
+ #include "ext2_fs.h"
+ #include "ext2fs.h"
+diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c
+index e0f69dd..7404996 100644
+--- a/lib/ext2fs/ismounted.c
++++ b/lib/ext2fs/ismounted.c
+@@ -49,6 +49,9 @@
+ #if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+
+ #include "ext2_fs.h"
+ #include "ext2fs.h"
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index 4dbd8e5..98aeb41 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -22,6 +22,10 @@
+ #include <attr/xattr.h>
+ #endif
+ #include <sys/ioctl.h>
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
++
+ #include <ext2fs/ext2fs.h>
+ #include <ext2fs/ext2_types.h>
+ #include <ext2fs/fiemap.h>
+diff --git a/misc/mk_hugefiles.c b/misc/mk_hugefiles.c
+index 71a15c5..00e95cd 100644
+--- a/misc/mk_hugefiles.c
++++ b/misc/mk_hugefiles.c
+@@ -35,6 +35,9 @@ extern int optind;
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+ #include <libgen.h>
+ #include <limits.h>
+ #include <blkid/blkid.h>
+--
+2.8.2
+
diff --git a/sys-fs/e2fsprogs/files/fsck_ext2fs.8 b/sys-fs/e2fsprogs/files/fsck_ext2fs.8
new file mode 100644
index 000000000000..aa31cf1db172
--- /dev/null
+++ b/sys-fs/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: ports/sysutils/e2fsprogs/files/fsck_ext2fs.8,v 1.1 2006/07/04 15:47:51 leeym Exp $
+.\"
+.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/sys-fs/e2fsprogs/files/fsck_ext2fs.c b/sys-fs/e2fsprogs/files/fsck_ext2fs.c
new file mode 100644
index 000000000000..f5e3e5e9a8c9
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/fsck_ext2fs.c
@@ -0,0 +1,147 @@
+/*
+ * fsck_ext2fs - wrapper for e2fsck on FreeBSD
+ * Copyright (C) 2004,2006 Matthias Andree <matthias.andree@gmx.de>
+ * redistributable in accordance with the
+ * GNU General Public License v2
+ *
+ * $FreeBSD: ports/sysutils/e2fsprogs/files/fsck_ext2fs.c,v 1.5 2006/07/04 15:47:51 leeym Exp $
+ *
+ * Upstream: $Id: fsck_ext2fs.c,v 1.6 2006/07/02 11:37:49 emma Exp $
+ *
+ * format: gindent -kr
+ */
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <errno.h>
+
+__attribute__ ((noreturn))
+static int die(const char *tag)
+{
+ perror(tag);
+ exit(EXIT_FAILURE);
+}
+
+int main(int argc, char **argv)
+{
+ int ch, i = 1, force = 0, status, verbose = 0, t;
+ long block = 0;
+ enum { normal, preen, yes, no } mode = normal;
+ char *cmd[256];
+ pid_t pid;
+
+ cmd[0] = "/sbin/e2fsck";
+ while ((ch = getopt(argc, argv, "BFpfnyb:v")) != -1) {
+ switch (ch) {
+ case 'p':
+ mode = preen;
+ break;
+ case 'f':
+ force = 1;
+ break;
+ case 'n':
+ mode = no;
+ break;
+ case 'y':
+ mode = yes;
+ break;
+ case 'b':
+ block = atol(optarg);
+ break;
+ case 'v':
+ verbose++;
+ break;
+ 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);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (force)
+ cmd[i++] = "-f";
+
+ switch (mode) {
+ case normal:
+ /* FreeBSD needs -f to force a check only in context
+ * with -p -- so map normal to force to match
+ * expectations */
+ if (!force)
+ cmd[i++] = "-f";
+ break;
+ case yes:
+ cmd[i++] = "-y";
+ break;
+ case no:
+ cmd[i++] = "-n";
+ break;
+ case preen:
+ cmd[i++] = "-p";
+ break;
+ }
+
+ if (block) {
+ static char b[30];
+
+ sprintf(b, "-b %ld", block);
+ cmd[i++] = b;
+ }
+
+ /* silently limit verbose to 15 so we don't overflow the cmd array */
+ if (verbose > 15)
+ verbose = 15;
+
+ for (t = verbose; t > 1; t--)
+ cmd[i++] = "-v";
+
+ while (optind < argc) {
+ cmd[i++] = argv[optind++];
+ /* sanity check so we don't overflow the cmd buffer */
+ if (i+1 == sizeof(cmd)/sizeof(cmd[0])) {
+ errno = E2BIG;
+ die(argv[0]);
+ }
+ }
+
+ cmd[i++] = 0;
+
+ if (verbose) {
+ for (i=0; cmd[i]; i++)
+ fputs(cmd[i], stderr),
+ fputc(' ', stderr);
+ fputc('\n', stderr);
+ }
+
+ pid = fork();
+ switch (pid) {
+ case -1:
+ /* error */
+ die("fork");
+ break;
+ case 0:
+ /* child */
+ (void) execv(cmd[0], cmd);
+ perror("execve");
+ _exit(127);
+ default:
+ /* parent */
+ if (pid != waitpid(pid, &status, 0))
+ die("waitpid");
+ if (WIFSIGNALED(status)
+ || (WIFEXITED(status) && WEXITSTATUS(status) >= 4))
+ exit(EXIT_FAILURE);
+ }
+ exit(EXIT_SUCCESS);
+}