Revert "mount: enable fstab.d"
See discussion at https://lkml.org/lkml/2012/1/20/104
This reverts commit d8ebc83ff2
.
This commit is contained in:
parent
60a2a323f5
commit
b9f23bf7ff
|
@ -45,11 +45,9 @@
|
|||
fstab \- static information about the filesystems
|
||||
.SH SYNOPSIS
|
||||
.B /etc/fstab
|
||||
.sp
|
||||
.B /etc/fstab.d
|
||||
.SH DESCRIPTION
|
||||
The file
|
||||
.B /etc/fstab
|
||||
.B fstab
|
||||
contains descriptive information about the various file systems.
|
||||
.B fstab
|
||||
is only read by programs, and not written; it is the duty of the system
|
||||
|
@ -67,20 +65,6 @@ sequentially iterate through
|
|||
.B fstab
|
||||
doing their thing.
|
||||
|
||||
The directory
|
||||
.B /etc/fstab.d
|
||||
is optional and contains fstab-like files. All files without .fstab extension or with '.' prefix
|
||||
are ignored. The directory
|
||||
.B /etc/fstab.d
|
||||
is supported by
|
||||
.BR mount (8)
|
||||
and
|
||||
.BR umount (8)
|
||||
programs only if linked with libmount. The files in the directory are parsed in
|
||||
order defined by
|
||||
.BR strverscmp (3)
|
||||
function. The command \fBfindmnt --fstab\fP returns complete list of the filesystems.
|
||||
|
||||
.B The first field
|
||||
.RI ( fs_spec ).
|
||||
.RS
|
||||
|
@ -260,7 +244,6 @@ or
|
|||
.SH "SEE ALSO"
|
||||
.BR mount (8),
|
||||
.BR swapon (8),
|
||||
.BR findmnt (8),
|
||||
.BR fs (5),
|
||||
.BR nfs (5),
|
||||
.BR xfs (5),
|
||||
|
|
|
@ -150,36 +150,23 @@ read_mntentchn(mntFILE *mfp, const char *fnam, struct mntentchn *mc0) {
|
|||
}
|
||||
|
||||
#ifdef HAVE_LIBMOUNT_MOUNT
|
||||
|
||||
#define USE_UNSTABLE_LIBMOUNT_API
|
||||
#include <libmount.h> /* libmount */
|
||||
|
||||
static int parser_errcb(struct libmnt_table *tb __attribute__((__unused__)),
|
||||
const char *filename, int line)
|
||||
static void read_mounttable()
|
||||
{
|
||||
fprintf(stderr, _("%s: %d: parse error -- line ignored.\n"),
|
||||
filename, line);
|
||||
|
||||
return 1; /* = recoverable error
|
||||
* (the line is ignored, parsing continue) */
|
||||
}
|
||||
|
||||
static void read_tab_common(struct mntentchn *mc0,
|
||||
int (* reader)(struct libmnt_table *tb,
|
||||
const char *filename),
|
||||
const char *name_in_errmsg)
|
||||
{
|
||||
struct mntentchn *mc = mc0;
|
||||
struct mntentchn *mc0 = &mounttable, *mc = mc0;
|
||||
struct libmnt_table *tb = mnt_new_table();
|
||||
struct libmnt_iter *itr = mnt_new_iter(MNT_ITER_FORWARD);
|
||||
struct libmnt_fs *fs;
|
||||
|
||||
got_mtab = 1;
|
||||
mc->nxt = mc->prev = NULL;
|
||||
|
||||
if (!tb || !itr)
|
||||
goto err;
|
||||
|
||||
mnt_table_set_parser_errcb(tb, parser_errcb);
|
||||
|
||||
if (reader(tb, NULL))
|
||||
if (mnt_table_parse_mtab(tb, NULL))
|
||||
goto err;
|
||||
|
||||
while(mnt_table_next_fs(tb, itr, &fs) == 0) {
|
||||
|
@ -200,23 +187,12 @@ static void read_tab_common(struct mntentchn *mc0,
|
|||
mc0->prev = mc;
|
||||
return;
|
||||
err:
|
||||
error(_("warning: failed to parse %s"), name_in_errmsg);
|
||||
error(_("warning: failed to read mtab"));
|
||||
mnt_free_table(tb);
|
||||
mnt_free_iter(itr);
|
||||
mc->nxt = mc->prev = NULL;
|
||||
}
|
||||
|
||||
static void read_mounttable()
|
||||
{
|
||||
got_mtab = 1;
|
||||
read_tab_common(&mounttable, mnt_table_parse_mtab, "mtab");
|
||||
}
|
||||
|
||||
static void read_fstab()
|
||||
{
|
||||
got_fstab = 1;
|
||||
read_tab_common(&fstab, mnt_table_parse_fstab, "fstab");
|
||||
}
|
||||
#else /* !HAVE_LIBMOUNT_MOUNT */
|
||||
|
||||
/*
|
||||
|
@ -250,6 +226,7 @@ read_mounttable() {
|
|||
}
|
||||
read_mntentchn(mfp, fnam, mc);
|
||||
}
|
||||
#endif /* HAVE_LIBMOUNT_MOUNT */
|
||||
|
||||
static void
|
||||
read_fstab() {
|
||||
|
@ -270,7 +247,6 @@ read_fstab() {
|
|||
}
|
||||
read_mntentchn(mfp, fnam, mc);
|
||||
}
|
||||
#endif /* !HAVE_LIBMOUNT_MOUNT */
|
||||
|
||||
|
||||
/* Given the name NAME, try to find it in mtab. */
|
||||
|
|
|
@ -182,14 +182,6 @@ The file
|
|||
.BR fstab (5)),
|
||||
may contain lines describing what devices are usually
|
||||
mounted where, using which options.
|
||||
|
||||
If the
|
||||
.B mount
|
||||
command is linked with libmount, then filesystems could be also defined in
|
||||
.I /etc/fstab.d/*.fstab
|
||||
files. See
|
||||
.BR fstab (5)
|
||||
for more details.
|
||||
.LP
|
||||
The command
|
||||
.RS
|
||||
|
@ -214,7 +206,7 @@ filesystems are mounted simultaneously.
|
|||
When mounting a filesystem mentioned in
|
||||
.IR fstab
|
||||
or
|
||||
.IR mtab,
|
||||
.IR mtab ,
|
||||
it suffices to give only the device, or only the mount point.
|
||||
|
||||
|
||||
|
@ -2785,9 +2777,6 @@ support (for example /sbin/mount.fuse -t fuse.sshfs).
|
|||
.I /etc/fstab
|
||||
filesystem table
|
||||
.TP
|
||||
.I /etc/fstab.d
|
||||
directory with filesystem tables
|
||||
.TP
|
||||
.I /etc/mtab
|
||||
table of mounted filesystems
|
||||
.TP
|
||||
|
@ -2806,7 +2795,6 @@ a list of filesystem types to try
|
|||
.BR fstab (5),
|
||||
.BR umount (8),
|
||||
.BR swapon (8),
|
||||
.BR findmnt (8),
|
||||
.BR nfs (5),
|
||||
.BR xfs (5),
|
||||
.BR e2label (8),
|
||||
|
|
Loading…
Reference in New Issue