1
0
forked from pool/util-linux
OBS User unknown 2007-06-05 18:09:38 +00:00 committed by Git OBS Bridge
parent 5cef2c38f2
commit 9fd24d0c4d
26 changed files with 3652 additions and 2312 deletions

50
nfsboot
View File

@ -1,50 +0,0 @@
#! /bin/sh
# Copyright (c) 2004 SuSE AG, Nuernberg, Germany. All rights reserved.
#
# Author: Mads Martin Joergensen <mmj@suse.de>
#
# /etc/init.d/nfsboot
#
# System startup script for service(s) needed with NFS
#
### BEGIN INIT INFO
# Provides: nfsboot
# Required-Start: $network $portmap
# Required-Stop:
# Default-Start: 3 5
# Default-Stop:
# Description: Service(s) needed with NFS
### END INIT INFO
SMNOTIFYBIN=/sbin/sm-notify
OPTIONS=" -q"
test -x $SMNOTIFYBIN || exit 5
. /etc/rc.status
rc_reset
case "$1" in
# It's a one shot binary notifying clients, so the below is
# ok in this special case.
start|restart|try-restart|reload|force-reload)
echo -n "Starting nfsboot (`/bin/basename $SMNOTIFYBIN`) "
$SMNOTIFYBIN $OPTIONS
rc_status -v
;;
stop)
# we had rc_reset above, so we return 0 anyway
;;
status)
# sm-notify is not a daemon, but a one-shot binary
# nothing to be checked, status is unknown
rc_failed 4
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart|try-restart|reload|force-reload|status}"
exit 1
;;
esac
rc_exit

136
renice.8
View File

@ -1,136 +0,0 @@
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)renice.8 8.1 (Berkeley) 6/9/93
.\"
.Dd June 9, 1993
.Dt RENICE 8
.Os BSD 4
.Sh NAME
.Nm renice
.Nd alter priority of running processes
.Sh SYNOPSIS
.Nm renice
.Ar priority
.Oo
.Op Fl p
.Ar pid ...
.Oc
.Oo
.Op Fl g
.Ar pgrp ...
.Oc
.Oo
.Op Fl u
.Ar user ...
.Oc
.Sh DESCRIPTION
.Nm Renice
alters the
scheduling priority of one or more running processes.
The following
.Ar who
parameters are interpreted as process ID's, process group
ID's, or user names.
.Nm Renice Ns 'ing
a process group causes all processes in the process group
to have their scheduling priority altered.
.Nm Renice Ns 'ing
a user causes all processes owned by the user to have
their scheduling priority altered.
By default, the processes to be affected are specified by
their process ID's.
.Pp
Options supported by
.Nm renice :
.Bl -tag -width Ds
.It Fl g
Force
.Ar who
parameters to be interpreted as process group ID's.
.It Fl u
Force the
.Ar who
parameters to be interpreted as user names.
.It Fl p
Resets the
.Ar who
interpretation to be (the default) process ID's.
.El
.Pp
For example,
.Bd -literal -offset
renice +1 987 -u daemon root -p 32
.Ed
.Pp
would change the priority of process ID's 987 and 32, and
all processes owned by users daemon and root.
.Pp
Users other than the super-user may only alter the priority of
processes they own,
and can only monotonically increase their ``nice value''
within the range 0 to
.Dv PRIO_MAX
(20).
(This prevents overriding administrative fiats.)
The super-user
may alter the priority of any process
and set the priority to any value in the range
.Dv PRIO_MIN
(\-20)
to
.Dv PRIO_MAX .
Useful priorities are:
20 (the affected processes will run only when nothing else
in the system wants to),
0 (the ``base'' scheduling priority),
anything negative (to make things go very fast).
.Sh FILES
.Bl -tag -width /etc/passwd -compact
.It Pa /etc/passwd
to map user names to user ID's
.El
.Sh SEE ALSO
.Xr getpriority 2 ,
.Xr setpriority 2
.Sh BUGS
Non super-users can not increase scheduling priorities of their own processes,
even if they were the ones that decreased the priorities in the first place.
.br
The Linux kernel (at least version 2.0.0) and linux libc (at least
version 5.2.18) does not agree entirely on what the specifics of the
systemcall interface to set nice values is. Thus causes renice to
report bogus previous nice values.
.Sh HISTORY
The
.Nm
command appeared in
.Bx 4.0 .

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ffe524be61389246a7ebb71832bf3f750834dbf8e5a38d4cc1548e267a8fb853
size 5843

View File

@ -1,93 +0,0 @@
Adds the [no]acl NFS mount option that was added to the kernel. This
change has been discussed and accepted by Trond Myklebust
<trond.myklebust@fys.uio.no> and Olaf Kirch <okir@suse.de>.
-- Andreas Gruenbacher <agruen@suse.de>
================================================================================
Index: util-linux-ng-2.12r+2.13pre7/mount/mount.8
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/mount.8
+++ util-linux-ng-2.12r+2.13pre7/mount/mount.8
@@ -1335,7 +1335,8 @@ are recognized:
.BR ac ,
.BR tcp ,
.BR udp ,
-.BR lock .
+.BR lock ,
+.BR acl .
For details, see
.BR nfs (5).
Index: util-linux-ng-2.12r+2.13pre7/mount/nfs.5
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfs.5
+++ util-linux-ng-2.12r+2.13pre7/mount/nfs.5
@@ -204,6 +204,15 @@ default UDP protocol. Many NFS servers
.I udp
Mount the NFS filesystem using the UDP protocol. This
is the default.
+.TP 1.5i
+.I noacl
+Assume no extended access control mechanisms like POSIX ACLs are used
+on the NFS filesystem, and depend on the file mode permission bits
+instead of using the ACCESS remote procedure call. The default is to
+use the ACCESS remote procedure call for making access decisions in
+NFS version 3. (On NFS version 2 filesystems this option has no effect.)
+This option also deactivates the GETACL and SETACL remote procedure calls
+which are otherwise used to manipulate ACLs.
.P
All of the non-value options have corresponding nooption forms.
For example, nointr means don't allow file operations to be
Index: util-linux-ng-2.12r+2.13pre7/mount/nfs_mount4.h
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfs_mount4.h
+++ util-linux-ng-2.12r+2.13pre7/mount/nfs_mount4.h
@@ -51,4 +51,4 @@ struct nfs_mount_data {
#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
#define NFS_MOUNT_NONLM 0x0200 /* 3 */
#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
-
+#define NFS_MOUNT_NOACL 0x0800 /* 4 */
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
@@ -214,7 +214,7 @@ int nfsmount(const char *spec, const cha
struct stat statbuf;
char *s;
int port, mountport, proto, bg, soft, intr;
- int posix, nocto, noac, nolock, broken_suid;
+ int posix, nocto, noac, nolock, broken_suid, noacl;
int retry, tcp;
int mountprog, mountvers, nfsprog, nfsvers;
int retval;
@@ -314,6 +314,7 @@ int nfsmount(const char *spec, const cha
nocto = 0;
nolock = 0;
broken_suid = 0;
+ noacl = 0;
noac = 0;
retry = 10000; /* 10000 minutes ~ 1 week */
tcp = 0;
@@ -425,6 +426,8 @@ int nfsmount(const char *spec, const cha
printf(_("Warning: option nolock is not supported.\n"));
} else if (!strcmp(opt, "broken_suid")) {
broken_suid = val;
+ } else if (!strcmp(opt, "acl")) {
+ noacl = !val;
} else {
if (!sloppy) {
printf(_("unknown nfs mount option: "
@@ -450,8 +453,10 @@ int nfsmount(const char *spec, const cha
data.flags |= (nolock ? NFS_MOUNT_NONLM : 0);
#endif
#if NFS_MOUNT_VERSION >= 4
- if (nfs_mount_version >= 4)
+ if (nfs_mount_version >= 4) {
data.flags |= (broken_suid ? NFS_MOUNT_BROKEN_SUID : 0);
+ data.flags |= (noacl ? NFS_MOUNT_NOACL : 0);
+ }
#endif
if (nfsvers > MAX_NFSPROT) {
fprintf(stderr, "NFSv%d not supported!\n", nfsvers);

View File

@ -1,859 +0,0 @@
Add basic nfsv4 support
---
util-linux-2.12-bfields/mount/Makefile | 2
util-linux-2.12-bfields/mount/fstab.5 | 1
util-linux-2.12-bfields/mount/mount.8 | 75 ++++++
util-linux-2.12-bfields/mount/mount.c | 13 +
util-linux-2.12-bfields/mount/nfs.5 | 200 +++++++++++++++++
util-linux-2.12-bfields/mount/nfs4_mount.h | 82 +++++++
util-linux-2.12-bfields/mount/nfs4mount.c | 335 +++++++++++++++++++++++++++++
util-linux-2.12-bfields/mount/nfsmount.c | 5
util-linux-2.12-bfields/mount/sundries.h | 2
util-linux-2.12-bfields/mount/umount.c | 3
10 files changed, 710 insertions(+), 8 deletions(-)
Index: util-linux-ng-2.12r+git20070330/mount/fstab.5
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/fstab.5
+++ util-linux-ng-2.12r+git20070330/mount/fstab.5
@@ -115,6 +115,7 @@ of filesystem types, such as
.IR msdos ,
.IR ncpfs ,
.IR nfs ,
+.IR nfs4 ,
.IR ntfs ,
.IR proc ,
.IR qnx4 ,
Index: util-linux-ng-2.12r+git20070330/mount/mount.8
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/mount.8
+++ util-linux-ng-2.12r+git20070330/mount/mount.8
@@ -385,6 +385,7 @@ currently supported include:
.IR msdos ,
.IR ncpfs ,
.IR nfs ,
+.IR nfs4 ,
.IR ntfs ,
.IR proc ,
.IR qnx4 ,
@@ -422,7 +423,7 @@ For most types all the
program has to do is issue a simple
.IR mount (2)
system call, and no detailed knowledge of the filesystem type is required.
-For a few types however (like nfs, cifs, smbfs, ncpfs) ad hoc code is
+For a few types however (like nfs, nfs4, cifs, smbfs, ncpfs) ad hoc code is
necessary. The nfs ad hoc code is built in, but cifs, smbfs, and ncpfs
have a separate mount program. In order to make it possible to
treat all types in a uniform way, mount will execute the program
@@ -450,9 +451,10 @@ or, if that does not exist,
All of the filesystem types listed there will be tried,
except for those that are labeled "nodev" (e.g.,
.IR devpts ,
-.I proc
+.IR proc ,
+.IR nfs ,
and
-.IR nfs ).
+.IR nfs4 ).
If
.I /etc/filesystems
ends in a line with a single * only, mount will read
@@ -1380,6 +1382,73 @@ Usually it just causes lots of trouble.
.B nolock
Do not use locking. Do not start lockd.
+.SH "Mount options for nfs4"
+Instead of a textual option string, parsed by the kernel, the
+.I nfs4
+file system expects a binary argument of type
+.IR "struct nfs4_mount_data" .
+The program
+.B mount
+itself parses the following options of the form `tag=value',
+and puts them in the structure mentioned:
+.BI rsize= n,
+.BI wsize= n,
+.BI timeo= n,
+.BI retrans= n,
+.BI acregmin= n,
+.BI acregmax= n,
+.BI acdirmin= n,
+.BI acdirmax= n,
+.BI actimeo= n,
+.BI retry= n,
+.BI port= n,
+.BI proto= n,
+.BI clientaddr= n,
+.BI sec= n.
+The option
+.BI addr= n
+is accepted but ignored.
+Also the following Boolean options, possibly preceded by
+.B no
+are recognized:
+.BR bg ,
+.BR fg ,
+.BR soft ,
+.BR hard ,
+.BR intr ,
+.BR cto ,
+.BR ac ,
+For details, see
+.BR nfs (5).
+
+Especially useful options include
+.TP
+.B rsize=32768,wsize=32768
+This will make your NFS connection faster than with the default
+buffer size of 4096.
+.TP
+.B hard
+The program accessing a file on a NFS mounted file system will hang
+when the server crashes. The process cannot be interrupted or
+killed unless you also specify
+.BR intr .
+When the NFS server is back online the program will continue undisturbed
+from where it was. This is probably what you want.
+.TP
+.B soft
+This option allows the kernel to time out if the NFS server is not
+responding for some time. The time can be
+specified with
+.BR timeo=time .
+This timeout value is expressed in tenths of a second.
+The
+.BR soft
+option might be useful if your NFS server sometimes doesn't respond
+or will be rebooted while some process tries to get a file from the server.
+Avoid using this option with
+.BR proto=udp
+or with a short timeout.
+
.SH "Mount options for ntfs"
.TP
.BI iocharset= name
Index: util-linux-ng-2.12r+git20070330/mount/mount.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/mount.c
+++ util-linux-ng-2.12r+git20070330/mount/mount.c
@@ -860,6 +860,19 @@ try_mount_one (const char *spec0, const
if (res)
goto out;
}
+#ifdef HAVE_NFS
+ /*
+ * NFSv4 support
+ */
+ if (!fake && types && streq (types, "nfs4")) {
+ mnt_err = nfs4mount(spec, node, &flags, &extra_opts, &mount_opts, bg);
+ if (mnt_err)
+ return mnt_err;
+#else
+ die (EX_SOFTWARE, _("mount: this version was compiled "
+ "without support for the type `nfs4'"));
+#endif
+ }
/*
* Call mount.TYPE for types that require a separate mount program.
Index: util-linux-ng-2.12r+git20070330/mount/nfs4mount.c
===================================================================
--- /dev/null
+++ util-linux-ng-2.12r+git20070330/mount/nfs4mount.c
@@ -0,0 +1,335 @@
+/*
+ * nfs4mount.c -- Linux NFS mount
+ * Copyright (C) 2002 Trond Myklebust <trond.myklebust@fys.uio.no>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Note: this file based on the original nfsmount.c
+ */
+
+#include "../config.h"
+
+#include <linux/posix_types.h>
+#include <asm/posix_types.h>
+#undef __FD_CLR
+#undef __FD_SET
+#undef __FD_ISSET
+#undef __FD_ZERO
+
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <netdb.h>
+#include <time.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/utsname.h>
+#include <sys/stat.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "sundries.h"
+
+#include "mount_constants.h"
+#include "nfs4_mount.h"
+
+#include "nls.h"
+
+#ifndef NFS_PORT
+#define NFS_PORT 2049
+#endif
+
+static int parse_devname(char *hostdir, char **hostname, char **dirname)
+{
+ char *s;
+
+ if (!(s = strchr(hostdir, ':'))) {
+ fprintf(stderr,
+ _("mount: "
+ "directory to mount not in host:dir format\n"));
+ return -1;
+ }
+ *hostname = hostdir;
+ *dirname = s + 1;
+ *s = '\0';
+ /* Ignore all but first hostname in replicated mounts
+ until they can be fully supported. (mack@sgi.com) */
+ if ((s = strchr(hostdir, ','))) {
+ *s = '\0';
+ fprintf(stderr,
+ _("mount: warning: "
+ "multiple hostnames not supported\n"));
+ }
+ return 0;
+}
+
+static int fill_ipv4_sockaddr(const char *hostname, struct sockaddr_in *addr)
+{
+ struct hostent *hp;
+ addr->sin_family = AF_INET;
+
+ if (inet_aton(hostname, &addr->sin_addr))
+ return 0;
+ if ((hp = gethostbyname(hostname)) == NULL) {
+ fprintf(stderr, _("mount: can't get address for %s\n"),
+ hostname);
+ return -1;
+ }
+ if (hp->h_length > sizeof(struct in_addr)) {
+ fprintf(stderr,
+ _("mount: got bad hp->h_length\n"));
+ hp->h_length = sizeof(struct in_addr);
+ }
+ memcpy(&addr->sin_addr, hp->h_addr, hp->h_length);
+ return 0;
+}
+
+static int get_my_ipv4addr(char *ip_addr, int len)
+{
+ char myname[1024];
+ struct sockaddr_in myaddr;
+
+ if (gethostname(myname, sizeof(myname))) {
+ fprintf(stderr, _("mount: can't determine client address\n"));
+ return -1;
+ }
+ if (fill_ipv4_sockaddr(myname, &myaddr))
+ return -1;
+ snprintf(ip_addr, len, "%s", inet_ntoa(myaddr.sin_addr));
+ ip_addr[len-1] = '\0';
+ return 0;
+}
+
+int nfs4mount(const char *spec, const char *node, int *flags,
+ char **extra_opts, char **mount_opts,
+ int running_bg)
+{
+ static struct nfs4_mount_data data;
+ static char hostdir[1024];
+ static char ip_addr[16] = "127.0.0.1";
+ static struct sockaddr_in server_addr;
+ static int pseudoflavour = 0;
+
+ char *hostname, *dirname, *old_opts;
+ char new_opts[1024];
+ char *opt, *opteq;
+ char *s;
+ int val;
+ int bg, soft, intr;
+ int nocto, noac;
+ int retry;
+ int retval;
+
+ retval = EX_FAIL;
+ if (strlen(spec) >= sizeof(hostdir)) {
+ fprintf(stderr, _("mount: "
+ "excessively long host:dir argument\n"));
+ goto fail;
+ }
+ strcpy(hostdir, spec);
+ if (parse_devname(hostdir, &hostname, &dirname))
+ goto fail;
+
+ if (fill_ipv4_sockaddr(hostname, &server_addr))
+ goto fail;
+ if (get_my_ipv4addr(ip_addr, sizeof(ip_addr)))
+ goto fail;
+
+ /* add IP address to mtab options for use when unmounting */
+ s = inet_ntoa(server_addr.sin_addr);
+ old_opts = *extra_opts;
+ if (!old_opts)
+ old_opts = "";
+ if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
+ fprintf(stderr, _("mount: "
+ "excessively long option argument\n"));
+ goto fail;
+ }
+ snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s",
+ old_opts, *old_opts ? "," : "", s);
+ *extra_opts = xstrdup(new_opts);
+
+ /* Set default options.
+ * rsize/wsize and timeo are left 0 in order to
+ * let the kernel decide.
+ */
+ memset(&data, 0, sizeof(data));
+ data.retrans = 3;
+ data.acregmin = 3;
+ data.acregmax = 60;
+ data.acdirmin = 30;
+ data.acdirmax = 60;
+ data.proto = IPPROTO_TCP;
+
+ bg = 0;
+ soft = 0;
+ intr = 0;
+ nocto = 0;
+ noac = 0;
+ retry = 10000; /* 10000 minutes ~ 1 week */
+
+ /*
+ * NFSv4 specifies that the default port should be 2049
+ */
+ server_addr.sin_port = htons(NFS_PORT);
+
+ /* parse options */
+
+ for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) {
+ if ((opteq = strchr(opt, '='))) {
+ val = atoi(opteq + 1);
+ *opteq = '\0';
+ if (!strcmp(opt, "rsize"))
+ data.rsize = val;
+ else if (!strcmp(opt, "wsize"))
+ data.wsize = val;
+ else if (!strcmp(opt, "timeo"))
+ data.timeo = val;
+ else if (!strcmp(opt, "retrans"))
+ data.retrans = val;
+ else if (!strcmp(opt, "acregmin"))
+ data.acregmin = val;
+ else if (!strcmp(opt, "acregmax"))
+ data.acregmax = val;
+ else if (!strcmp(opt, "acdirmin"))
+ data.acdirmin = val;
+ else if (!strcmp(opt, "acdirmax"))
+ data.acdirmax = val;
+ else if (!strcmp(opt, "actimeo")) {
+ data.acregmin = val;
+ data.acregmax = val;
+ data.acdirmin = val;
+ data.acdirmax = val;
+ }
+ else if (!strcmp(opt, "retry"))
+ retry = val;
+ else if (!strcmp(opt, "port"))
+ server_addr.sin_port = htons(val);
+ else if (!strcmp(opt, "proto")) {
+ if (!strncmp(opteq+1, "tcp", 3))
+ data.proto = IPPROTO_TCP;
+ else if (!strncmp(opteq+1, "udp", 3))
+ data.proto = IPPROTO_UDP;
+ else
+ printf(_("Warning: Unrecognized proto= option.\n"));
+ } else if (!strcmp(opt, "clientaddr")) {
+ if (strlen(opteq+1) >= sizeof(ip_addr))
+ printf(_("Invalid client address %s"),
+ opteq+1);
+ strncpy(ip_addr,opteq+1, sizeof(ip_addr));
+ ip_addr[sizeof(ip_addr)-1] = '\0';
+ } else if (!strcmp(opt, "sec")) {
+ if (!strcmp(opteq+1, "krb5"))
+ pseudoflavour = 390003;
+ else if (!strcmp(opteq+1, "krb5i"))
+ pseudoflavour = 390004;
+ else if (!strcmp(opteq+1, "krb5p"))
+ pseudoflavour = 390005;
+ else if (!strcmp(opteq+1, "lipkey"))
+ pseudoflavour = 390006;
+ else if (!strcmp(opteq+1, "lipkey-i"))
+ pseudoflavour = 390007;
+ else if (!strcmp(opteq+1, "lipkey-p"))
+ pseudoflavour = 390008;
+ else if (!strcmp(opteq+1, "spkm3"))
+ pseudoflavour = 390009;
+ else if (!strcmp(opteq+1, "spkm3i"))
+ pseudoflavour = 390010;
+ else if (!strcmp(opteq+1, "spkm3p"))
+ pseudoflavour = 390011;
+ else {
+ printf(_("unknown security type %s\n"),
+ opteq+1);
+ goto fail;
+ }
+ } else if (!strcmp(opt, "addr")) {
+ /* ignore */;
+ } else {
+ printf(_("unknown nfs mount parameter: "
+ "%s=%d\n"), opt, val);
+ goto fail;
+ }
+ } else {
+ val = 1;
+ if (!strncmp(opt, "no", 2)) {
+ val = 0;
+ opt += 2;
+ }
+ if (!strcmp(opt, "bg"))
+ bg = val;
+ else if (!strcmp(opt, "fg"))
+ bg = !val;
+ else if (!strcmp(opt, "soft"))
+ soft = val;
+ else if (!strcmp(opt, "hard"))
+ soft = !val;
+ else if (!strcmp(opt, "intr"))
+ intr = val;
+ else if (!strcmp(opt, "cto"))
+ nocto = !val;
+ else if (!strcmp(opt, "ac"))
+ noac = !val;
+ else {
+ if (!sloppy) {
+ printf(_("unknown nfs mount option: "
+ "%s%s\n"), val ? "" : "no", opt);
+ goto fail;
+ }
+ }
+ }
+ }
+
+ data.flags = (soft ? NFS4_MOUNT_SOFT : 0)
+ | (intr ? NFS4_MOUNT_INTR : 0)
+ | (nocto ? NFS4_MOUNT_NOCTO : 0)
+ | (noac ? NFS4_MOUNT_NOAC : 0);
+
+ if (pseudoflavour != 0) {
+ data.auth_flavourlen = 1;
+ data.auth_flavours = &pseudoflavour;
+ }
+
+ data.client_addr.data = ip_addr;
+ data.client_addr.len = strlen(ip_addr);
+
+ data.mnt_path.data = dirname;
+ data.mnt_path.len = strlen(dirname);
+
+ data.hostname.data = hostname;
+ data.hostname.len = strlen(hostname);
+ data.host_addr = (struct sockaddr *)&server_addr;
+ data.host_addrlen = sizeof(server_addr);
+
+#ifdef NFS_MOUNT_DEBUG
+ printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
+ data.rsize, data.wsize, data.timeo, data.retrans);
+ printf("acreg (min, max) = (%d, %d), acdir (min, max) = (%d, %d)\n",
+ data.acregmin, data.acregmax, data.acdirmin, data.acdirmax);
+ printf("port = %d, bg = %d, retry = %d, flags = %.8x\n",
+ ntohs(server_addr.sin_port), bg, retry, data.flags);
+ printf("soft = %d, intr = %d, nocto = %d, noac = %d\n",
+ (data.flags & NFS4_MOUNT_SOFT) != 0,
+ (data.flags & NFS4_MOUNT_INTR) != 0,
+ (data.flags & NFS4_MOUNT_NOCTO) != 0,
+ (data.flags & NFS4_MOUNT_NOAC) != 0);
+ printf("proto = %s\n", (data.proto == IPPROTO_TCP) ? "tcp" : "udp");
+#endif
+
+ data.version = NFS4_MOUNT_VERSION;
+
+ *mount_opts = (char *) &data;
+ /* clean up */
+ return 0;
+
+fail:
+ return retval;
+}
Index: util-linux-ng-2.12r+git20070330/mount/nfs4_mount.h
===================================================================
--- /dev/null
+++ util-linux-ng-2.12r+git20070330/mount/nfs4_mount.h
@@ -0,0 +1,82 @@
+#ifndef _LINUX_NFS4_MOUNT_H
+#define _LINUX_NFS4_MOUNT_H
+
+/*
+ * linux/include/linux/nfs4_mount.h
+ *
+ * Copyright (C) 2002 Trond Myklebust
+ *
+ * structure passed from user-space to kernel-space during an nfsv4 mount
+ */
+
+/*
+ * WARNING! Do not delete or change the order of these fields. If
+ * a new field is required then add it to the end. The version field
+ * tracks which fields are present. This will ensure some measure of
+ * mount-to-kernel version compatibility. Some of these aren't used yet
+ * but here they are anyway.
+ */
+#define NFS4_MOUNT_VERSION 1
+
+struct nfs_string {
+ unsigned int len;
+ const char* data;
+};
+
+struct nfs4_mount_data {
+ int version; /* 1 */
+ int flags; /* 1 */
+ int rsize; /* 1 */
+ int wsize; /* 1 */
+ int timeo; /* 1 */
+ int retrans; /* 1 */
+ int acregmin; /* 1 */
+ int acregmax; /* 1 */
+ int acdirmin; /* 1 */
+ int acdirmax; /* 1 */
+
+ /* see the definition of 'struct clientaddr4' in RFC3010 */
+ struct nfs_string client_addr; /* 1 */
+
+ /* Mount path */
+ struct nfs_string mnt_path; /* 1 */
+
+ /* Server details */
+ struct nfs_string hostname; /* 1 */
+ /* Server IP address */
+ unsigned int host_addrlen; /* 1 */
+ struct sockaddr* host_addr; /* 1 */
+
+ /* Transport protocol to use */
+ int proto; /* 1 */
+
+ /* Pseudo-flavours to use for authentication. See RFC2623 */
+ int auth_flavourlen; /* 1 */
+ int *auth_flavours; /* 1 */
+};
+
+/* bits in the flags field */
+/* Note: the fields that correspond to existing NFSv2/v3 mount options
+ * should mirror the values from include/linux/nfs_mount.h
+ */
+
+#define NFS4_MOUNT_SOFT 0x0001 /* 1 */
+#define NFS4_MOUNT_INTR 0x0002 /* 1 */
+#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
+#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
+#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
+#define NFS4_MOUNT_FLAGMASK 0xFFFF
+
+/* pseudoflavors: */
+
+#define RPC_AUTH_GSS_KRB5 390003
+#define RPC_AUTH_GSS_KRB5I 390004
+#define RPC_AUTH_GSS_KRB5P 390005
+#define RPC_AUTH_GSS_LKEY 390006
+#define RPC_AUTH_GSS_LKEYI 390007
+#define RPC_AUTH_GSS_LKEYP 390008
+#define RPC_AUTH_GSS_SPKM 390009
+#define RPC_AUTH_GSS_SPKMI 390010
+#define RPC_AUTH_GSS_SPKMP 390011
+
+#endif
Index: util-linux-ng-2.12r+git20070330/mount/nfs.5
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/nfs.5
+++ util-linux-ng-2.12r+git20070330/mount/nfs.5
@@ -3,7 +3,7 @@
.\" patches. "
.TH NFS 5 "20 November 1993" "Linux 0.99" "Linux Programmer's Manual"
.SH NAME
-nfs \- nfs fstab format and options
+nfs \- nfs and nfs4 fstab format and options
.SH SYNOPSIS
.B /etc/fstab
.SH DESCRIPTION
@@ -17,14 +17,51 @@ the local directory that is the mount po
and the NFS specific options that control
the way the filesystem is mounted.
.P
-Here is an example from an \fI/etc/fstab\fP file from an NFS mount.
+Three different versions of the NFS protocol are
+supported by the Linux NFS client:
+NFS version 2, NFS version 3, and NFS version 4.
+To mount via NFS version 2, use the
+.BR nfs
+file system type and specify
+.BR nfsvers=2 .
+Version 2 is the default protocol version for the
+.BR nfs
+file system type when
+.BR nfsvers=
+is not specified on the mount command.
+To mount via NFS version 3, use the
+.BR nfs
+file system type and specify
+.BR nfsvers=3 .
+To mount via NFS version 4, use the
+.BR nfs4
+file system type.
+The
+.BR nfsvers=
+keyword is not supported for the
+.BR nfs4
+file system type.
+.P
+These file system types share similar mount options;
+the differences are listed below.
+.P
+Here is an example from an \fI/etc/fstab\fP file for an NFSv2 mount
+over UDP.
.sp
.nf
.ta 2.5i +0.75i +0.75i +1.0i
server:/usr/local/pub /pub nfs rsize=8192,wsize=8192,timeo=14,intr
.fi
+.P
+Here is an example for an NFSv4 mount over TCP using Kerberos
+5 mutual authentication.
+.sp
+.nf
+.ta 2.5i +0.75i +0.75i +1.0i
+server:/usr/local/pub /pub nfs4 proto=tcp,sec=krb5,hard,intr
+.fi
.DT
-.SS Options
+.SS Options for the nfs file system type
.TP 1.5i
.I rsize=n
The number of bytes NFS uses when reading files from an NFS server.
@@ -217,6 +254,163 @@ which are otherwise used to manipulate A
All of the non-value options have corresponding nooption forms.
For example, nointr means don't allow file operations to be
interrupted.
+.SS Options for the nfs4 file system type
+.TP 1.5i
+.I rsize=n
+The number of bytes NFS uses when reading files from an NFS server.
+The default value is dependent on the kernel, currently 4096 bytes.
+(However, throughput is improved greatly by asking for
+.IR rsize=32768 .)
+This value is negotiated with the server.
+.TP 1.5i
+.I wsize=n
+The number of bytes NFS uses when writing files to an NFS server.
+The default value is dependent on the kernel, currently 4096 bytes.
+(However, throughput is improved greatly by asking for
+.IR wsize=32768 .)
+This value is negotiated with the server.
+.TP 1.5i
+.I timeo=n
+The value in tenths of a second before sending the
+first retransmission after an RPC timeout.
+The default value depends on whether
+.IR proto=udp
+or
+.IR proto=tcp
+is in effect (see below).
+The default value for UDP is 7 tenths of a second.
+The default value for TCP is 60 seconds.
+After the first timeout,
+the timeout is doubled after each successive timeout until a maximum
+timeout of 60 seconds is reached or the enough retransmissions
+have occured to cause a major timeout. Then, if the filesystem
+is hard mounted, each new timeout cascade restarts at twice the
+initial value of the previous cascade, again doubling at each
+retransmission. The maximum timeout is always 60 seconds.
+.TP 1.5i
+.I retrans=n
+The number of minor timeouts and retransmissions that must occur before
+a major timeout occurs. The default is 5 timeouts for
+.IR proto=udp
+and 2 timeouts for
+.IR proto=tcp .
+When a major timeout
+occurs, the file operation is either aborted or a "server not responding"
+message is printed on the console.
+.TP 1.5i
+.I acregmin=n
+The minimum time in seconds that attributes of a regular file should
+be cached before requesting fresh information from a server.
+The default is 3 seconds.
+.TP 1.5i
+.I acregmax=n
+The maximum time in seconds that attributes of a regular file can
+be cached before requesting fresh information from a server.
+The default is 60 seconds.
+.TP 1.5i
+.I acdirmin=n
+The minimum time in seconds that attributes of a directory should
+be cached before requesting fresh information from a server.
+The default is 30 seconds.
+.TP 1.5i
+.I acdirmax=n
+The maximum time in seconds that attributes of a directory can
+be cached before requesting fresh information from a server.
+The default is 60 seconds.
+.TP 1.5i
+.I actimeo=n
+Using actimeo sets all of
+.I acregmin,
+.I acregmax,
+.I acdirmin,
+and
+.I acdirmax
+to the same value.
+There is no default value.
+.TP 1.5i
+.I retry=n
+The number of minutes to retry an NFS mount operation
+in the foreground or background before giving up.
+The default value is 10000 minutes, which is roughly one week.
+.TP 1.5i
+.I port=n
+The numeric value of the port to connect to the NFS server on.
+If the port number is 0 (the default) then query the
+remote host's portmapper for the port number to use.
+If the remote host's NFS daemon is not registered with
+its portmapper, the standard NFS port number 2049 is
+used instead.
+.TP 1.5i
+.I proto=n
+Mount the NFS filesystem using a specific network protocol
+instead of the default UDP protocol.
+Many NFS version 4 servers only support TCP.
+Valid protocol types are
+.IR udp
+and
+.IR tcp .
+.TP 1.5i
+.I clientaddr=n
+On a multi-homed client, this
+causes the client to use a specific callback address when
+communicating with an NFS version 4 server.
+This option is currently ignored.
+.TP 1.5i
+.I sec=n
+Specify an advanced security mechanism for this file system.
+To use Kerberos 5 mutual authentication, specify
+.IR krb5 .
+Kerberos 5 integrity checking is specified with
+.IR krb5i ,
+and Kerberos 5 privacy is specified with
+.IR krb5p .
+Other security mechanisms may become available in the future.
+.TP 1.5i
+.I bg
+If an NFS mount attempt times out, retry the mount
+in the background.
+After a mount operation is backgrounded, all subsequent mounts
+on the same NFS server will be backgrounded immediately, without
+first attempting the mount.
+A missing mount point is treated as a timeout,
+to allow for nested NFS mounts.
+.TP 1.5i
+.I fg
+If the first NFS mount attempt times out, retry the mount
+in the foreground.
+This is the complement of the
+.I bg
+option, and also the default behavior.
+.TP 1.5i
+.I soft
+If an NFS file operation has a major timeout then report an I/O error to
+the calling program.
+The default is to continue retrying NFS file operations indefinitely.
+.TP 1.5i
+.I hard
+If an NFS file operation has a major timeout then report
+"server not responding" on the console and continue retrying indefinitely.
+This is the default.
+.TP 1.5i
+.I intr
+If an NFS file operation has a major timeout and it is hard mounted,
+then allow signals to interupt the file operation and cause it to
+return EINTR to the calling program. The default is to not
+allow file operations to be interrupted.
+.TP 1.5i
+.I nocto
+Suppress the retrieval of new attributes when creating a file.
+.TP 1.5i
+.I noac
+Disable attribute caching, and force synchronous writes.
+This extracts a
+server performance penalty but it allows two different NFS clients
+to get reasonable good results when both clients are actively
+writing to common filesystem on the server.
+.P
+All of the non-value options have corresponding nooption forms.
+For example, nointr means don't allow file operations to be
+interrupted.
.SH FILES
.I /etc/fstab
.SH "SEE ALSO"
Index: util-linux-ng-2.12r+git20070330/mount/sundries.h
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/sundries.h
+++ util-linux-ng-2.12r+git20070330/mount/sundries.h
@@ -40,6 +40,8 @@ void die (int errcode, const char *fmt,
int nfsmount (const char *spec, const char *node, int *flags,
char **orig_opts, char **opt_args, int *version, int running_bg);
+int nfs4mount (const char *spec, const char *node, int *flags,
+ char **orig_opts, char **opt_args, int running_bg);
/* exit status - bits below are ORed */
#define EX_USAGE 1 /* incorrect invocation or permission */
Index: util-linux-ng-2.12r+git20070330/mount/umount.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/umount.c
+++ util-linux-ng-2.12r+git20070330/mount/umount.c
@@ -88,6 +88,9 @@ int verbose = 0;
/* True if ruid != euid. */
int suid = 0;
+/* Needed by nfs4mount.c */
+int sloppy = 0;
+
/*
* check_special_umountprog()
* If there is a special umount program for this type, exec it.
Index: util-linux-ng-2.12r+git20070330/mount/Makefile.am
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/Makefile.am
+++ util-linux-ng-2.12r+git20070330/mount/Makefile.am
@@ -17,7 +17,7 @@ MNTHDRS = fstab.h linux_fs.h mount_mnten
mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
get_label_uuid.c mount_by_label.c mount_blkid.c mount_guess_fstype.c \
getusername.c \
- nfsmount.c nfsmount_xdr.c nfsmount_clnt.c \
+ nfsmount.c nfsmount_xdr.c nfsmount_clnt.c nfs4mount.c \
lomount.c \
$(MNTHDRS)

View File

@ -1,36 +0,0 @@
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
@@ -167,8 +167,20 @@ get_mountport(struct sockaddr_in *server
}
if (!p.pm_vers)
p.pm_vers = MOUNTVERS;
- if (!p.pm_prot)
+ if (!p.pm_prot) {
p.pm_prot = IPPROTO_TCP;
+ if (!p.pm_port) {
+ p.pm_port = pmap_getport(server_addr,
+ p.pm_prog, p.pm_vers, p.pm_prot);
+ }
+ /* Fall back to UDP if there's no TCP registration for mount */
+ if (!p.pm_port) {
+ fprintf(stderr, "mount server reported tcp not available, falling back to udp\n");
+ p.pm_prot = IPPROTO_UDP;
+ p.pm_port = pmap_getport(server_addr,
+ p.pm_prog, p.pm_vers, p.pm_prot);
+ }
+ }
#if 0
if (!p.pm_port) {
p.pm_port = pmap_getport(server_addr, p.pm_prog, p.pm_vers,
@@ -582,7 +594,8 @@ retry_udp:
pm_mnt = get_mountport(&mount_server_addr,
mountprog,
mountvers,
- proto,
+ 0, /* TCP or UDP: pick
+ whatever is available */
mountport,
nfs_mount_version);

View File

@ -1,65 +0,0 @@
Index: util-linux-ng-2.12r+2.13pre7/mount/nfs.5
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfs.5
+++ util-linux-ng-2.12r+2.13pre7/mount/nfs.5
@@ -199,11 +199,11 @@ writing to common filesystem on the serv
.TP 1.5i
.I tcp
Mount the NFS filesystem using the TCP protocol instead of the
-default UDP protocol. Many NFS servers only support UDP.
+UDP protocol. This is the default, but in case it fails (many NFS servers only
+support UDP) it will fallback and try UDP.
.TP 1.5i
.I udp
-Mount the NFS filesystem using the UDP protocol. This
-is the default.
+Mount the NFS filesystem using the UDP protocol.
.TP 1.5i
.I noacl
Assume no extended access control mechanisms like POSIX ACLs are used
@@ -227,8 +227,5 @@ interrupted.
The posix, and nocto options are parsed by mount
but currently are silently ignored.
.P
-The tcp and namlen options are implemented but are not currently
-supported by the Linux kernel.
-.P
The umount command should notify the server
when an NFS filesystem is unmounted.
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
@@ -317,7 +317,7 @@ int nfsmount(const char *spec, const cha
noacl = 0;
noac = 0;
retry = 10000; /* 10000 minutes ~ 1 week */
- tcp = 0;
+ tcp = 2;
mountprog = MOUNTPROG;
mountvers = 0;
@@ -437,6 +437,8 @@ int nfsmount(const char *spec, const cha
}
}
}
+
+retry_udp:
proto = (tcp) ? IPPROTO_TCP : IPPROTO_UDP;
data.flags = (soft ? NFS_MOUNT_SOFT : 0)
@@ -740,7 +742,13 @@ int nfsmount(const char *spec, const cha
* '0' for port (service unavailable), we then exit,
* notifying the user, rather than hanging up mount.
*/
- if (port == 0 && tcp == 1) {
+ if (port == 0 && tcp) {
+ if (tcp == 2) {
+ fprintf(stderr, "nfs server reported tcp not available, falling back to udp\n");
+ close(fsock);
+ tcp = 0;
+ goto retry_udp;
+ }
perror(_("nfs server reported service unavailable"));
goto fail;
}

View File

@ -1,65 +0,0 @@
Index: util-linux-ng-2.12r+2.13pre7/mount/mount_by_label.c
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/mount_by_label.c
+++ util-linux-ng-2.12r+2.13pre7/mount/mount_by_label.c
@@ -18,6 +18,8 @@
* - Added JFS v2 format support
* 2002-07-26 Luciano Chavez <lnx1138@us.ibm.com>
* - Added EVMS support
+ * 2004-08-11 Alasdair Kergon <agk@redhat.com>
+ * - Added LVM2/device-mapper support
*/
#include <stdio.h>
@@ -39,6 +41,7 @@
#define VG_DIR "/proc/lvm/VGs"
#define EVMS_VOLUME_NAME_SIZE 127
#define PROC_EVMS_VOLUMES "/proc/evms/volumes"
+#define DEVICEMAPPERDIR "/dev/mapper"
extern char *progname;
@@ -104,6 +107,34 @@ uuidcache_init_lvm(void) {
closedir(vg_dir);
}
+/* LVM2/device-mapper support */
+static void
+uuidcache_init_dm(void) {
+ char lvm_device[PATH_MAX];
+ DIR *d;
+ struct dirent *lv_iter;
+ char uuid[16], *label;
+
+ if (!(d = opendir(DEVICEMAPPERDIR))) {
+ if (errno != ENOENT)
+ perror("mount (init_dm)");
+ return;
+ }
+
+ while ((lv_iter = readdir(d))) {
+ if (!strcmp(lv_iter->d_name, "control") ||
+ !strcmp(lv_iter->d_name, ".") ||
+ !strcmp(lv_iter->d_name, ".."))
+ continue;
+ snprintf(lvm_device, sizeof(lvm_device), "%s/%s",
+ DEVICEMAPPERDIR, lv_iter->d_name);
+ if (!get_label_uuid(strdup(lvm_device), &label, uuid))
+ uuidcache_addentry(strdup(lvm_device),
+ label, uuid);
+ }
+ closedir(d);
+}
+
static int
uuidcache_init_evms(void) {
FILE *procvol;
@@ -256,6 +287,8 @@ uuidcache_init(void) {
fclose(procpt);
uuidcache_init_lvm();
+
+ uuidcache_init_dm();
}
#define UUID 1

View File

@ -9,7 +9,7 @@ Index: util-linux-ng-2.12r+git20070330/mount/mount.c
- types = "nfs";
- if (verbose)
- printf(_("mount: no type was given - "
+ types = do_guess_fstype(spec);
+ types = fsprobe_get_fstype_by_devname(spec);
+ if(types == NULL) {
+ types = "nfs";
+ if (verbose) {

View File

@ -1,28 +0,0 @@
Index: util-linux-ng-2.12r+git20070330/mount/Makefile.am
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/Makefile.am
+++ util-linux-ng-2.12r+git20070330/mount/Makefile.am
@@ -17,11 +17,11 @@ MNTHDRS = fstab.h linux_fs.h mount_mnten
mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
get_label_uuid.c mount_by_label.c mount_blkid.c mount_guess_fstype.c \
getusername.c \
- nfsmount.c nfsmount_xdr.c nfsmount_clnt.c nfs4mount.c \
+ nfsmount.c nfsmount_clnt.c nfs4mount.c \
lomount.c \
$(MNTHDRS)
-mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a
+mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a libnfsmount_xdr.a
umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c \
@@ -60,6 +60,9 @@ swapargs.h:
clean-local:
rm -f swapargs.h
+noinst_LIBRARIES = libnfsmount_xdr.a
+libnfsmount_xdr_a_SOURCES = nfsmount_xdr.c
+libnfsmount_xdr_a_CFLAGS = -fno-strict-aliasing
install-exec-hook:
chmod 4755 $(DESTDIR)$(bindir)/mount

View File

@ -1,7 +1,7 @@
Index: util-linux-ng-2.12r+2.13pre7/sys-utils/ionice.1
Index: util-linux-ng-2.12r+git20070509/sys-utils/ionice.1
===================================================================
--- /dev/null
+++ util-linux-ng-2.12r+2.13pre7/sys-utils/ionice.1
+++ util-linux-ng-2.12r+git20070509/sys-utils/ionice.1
@@ -0,0 +1,71 @@
+.TH ionice "1" "August 2005" ionice
+.SH NAME
@ -74,10 +74,10 @@ Index: util-linux-ng-2.12r+2.13pre7/sys-utils/ionice.1
+
+.SH AUTHORS
+Jens Axboe <axboe@suse.de>
Index: util-linux-ng-2.12r+2.13pre7/sys-utils/ionice.c
Index: util-linux-ng-2.12r+git20070509/sys-utils/ionice.c
===================================================================
--- /dev/null
+++ util-linux-ng-2.12r+2.13pre7/sys-utils/ionice.c
+++ util-linux-ng-2.12r+git20070509/sys-utils/ionice.c
@@ -0,0 +1,144 @@
+/*
+ * ionice: set or get process io scheduling class and priority
@ -223,11 +223,11 @@ Index: util-linux-ng-2.12r+2.13pre7/sys-utils/ionice.c
+
+ return 0;
+}
Index: util-linux-ng-2.12r+2.13pre7/sys-utils/Makefile.am
Index: util-linux-ng-2.12r+git20070509/sys-utils/Makefile.am
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/sys-utils/Makefile.am
+++ util-linux-ng-2.12r+2.13pre7/sys-utils/Makefile.am
@@ -2,17 +2,17 @@
--- util-linux-ng-2.12r+git20070509.orig/sys-utils/Makefile.am
+++ util-linux-ng-2.12r+git20070509/sys-utils/Makefile.am
@@ -2,7 +2,7 @@ include $(top_srcdir)/config/include-Mak
bin_PROGRAMS = dmesg
@ -236,14 +236,12 @@ Index: util-linux-ng-2.12r+2.13pre7/sys-utils/Makefile.am
cytune_SOURCES = cytune.c cyclades.h
sbin_PROGRAMS = ctrlaltdel
usrsbinexec_PROGRAMS = readprofile tunelp
@@ -12,7 +12,7 @@ usrsbinexec_PROGRAMS = readprofile tunel
tunelp_SOURCES = tunelp.c lp.h
-man_MANS = flock.1 readprofile.1 \
+man_MANS = flock.1 ionice.1 readprofile.1 \
ctrlaltdel.8 cytune.8 dmesg.8 ipcrm.8 ipcs.8 renice.8 \
setsid.8 tunelp.8
ctrlaltdel.8 cytune.8 dmesg.1 ipcrm.1 ipcs.1 renice.1 \
setsid.1 tunelp.8

View File

@ -1,20 +0,0 @@
do not append addr option with each nfs remount [#130625]
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
@@ -303,8 +303,11 @@ int nfsmount(const char *spec, const cha
"excessively long option argument\n"));
goto fail;
}
- sprintf(new_opts, "%s%saddr=%s",
- old_opts, *old_opts ? "," : "", s);
+ if (*flags & MS_REMOUNT)
+ strcpy(new_opts, old_opts);
+ else
+ sprintf(new_opts, "%s%saddr=%s",
+ old_opts, *old_opts ? "," : "", s);
*extra_opts = xstrdup(new_opts);
/* Set default options.

View File

@ -1,116 +0,0 @@
Index: mount/nfsmount.c
===================================================================
--- mount/nfsmount.c.orig
+++ mount/nfsmount.c
@@ -117,8 +117,10 @@ find_kernel_nfs_mount_version(void) {
nfs_mount_version = 4; /* since 2.2.18pre9 */
else if (kernel_version < MAKE_VERSION(2,3,99))
nfs_mount_version = 3;
+ else if (kernel_version < MAKE_VERSION(2,6,3))
+ nfs_mount_version = 4;
else
- nfs_mount_version = 4; /* since 2.3.99pre4 */
+ nfs_mount_version = 6;
}
if (nfs_mount_version > NFS_MOUNT_VERSION)
nfs_mount_version = NFS_MOUNT_VERSION;
@@ -318,7 +320,6 @@ int nfsmount(const char *spec, const cha
#if NFS_MOUNT_VERSION >= 2
data.namlen = NAME_MAX;
#endif
-
bg = 0;
soft = 0;
intr = 0;
@@ -400,6 +401,38 @@ int nfsmount(const char *spec, const cha
printf(_("Warning: Option namlen is not supported.\n"));
} else if (!strcmp(opt, "addr")) {
/* ignore */;
+#if NFS_MOUNT_VERSION >= 5
+ } else if (!strcmp(opt, "sec")) {
+ char *secflavor = opteq+1;
+ /* see RFC 2623 */
+ if (nfs_mount_version < 5) {
+ printf(_("Warning: this version of mount(1) does not support RPCSEC_GSS, ignoring sec=%s option\n"), secflavor);
+ continue;
+ } else if (!strcmp(secflavor, "sys"))
+ data.pseudoflavor = AUTH_SYS;
+ else if (!strcmp(secflavor, "krb5"))
+ data.pseudoflavor = AUTH_GSS_KRB5;
+ else if (!strcmp(secflavor, "krb5i"))
+ data.pseudoflavor = AUTH_GSS_KRB5I;
+ else if (!strcmp(secflavor, "krb5p"))
+ data.pseudoflavor = AUTH_GSS_KRB5P;
+ else if (!strcmp(secflavor, "lipkey"))
+ data.pseudoflavor = AUTH_GSS_LKEY;
+ else if (!strcmp(secflavor, "lipkey-i"))
+ data.pseudoflavor = AUTH_GSS_LKEYI;
+ else if (!strcmp(secflavor, "lipkey-p"))
+ data.pseudoflavor = AUTH_GSS_LKEYP;
+ else if (!strcmp(secflavor, "spkm3"))
+ data.pseudoflavor = AUTH_GSS_SPKM;
+ else if (!strcmp(secflavor, "spkm3i"))
+ data.pseudoflavor = AUTH_GSS_SPKMI;
+ else if (!strcmp(secflavor, "spkm3p"))
+ data.pseudoflavor = AUTH_GSS_SPKMP;
+ else if(!sloppy) {
+ printf(_("Warning: Unrecognized security flavor %s.\n"), secflavor);
+ goto fail;
+ }
+#endif
} else {
printf(_("unknown nfs mount parameter: "
"%s=%d\n"), opt, val);
@@ -472,6 +505,11 @@ retry_udp:
data.flags |= (noacl ? NFS_MOUNT_NOACL : 0);
}
#endif
+#if NFS_MOUNT_VERSION >= 5
+ if ((nfs_mount_version >= 5) && data.pseudoflavor) {
+ data.flags |= NFS_MOUNT_SECFLAVOUR;
+ }
+#endif
if (nfsvers > MAX_NFSPROT) {
fprintf(stderr, "NFSv%d not supported!\n", nfsvers);
return 0;
@@ -508,6 +546,9 @@ retry_udp:
printf("tcp = %d\n",
(data.flags & NFS_MOUNT_TCP) != 0);
#endif
+#if NFS_MOUNT_VERSION >= 5
+ printf("sec = %u\n", data.pseudoflavor);
+#endif
#endif
data.version = nfs_mount_version;
@@ -715,6 +756,30 @@ retry_udp:
nfs_strerror(status.nfsv3.fhs_status));
goto fail;
}
+#if NFS_MOUNT_VERSION >= 5
+ if (data.pseudoflavor) {
+ mountres3_ok *mountres = &status.nfsv3.mountres3_u.mountinfo;
+ int i = mountres->auth_flavours.auth_flavours_len;
+
+ if (i > 0) {
+ int *flavor = mountres->auth_flavours.auth_flavours_val;
+ while (--i >= 0) {
+ if (flavor[i] == data.pseudoflavor) {
+ break;
+ }
+ }
+
+ if (i < 0) {
+ fprintf(stderr,
+ "mount: %s:%s failed, security flavor not supported\n",
+ hostname, dirname);
+ mountproc3_umnt_3(&dirname,mclient);
+ goto fail;
+ }
+ }
+ }
+#endif
+
fhandle = &status.nfsv3.mountres3_u.mountinfo.fhandle;
memset(data.old_root.data, 0, NFS_FHSIZE);
memset(&data.root, 0, sizeof(data.root));

View File

@ -1,51 +0,0 @@
From: http://www.citi.umich.edu/projects/nfsv4/linux/util-linux-patches
Subject: Update nfs(5) manpage to document security flavors
References: 159368
Acked-by: okir@suse.de
mount/nfs.5 | 24 ++++++++++++++++++++----
1 files changed, 20 insertions(+), 4 deletions(-)
Index: util-linux-ng-2.12r+2.13pre7/mount/nfs.5
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfs.5
+++ util-linux-ng-2.12r+2.13pre7/mount/nfs.5
@@ -165,7 +165,7 @@ mount daemon program number.
Use an alternate RPC version number to contact the
mount daemon on the remote host. This option is useful
for hosts that can run multiple NFS servers.
-The default value is version 1.
+The default value depends on which kernel you are using.
.TP 1.5i
.I nfsprog=n
Use an alternate RPC program number to contact the
@@ -230,9 +230,25 @@ Suppress the retrieval of new attributes
.TP 1.5i
.I noac
Disable all forms of attribute caching entirely. This extracts a
-server performance penalty but it allows two different NFS clients
-to get reasonable good results when both clients are actively
-writing to common filesystem on the server.
+significant performance penalty but it allows two different NFS clients
+to get reasonable results when both clients are actively
+writing to a common export on the server.
+.TP 1.5i
+.I sec=mode
+Set the security flavor for this mount to "mode".
+The default setting is \f3sec=sys\f1, which uses local
+unix uids and gids to authenticate NFS operations (AUTH_SYS).
+Other currently supported settings are:
+\f3sec=krb5\f1, which uses Kerberos V5 instead of local unix uids
+and gids to authenticate users;
+\f3sec=krb5i\f1, which uses Kerberos V5 for user authentication
+and performs integrity checking of NFS operations using secure
+checksums to prevent data tampering; and
+\f3sec=krb5p\f1, which uses Kerberos V5 for user authentication
+and integrity checking, and encrypts NFS traffic to prevent
+traffic sniffing (this is the most secure setting).
+Note that there is a performance penalty when using integrity
+or privacy.
.TP 1.5i
.I tcp
Mount the NFS filesystem using the TCP protocol instead of the

View File

@ -1,44 +1,4 @@
## 30swsusp-resume.dpatch by Jeff Bailey <jbailey@ubuntu.com>
Index: util-linux-ng-2.12r+git20070330/mount/get_label_uuid.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/get_label_uuid.c
+++ util-linux-ng-2.12r+git20070330/mount/get_label_uuid.c
@@ -93,7 +93,25 @@ is_v1_swap_partition(int fd, char **labe
}
return 0;
}
-
+
+static int
+is_swsuspend_partition(int fd, char **label, char *uuid) {
+ int n = getpagesize();
+ char *buf = xmalloc(n);
+ struct swap_header_v1_2 *p = (struct swap_header_v1_2 *) buf;
+
+ if (lseek(fd, 0, SEEK_SET) == 0
+ && read(fd, buf, n) == n
+ && (strncmp(buf+n-10, "S1SUSPEND", 9)==0 ||
+ strncmp(buf+n-10, "S2SUSPEND", 9)==0 ||
+ strncmp(buf+n-10, "ULSUSPEND", 9)==0)
+ && p->version == 1) {
+ store_uuid(uuid, p->uuid);
+ store_label(label, p->volume_name, 16);
+ return 1;
+ }
+ return 0;
+}
/*
* Get both label and uuid.
@@ -126,6 +144,8 @@ get_label_uuid(const char *device, char
if (is_v1_swap_partition(fd, label, uuid))
goto done;
+ if (is_swsuspend_partition(fd, label, uuid))
+ goto done;
if (lseek(fd, 1024, SEEK_SET) == 1024
&& read(fd, (char *) &e2sb, sizeof(e2sb)) == sizeof(e2sb)
Index: util-linux-ng-2.12r+git20070330/mount/swapon.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/swapon.c

View File

@ -1,15 +0,0 @@
Added sysfs to list of filesystems not to unmount with umount -a [#190385]
Index: mount/umount.c
===================================================================
--- mount/umount.c.orig
+++ mount/umount.c
@@ -721,7 +721,7 @@ main (int argc, char *argv[]) {
if (all) {
/* nodev stuff: sysfs, usbfs, oprofilefs, ... */
if (types == NULL)
- types = "noproc,nodevfs,nodevpts";
+ types = "noproc,nodevfs,nodevpts,nosysfs";
result = umount_all (types, test_opts);
} else if (argc < 1) {
usage (stderr, 2);

View File

@ -1,13 +0,0 @@
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
@@ -487,7 +487,7 @@ retry_udp:
/* Adjust options if none specified */
if (!data.timeo)
- data.timeo = tcp ? 70 : 7;
+ data.timeo = tcp ? 600 : 7;
#ifdef NFS_MOUNT_DEBUG
printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
Index: util-linux-ng-2.12r+git20070330/sys-utils/Makefile.am
Index: util-linux-ng-2.12r+git20070509/sys-utils/Makefile.am
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/sys-utils/Makefile.am
+++ util-linux-ng-2.12r+git20070330/sys-utils/Makefile.am
--- util-linux-ng-2.12r+git20070509.orig/sys-utils/Makefile.am
+++ util-linux-ng-2.12r+git20070509/sys-utils/Makefile.am
@@ -1,9 +1,11 @@
include $(top_srcdir)/config/include-Makefile.am
@ -21,13 +21,13 @@ Index: util-linux-ng-2.12r+git20070330/sys-utils/Makefile.am
-man_MANS = flock.1 ionice.1 readprofile.1 \
+man_MANS = arch.1 flock.1 ionice.1 readprofile.1 \
ctrlaltdel.8 cytune.8 dmesg.8 ipcrm.8 ipcs.8 renice.8 \
setsid.8 tunelp.8
ctrlaltdel.8 cytune.8 dmesg.1 ipcrm.1 ipcs.1 renice.1 \
setsid.1 tunelp.8
Index: util-linux-ng-2.12r+git20070330/sys-utils/arch.1
Index: util-linux-ng-2.12r+git20070509/sys-utils/arch.1
===================================================================
--- /dev/null
+++ util-linux-ng-2.12r+git20070330/sys-utils/arch.1
+++ util-linux-ng-2.12r+git20070509/sys-utils/arch.1
@@ -0,0 +1,34 @@
+.\" arch.1 --
+.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
@ -63,10 +63,10 @@ Index: util-linux-ng-2.12r+git20070330/sys-utils/arch.1
+.\" Then how come we get these i586 values?
+.\" Well, the routine check_bugs() does system_utsname.machine[1] = '0' + x86;
+.\" (called in init/main.c, defined in ./include/asm-i386/bugs.h)
Index: util-linux-ng-2.12r+git20070330/sys-utils/arch.c
Index: util-linux-ng-2.12r+git20070509/sys-utils/arch.c
===================================================================
--- /dev/null
+++ util-linux-ng-2.12r+git20070330/sys-utils/arch.c
+++ util-linux-ng-2.12r+git20070509/sys-utils/arch.c
@@ -0,0 +1,35 @@
+/* arch -- print machine architecture information
+ * Created: Mon Dec 20 12:27:15 1993 by faith@cs.unc.edu

View File

@ -1,483 +0,0 @@
Index: util-linux-ng-2.12r+git20070330/mount/fstab.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/fstab.c
+++ util-linux-ng-2.12r+git20070330/mount/fstab.c
@@ -305,6 +305,7 @@ has_uuid(const char *device, const char
struct mntentchn *
getfsspecfile (const char *spec, const char *file) {
struct mntentchn *mc, *mc0;
+ char *nspec;
mc0 = fstab_head();
@@ -315,11 +316,12 @@ getfsspecfile (const char *spec, const c
return mc;
/* second attempt: names found after symlink resolution */
+ nspec = canonicalize(spec);
for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
if ((streq(mc->m.mnt_dir, file) ||
streq(canonicalize(mc->m.mnt_dir), file))
&& (streq(mc->m.mnt_fsname, spec) ||
- streq(canonicalize(mc->m.mnt_fsname), spec)))
+ streq(canonicalize(mc->m.mnt_fsname), nspec)))
return mc;
/* third attempt: names found after LABEL= or UUID= resolution */
@@ -356,11 +358,21 @@ getfsfile (const char *file) {
struct mntentchn *
getfsspec (const char *spec) {
struct mntentchn *mc, *mc0;
+ const char *nspec, *fsname;
mc0 = fstab_head();
- for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
- if (streq(mc->m.mnt_fsname, spec))
+ for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) {
+ if (!strncmp (mc->m.mnt_fsname, "LABEL=", 6)) {
+ fsname = mount_get_devname_by_label(mc->m.mnt_fsname + 6);
+ } else if (!strncmp(mc->m.mnt_fsname, "UUID=", 5)) {
+ fsname = mount_get_devname_by_uuid(mc->m.mnt_fsname + 5);
+ } else {
+ fsname = mc->m.mnt_fsname;
+ }
+ nspec = canonicalize(fsname);
+ if (streq(nspec, spec))
return mc;
+ }
return NULL;
}
@@ -723,6 +735,8 @@ char *progname;
const char *mount_get_volume_label_by_spec(const char *spec) { return NULL; }
const char *mount_get_devname_by_uuid(const char *uuid) { return NULL; }
+const char *mount_get_devname_by_label(const char *label) { return NULL; }
+const char *mount_get_volume_uuid_by_spec(const char *spec) { return NULL; }
struct my_mntent *my_getmntent (mntFILE *mfp) { return NULL; }
mntFILE *my_setmntent (const char *file, char *mode) { return NULL; }
void my_endmntent (mntFILE *mfp) { }
Index: util-linux-ng-2.12r+git20070330/mount/mount.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/mount.c
+++ util-linux-ng-2.12r+git20070330/mount/mount.c
@@ -1746,6 +1746,8 @@ main(int argc, char *argv[]) {
if (mc == NULL)
mc = getfsspec (spec);
if (mc == NULL)
+ mc = getfsspec (canonicalize(spec));
+ if (mc == NULL)
die (EX_USAGE,
_("mount: cannot find %s in %s"),
spec, _PATH_FSTAB);
Index: util-linux-ng-2.12r+git20070330/mount/mount_blkid.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_blkid.c
+++ util-linux-ng-2.12r+git20070330/mount/mount_blkid.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include "mount_blkid.h"
+#ifndef HAVE_LIBVOLUME_ID
#ifdef HAVE_LIBBLKID
blkid_cache blkid;
@@ -118,4 +119,5 @@ mount_get_devname_for_mounting(const cha
}
-#endif
+#endif /* HAVE_LIBBLKID */
+#endif /* HAVE_LIBVOLUME_ID */
Index: util-linux-ng-2.12r+git20070330/mount/mount_blkid.h
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_blkid.h
+++ util-linux-ng-2.12r+git20070330/mount/mount_blkid.h
@@ -11,3 +11,5 @@ extern const char *mount_get_volume_uuid
extern const char *mount_get_volume_label_by_spec(const char *spec);
extern const char *mount_get_devname(const char *spec);
extern const char *mount_get_devname_for_mounting(const char *spec);
+
+extern const char *volume_id_get_tag(const char *spec, const char *token);
Index: util-linux-ng-2.12r+git20070330/mount/mount_by_label.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_by_label.c
+++ util-linux-ng-2.12r+git20070330/mount/mount_by_label.c
@@ -1,4 +1,4 @@
-#ifndef HAVE_LIBBLKID
+#if (!defined HAVE_BLKID) && (!defined HAVE_LIBVOLUME_ID)
/*
* mount_by_label.c - aeb
*
Index: util-linux-ng-2.12r+git20070330/mount/mount_guess_fstype.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_guess_fstype.c
+++ util-linux-ng-2.12r+git20070330/mount/mount_guess_fstype.c
@@ -46,15 +46,29 @@
#define ETC_FILESYSTEMS "/etc/filesystems"
#define PROC_FILESYSTEMS "/proc/filesystems"
+#ifdef HAVE_LIBVOLUME_ID
+
+static int
+known_fstype(const char *fstype) {
+ return 0;
+}
+
+const char *
+do_guess_fstype(const char *spec)
+{
+ return volume_id_get_tag(spec, "TYPE");
+}
+
+#else
#ifdef HAVE_LIBBLKID
-char *
+const char *
do_guess_fstype(const char *device)
{
return blkid_get_tag_value(blkid, "TYPE", device);
}
-static int
+const static int
known_fstype(const char *fstype)
{
return blkid_known_fstype(fstype);
@@ -492,6 +506,7 @@ io_error:
}
#endif
+#endif
static struct tried {
struct tried *next;
@@ -534,9 +549,9 @@ free_tested(void) {
tried = NULL;
}
-char *
+const char *
guess_fstype(const char *spec) {
- char *type = do_guess_fstype(spec);
+ const char *type = do_guess_fstype(spec);
if (verbose) {
printf (_("mount: you didn't specify a filesystem type for %s\n"),
spec);
Index: util-linux-ng-2.12r+git20070330/mount/mount_udev.c
===================================================================
--- /dev/null
+++ util-linux-ng-2.12r+git20070330/mount/mount_udev.c
@@ -0,0 +1,237 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/mount.h>
+#include <sys/ioctl.h>
+#include <nls.h>
+#include <stddef.h>
+#include <libvolume_id.h>
+
+#include "mount_blkid.h"
+
+#ifdef HAVE_LIBVOLUME_ID
+
+extern int verbose;
+
+struct volume_id_types_t {
+ int id;
+ char *token;
+ char *env;
+};
+
+enum {
+ VOLUME_ID_NONE=0,
+ VOLUME_ID_TYPE,
+ VOLUME_ID_LABEL,
+ VOLUME_ID_UUID
+};
+
+#define volume_id_offset(member) (unsigned long)offsetof(struct volume_id,member)
+
+struct volume_id_types_t volume_id_types[] = {
+ { VOLUME_ID_TYPE, "TYPE", "ID_FS_TYPE" },
+ { VOLUME_ID_LABEL, "LABEL", "ID_FS_LABEL" },
+ { VOLUME_ID_UUID, "UUID", "ID_FS_UUID" },
+ { VOLUME_ID_NONE, NULL, NULL },
+};
+
+const char *
+volume_id_get_tag(const char *spec, const char *token)
+{
+ struct volume_id *vid;
+ uint64_t size;
+ struct volume_id_types_t *volume_id_ptr = volume_id_types;
+ char *var, *value;
+
+ value = calloc(1, VOLUME_ID_LABEL_SIZE);
+ if (!value)
+ return NULL;
+
+ if (!spec)
+ return NULL;
+
+ while (volume_id_ptr->token && strcmp(volume_id_ptr->token,token))
+ volume_id_ptr++;
+
+ if (!volume_id_ptr->token) {
+ free(value);
+ value = NULL;
+ goto out;
+ }
+
+ /* Quick exit if ID_FS_* variables are set */
+ if ((var = getenv(volume_id_ptr->env))) {
+ strncpy(value,var,VOLUME_ID_LABEL_SIZE - 1);
+ goto out;
+ }
+
+ vid = volume_id_open_node(spec);
+ if (!vid) {
+ free(value);
+ value = NULL;
+ goto out;
+ }
+
+ if (ioctl(vid->fd, BLKGETSIZE64, &size) != 0)
+ size = 0;
+
+ if (volume_id_probe_all(vid, 0, size) == 0) {
+ switch(volume_id_ptr->id) {
+ case VOLUME_ID_TYPE:
+ strcpy(value, vid->type);
+ break;
+ case VOLUME_ID_LABEL:
+ strcpy(value, vid->label);
+ break;
+ case VOLUME_ID_UUID:
+ strcpy(value, vid->uuid);
+ break;
+ default:
+ free(value);
+ value = NULL;
+ break;
+ }
+ } else
+ value = NULL;
+
+ volume_id_close(vid);
+
+ out:
+ return value;
+}
+
+void
+mount_blkid_get_cache(void) {}
+
+void
+mount_blkid_put_cache(void) {}
+
+const char *
+mount_get_volume_uuid_by_spec(const char *spec)
+{
+ return volume_id_get_tag(spec, "UUID");
+}
+
+const char *
+mount_get_volume_label_by_spec(const char *spec)
+{
+ return volume_id_get_tag(spec, "LABEL");
+}
+
+const char *
+mount_get_devname_by_uuid(const char *uuid) {
+ char *dev = NULL;
+
+ if (!uuid)
+ return NULL;
+
+ dev = malloc(19 + strlen(uuid));
+ if (dev) {
+ strcpy(dev,"/dev/disk/by-uuid/");
+ strcat(dev,uuid);
+ }
+
+ return dev;
+}
+
+const char *
+mount_get_devname_by_label(const char *label) {
+ char *dev = NULL;
+
+ if (!label)
+ return NULL;
+
+ dev = malloc(20 + strlen(label));
+ if (dev) {
+ strcpy(dev,"/dev/disk/by-label/");
+ strcat(dev,label);
+ }
+
+ return dev;
+}
+
+const char *
+mount_get_devname(const char *spec)
+{
+ char *token, *cp, *value;
+ const char *nspec = NULL;
+
+ if (!spec)
+ return NULL;
+
+ token = strdup(spec);
+ if (!token)
+ return NULL;
+
+ /* We have to return an allocated string */
+ if (!(cp = strchr(token, '=')))
+ return token;
+
+ value = token + (cp - token);
+ *value++ = '\0';
+
+ if (*value == '"' || *value == '\'') {
+ char c = *value++;
+ if (!(cp = strrchr(value, c)))
+ goto errout; /* missing closing quote */
+ *cp = '\0';
+ }
+
+ if (!strcmp(token,"LABEL")) {
+ nspec = mount_get_devname_by_label(value);
+ } else if (!strcmp(token,"UUID")) {
+ nspec = mount_get_devname_by_uuid(value);
+ }
+
+ free(token);
+
+ errout:
+ return nspec;
+}
+
+/* Also when no UUID= or LABEL= occur? No verbose? No warnings? */
+const char *
+mount_get_devname_for_mounting(const char *spec)
+{
+ char *token, *cp, *value;
+ const char *nspec = NULL;
+
+ if (!spec)
+ return NULL;
+
+ token = strdup(spec);
+ if (!token)
+ return NULL;
+
+ /* We have to return an allocated string */
+ if (!(cp = strchr(token, '=')))
+ return token;
+
+ value = token + (cp - token);
+ *value++ = '\0';
+
+ if (*value == '"' || *value == '\'') {
+ char c = *value++;
+ if (!(cp = strrchr(value, c)))
+ goto errout; /* missing closing quote */
+ *cp = '\0';
+ }
+
+ if (!strcmp(token,"LABEL")) {
+ nspec = mount_get_devname_by_label(value);
+ if (nspec && verbose > 1)
+ printf(_("mount: going to mount %s by LABEL\n"), spec);
+ } else if (!strcmp(token,"UUID")) {
+ nspec = mount_get_devname_by_uuid(value);
+ if (nspec && verbose > 1)
+ printf(_("mount: going to mount %s by UUID\n"), spec);
+ }
+
+ free(token);
+
+ errout:
+ return nspec;
+}
+
+#endif
Index: util-linux-ng-2.12r+git20070330/mount/mount_guess_fstype.h
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_guess_fstype.h
+++ util-linux-ng-2.12r+git20070330/mount/mount_guess_fstype.h
@@ -8,8 +8,8 @@ struct mountargs {
extern int verbose;
-char *guess_fstype(const char *device);
-char *do_guess_fstype(const char *device);
+const char *guess_fstype(const char *device);
+const char *do_guess_fstype(const char *device);
int procfsloop(int (*mount_fn)(struct mountargs *), struct mountargs *args,
const char **type);
int is_in_procfs(const char *fstype);
Index: util-linux-ng-2.12r+git20070330/configure.ac
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/configure.ac
+++ util-linux-ng-2.12r+git20070330/configure.ac
@@ -57,8 +57,10 @@ AC_CHECK_LIB(termcap, tgetnum)
AM_CONDITIONAL(HAVE_TERMCAP, test x$ac_cv_lib_termcap_tgetnum = xyes)
AC_CHECK_LIB(blkid, blkid_known_fstype)
-AM_CONDITIONAL(HAVE_BLKID, test x$ac_cv_lib_blkid_blkid_known_fstype = xyes)
+AC_CHECK_LIB(volume_id, volume_id_open_node)
+AM_CONDITIONAL(HAVE_BLKID, test x$ac_cv_lib_blkid_blkid_known_fstype = xyes)
+AM_CONDITIONAL(HAVE_VOLUME_ID, test x$ac_cv_lib_volume_id_volume_id_open_node = xyes)
AM_GNU_GETTEXT_VERSION([0.14.1])
AM_GNU_GETTEXT([external])
Index: util-linux-ng-2.12r+git20070330/mount/Makefile.am
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/Makefile.am
+++ util-linux-ng-2.12r+git20070330/mount/Makefile.am
@@ -16,7 +16,7 @@ MNTHDRS = fstab.h linux_fs.h mount_mnten
mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
get_label_uuid.c mount_by_label.c mount_blkid.c mount_guess_fstype.c \
- getusername.c \
+ mount_udev.c getusername.c \
nfsmount.c nfsmount_clnt.c nfs4mount.c \
lomount.c \
$(MNTHDRS)
@@ -24,14 +24,14 @@ mount_SOURCES = mount.c fstab.c sundries
mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a libnfsmount_xdr.a
umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
- getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c \
+ getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c mount_udev.c \
lomount.c \
$(MNTHDRS)
umount_LDADD = $(top_srcdir)/lib/libenv.a
swapon_SOURCES = swapon.c xmalloc.c \
- get_label_uuid.c mount_by_label.c mount_blkid.c \
+ get_label_uuid.c mount_by_label.c mount_blkid.c mount_udev.c \
swap_constants.h realpath.c
losetup_SOURCES = lomount.c loop.h lomount.h
@@ -43,6 +43,12 @@ umount_LDADD += -lblkid -luuid
swapon_LDADD = -lblkid -luuid
endif
+if HAVE_VOLUME_ID
+mount_LDADD += -lvolume_id
+umount_LDADD += -lvolume_id
+swapon_LDADD = -lvolume_id
+endif
+
if HAVE_PIVOT_ROOT
sbin_PROGRAMS += pivot_root
man_MANS += pivot_root.8

View File

@ -1,11 +0,0 @@
--- util-linux-2.12q/mount/nfs.5
+++ util-linux-2.12q/mount/nfs.5
@@ -141,7 +141,7 @@
Use an alternate RPC version number to contact the
NFS daemon on the remote host. This option is useful
for hosts that can run multiple NFS servers.
-The default value is version 2.
+The default value is version 3.
.TP 1.5i
.I nolock
Disable NFS locking. Do not start lockd.

View File

@ -1,120 +0,0 @@
Index: util-linux-ng-2.12r+2.13pre7/mount/nfs.5
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfs.5
+++ util-linux-ng-2.12r+2.13pre7/mount/nfs.5
@@ -238,9 +238,13 @@ writing to common filesystem on the serv
Mount the NFS filesystem using the TCP protocol instead of the
UDP protocol. This is the default, but in case it fails (many NFS servers only
support UDP) it will fallback and try UDP.
+.IP
+.B Before using NFS over UDP, please refer to the section WARNINGS below.
.TP 1.5i
.I udp
Mount the NFS filesystem using the UDP protocol.
+.IP
+.B Before using NFS over UDP, please refer to the section WARNINGS below.
.TP 1.5i
.I noacl
Assume no extended access control mechanisms like POSIX ACLs are used
@@ -411,6 +415,83 @@ writing to common filesystem on the serv
All of the non-value options have corresponding nooption forms.
For example, nointr means don't allow file operations to be
interrupted.
+.SH WARNINGS
+Using NFS over UDP on high-speed links such as Gigabit
+.BR "can cause silent data corruption" .
+.P
+The problem can be triggered at high loads, and is caused by problems in
+IP fragment reassembly. NFS read and writes typically transmit UDP packets
+of 4 Kilobytes or more, which have to be broken up into several fragments
+in order to be sent over the Ethernet link, which limits packets to 1500
+bytes by default. This process happens at the IP network layer and is
+called fragmentation.
+.P
+In order to identify fragments that belong together, IP assigns a 16bit
+.I IP ID
+value to each packet; fragments generated from the same UDP packet
+will have the same IP ID. The receiving system will collect these
+fragments and combine them to form the original UDP packet. This process
+is called reassembly. The default timeout for packet reassembly is
+30 seconds; if the network stack does not receive all fragments of
+a given packet within this interval, it assumes the missing fragment(s)
+got lost and discards those it already received.
+.P
+The problem this creates over high-speed links is that it is possible
+to send more than 65536 packets within 30 seconds. In fact, with
+heavy NFS traffic one can observe that the IP IDs repeat after about
+5 seconds.
+.P
+This has serious effects on reassembly: if one fragment gets lost,
+another fragment
+.I from a different packet
+but with the
+.I same IP ID
+will arrive within the 30 second timeout, and the network stack will
+combine these fragments to form a new packet. Most of the time, network
+layers above IP will detect this mismatched reassembly - in the case
+of UDP, the UDP checksum, which is a 16 bit checksum over the entire
+packet payload, will usually not match, and UDP will discard the
+bad packet.
+.P
+However, the UDP checksum is 16 bit only, so there is a chance of 1 in
+65536 that it will match even if the packet payload is completely
+random (which very often isn't the case). If that is the case,
+silent data corruption will occur.
+.P
+This potential should be taken seriously, at least on Gigabit
+Ethernet.
+Network speeds of 100Mbit/s should be considered less
+problematic, because with most traffic patterns IP ID wrap around
+will take much longer than 30 seconds.
+.P
+It is therefore strongly recommended to use
+.BR "NFS over TCP where possible" ,
+since TCP does not perform fragmentation.
+.P
+If you absolutely have to use NFS over UDP over Gigabit Ethernet,
+some steps can be taken to mitigate the problem and reduce the
+probability of corruption:
+.TP +1.5i
+.I Jumbo frames:
+Many Gigabit network cards are capable of transmitting
+frames bigger than the 1500 byte limit of traditional Ethernet, typically
+9000 bytes. Using jumbo frames of 9000 bytes will allow you to run NFS over
+UDP at a page size of 8K without fragmentation. Of course, this is
+only feasible if all involved stations support jumbo frames.
+.IP
+To enable a machine to send jumbo frames on cards that support it,
+it is sufficient to configure the interface for a MTU value of 9000.
+.TP +1.5i
+.I Lower reassembly timeout:
+By lowering this timeout below the time it takes the IP ID counter
+to wrap around, incorrect reassembly of fragments can be prevented
+as well. To do so, simply write the new timeout value (in seconds)
+to the file
+.BR /proc/sys/net/ipv4/ipfrag_time .
+.IP
+A value of 2 seconds will greatly reduce the probability of IPID clashes on
+a single Gigabit link, while still allowing for a reasonable timeout
+when receiving fragmented traffic from distant peers.
.SH FILES
.I /etc/fstab
.SH "SEE ALSO"
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
@@ -735,8 +735,12 @@ retry_udp:
goto fail;
}
fsock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- } else
+ } else {
fsock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ fprintf(stderr,
+ "Using NFS over UDP can cause data corruption.\n"
+ "Please refer to the WARNINGS section of the nfs(5) manual page.\n");
+ }
if (fsock < 0) {
perror(_("nfs socket"));
goto fail;

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:24be49bdf51ff79df2f4289c2c72471aefd9e2a5473cac2c66893cbee612a040
size 1521684

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be7bac40f6c1ba44b66cd829241f8c6368ff56e823d1c7f673c0321b3d980f99
size 1504607

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Tue Jun 5 17:01:48 CEST 2007 - mkoenig@suse.de
- update to git20070509
mount: NFS code removed (use mount.nfs{,4} from nfs-utils)
- remove sm-notify (nfs-utils)
- removed patches
util-linux-2.11u-mount_nfs_mount_acl.patch
util-linux-2.12-mount_base_nfsv4.patch
util-linux-2.12-mount_mountfallback.patch
util-linux-2.12-mount_nfs_tcp.patch
util-linux-2.12q-mount_strict_aliasing.patch
util-linux-2.12r-mount_nfs_remount_options.patch
util-linux-2.12r-mount_rpcsec_gss.patch
util-linux-2.12r-mount_sec_manpage.patch
util-linux-2.12r-mount_umount_nosysfs.patch
util-linux-2.13-mount_nfs_timeo.patch
util-linux-mount_nfs.8.patch
util-linux-mount_warn_nfsudp.patch
-------------------------------------------------------------------
Tue Jun 5 14:34:49 CEST 2007 - pth@suse.de

View File

@ -1,5 +1,5 @@
#
# spec file for package util-linux (Version 2.12r+git20070412)
# spec file for package util-linux (Version 2.12r+git20070509)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -20,8 +20,8 @@ PreReq: %install_info_prereq permissions
License: BSD License and BSD-like, GNU General Public License (GPL)
Group: System/Base
Autoreqprov: on
Version: 2.12r+git20070412
Release: 14
Version: 2.12r+git20070509
Release: 1
Summary: A collection of basic system utilities
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/%name-ng-%version.tar.bz2
Source2: nologin.c
@ -40,51 +40,33 @@ Source13: time-%{time_ver}.tar.gz
Source15: cryptoloop.txt
Source22: setctsid.c
Source23: setctsid.8
Source24: sm-notify-20060111.tar.bz2
Source25: nfsboot
Source26: README.raw
Source27: renice.8
Source28: mkzimage_cmdline.8
Source29: mkzimage_cmdline.c
Source30: README.largedisk
##
## util-linux
##
Patch0: util-linux-2.13-mount_volume_id.patch
# add hostid
Patch1: util-linux-2.12-misc_utils_hostid.patch
# 27181 (suse12181) - wall adds newlines
Patch2: util-linux-login_utils_wall.patch
# 31815 (suse16815) - Fixed nfs.5 to tell nfsver defaults to 3
Patch3: util-linux-mount_nfs.8.patch
# 33183 (suse18183) - NFS ACCESS patch, [no]acl nfs mount option
Patch4: util-linux-2.11u-mount_nfs_mount_acl.patch
Patch5: util-linux-mount_mount.8-acl.patch
# geteuid instead of getuid in hwclock to enable making hwclock suid root.
Patch6: util-linux-2.11z-hwclock_geteuid.patch
# 48018 (suse33018) - mount -t nfs must default to tcp in sles9
Patch7: util-linux-2.12-mount_nfs_tcp.patch
# 54436 (suse39436) - boot.swap "failed" activating swap on LVM
Patch8: util-linux-2.12a-mount_procswapcheck.patch
# 56735 (suse41735) - NFS can't mount some exports
Patch9: util-linux-2.12-mount_mountfallback.patch
# 57097 (suse42097) - mount doesn't allow to mount files that have colons in their path
Patch10: util-linux-2.12a-mount_mountpointwithcolon.patch
# 76198 - Default retransmit timeout is too small on NFS over TCP
Patch11: util-linux-2.13-mount_nfs_timeo.patch
# Basic NFSv4 support
Patch12: util-linux-2.12-mount_base_nfsv4.patch
# 80263 - UDP data corruption due to incorrect IP fragment reassembly
Patch13: util-linux-mount_warn_nfsudp.patch
# add ionice
Patch14: util-linux-2.12q-sys_utils_ionice.patch
# 104081 - make fdisk detect MAC-fs
Patch15: util-linux-2.11q-fdisk_fs_mac.patch
# 104405 - mount -a doesn't work with hotpluggable devices
Patch16: util-linux-mount_opt_hotplug.patch
Patch17: util-linux-2.12a-mount_mountbylabel-dm.patch
# 115129 - mount --move doesn't work as expected
Patch18: util-linux-2.12q-mount_--move.patch
Patch19: util-linux-2.12q-mount_strict_aliasing.patch
Patch20: util-linux-2.12r-mount_by_uuid.patch
Patch21: util-linux-2.12q-mount_umount2_not_static.patch
# 148409 - df, mount, /proc/mounts show root mounted twice
@ -92,19 +74,11 @@ Patch21: util-linux-2.12q-mount_umount2_not_static.patch
Patch22: util-linux-2.12r-mount_mtab_update.patch
# 153657 - fdisk is not able to manage huge disks
Patch23: util-linux-2.12r-fdisk_fdiskwrap.patch
# 158401 - cthon06: NFSv3 client does not support RPCSEC_GSS
Patch24: util-linux-2.12r-mount_rpcsec_gss.patch
# 176582 - If the user doesn't specify -t <fstype> mount.fstype will never be called
#TODO: check alternative upstream fix
#Patch96: util-linux-2.12r-mount_external_prog_on_guess.patch
# 159368 - NFSv4: krb5p; nfs(5) manpage
Patch25: util-linux-2.12r-mount_sec_manpage.patch
# 158955 - document xfs dmapi mount options better
Patch26: util-linux-2.12r-mount_mount.8_xfs_update.patch
# use libvolume_id for fs guessing
Patch27: util-linux-mount_libvolume_id_support.patch
# 190385 - Added sysfs to list of filesystems not to unmount with umount -a
Patch28: util-linux-2.12r-mount_umount_nosysfs.patch
# 160822 - fix for 153657
Patch29: util-linux-2.12r-fdisk_cyl.patch
# 179122 - Fix readprofile one ppc64
@ -113,8 +87,6 @@ Patch30: util-linux-2.12r-sys_utils_readprofile_mapfile.patch
Patch31: util-linux-2.12r-misc_utils_cal_formatting.patch
# 205956 - default swap to V1 in any case
Patch32: util-linux-2.12r-disk_utils_mkswap_fix.patch
# 130625 - do not append addr option with each nfs remount
Patch33: util-linux-2.12r-mount_nfs_remount_options.patch
# 238687 - let mkfs tools open block devices with O_EXCL
Patch34: util-linux-2.12r-disk_utils_mkfs_open_exclusive.patch
# 241372 - remove legacy warnings from fdisk
@ -122,6 +94,7 @@ Patch35: util-linux-2.12r-fdisk_remove_bogus_warnings.patch
# 242750 - mount: fix race condition when using -o loop
Patch36: util-linux-2.12r-mount_racy_loop.patch
# 254437 - swapon should automatically reset the suspend signature
# TODO: Needs to be ported to new version
Patch38: util-linux-2.12r-mount_swapon_swsuspend_resume.patch
Patch40: util-linux-2.13-sys_utils_arch.patch
Patch41: util-linux-2.13-build_gnu_source.patch
@ -159,44 +132,31 @@ Authors:
Karel Zak <kzak@redhat.com>
%prep
%setup -q -a 9 -b 10 -b 11 -b 12 -b 13 -b 24 -n %name-ng-%version
%setup -q -a 9 -b 10 -b 11 -b 12 -b 13 -n %name-ng-%version
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p0
%patch6
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18
%patch19 -p1
%patch20 -p1
#%patch20 -p1
%patch21
%patch22
%patch23 -p1
%patch24
%patch25 -p1
%patch26
%patch27 -p1
%patch28
%patch29 -p1
%patch30 -p1
%patch31
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch38 -p1
#%patch38 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
@ -216,7 +176,6 @@ cd ../time-*
%patch60
cd ../which-*
%patch70
autoreconf -fi
%build
# adjtimex build
@ -231,12 +190,11 @@ make CFLAGS="$RPM_OPT_FLAGS" freeramdisk
cd ..
# which build
cd which-%{which_ver}
autoreconf -fi
%{?suse_update_config:%{suse_update_config}}
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr \
--mandir=%{_mandir} \
--infodir=%{_infodir} \
--libdir=%{_libdir} \
--disable-iberty \
%{_target_cpu}-suse-linux
make
cd ..
@ -255,10 +213,6 @@ cd ..
cd klogconsole
make CFLAGS="$RPM_OPT_FLAGS"
cd ..
# sm-notify build
cd sm-notify*
make CFLAGS="$RPM_OPT_FLAGS"
cd ..
popd
# setctsid build
rm -f setctsid
@ -273,6 +227,7 @@ CFLAGS=-DCONFIG_SMP
./autogen.sh
./configure --mandir=%{_mandir} \
--datadir=%{_datadir} \
--with-fsprobe=volume_id \
--enable-elvtune \
--enable-mesg \
--enable-partx \
@ -320,18 +275,6 @@ cd ..
# klogconsole install
cd klogconsole
make install DEST=$RPM_BUILD_ROOT
cd ..
# sm-notify install
cd sm-notify*
install sm-notify $RPM_BUILD_ROOT/sbin
install -m 0644 sm-notify.8 $RPM_BUILD_ROOT/%_mandir/man8
install %SOURCE25 $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/sm
chmod 700 $RPM_BUILD_ROOT/var/lib/nfs/sm
mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/sm.bak
chmod 700 $RPM_BUILD_ROOT/var/lib/nfs/sm.bak
touch $RPM_BUILD_ROOT/var/lib/nfs/state
chmod 644 $RPM_BUILD_ROOT/var/lib/nfs/state
popd
#
# util-linux install
@ -348,7 +291,6 @@ install -m 644 nologin.8 $RPM_BUILD_ROOT%{_mandir}/man8
# setctsid install
install -m 755 setctsid $RPM_BUILD_ROOT/usr/sbin
install -m 444 setctsid.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 444 %SOURCE27 $RPM_BUILD_ROOT%{_mandir}/man8/
echo -e "#! /bin/bash\n/sbin/blockdev --flushbufs \$1" > $RPM_BUILD_ROOT/usr/sbin/flushb
chmod 755 $RPM_BUILD_ROOT/usr/sbin/flushb
# Install scripts to configure raw devices at boot time
@ -390,7 +332,6 @@ rm -rf $RPM_BUILD_ROOT
%post
%{fillup_and_insserv -ps raw ACTIVATE_RAW_DEV}
%{fillup_and_insserv -fY nfsboot}
%install_info --entry="* freeramdisk: (freeramdisk). tell kernel to free allocated memory for ramdisk" --info-dir=%{_infodir} %{_infodir}/freeramdisk.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/ipc.info.gz
%install_info --entry="* time: (time). summarizing used system resources" --info-dir=%{_infodir} %{_infodir}/time.info.gz
@ -427,7 +368,6 @@ fi
%doc text-utils/README.col
%doc README.largedisk
%config %attr(744,root,root) /etc/init.d/raw
%attr(755,root,root) /etc/init.d/nfsboot
%config(noreplace) %attr(644,root,root) /etc/raw
/usr/sbin/rcraw
/bin/arch
@ -451,7 +391,6 @@ fi
/sbin/nologin
/sbin/pivot_root
/sbin/raw
/sbin/sm-notify
/sbin/swapoff
/sbin/swapon
/bin/logger
@ -499,8 +438,6 @@ fi
%verify(not mode) %attr(0755,root,tty) /usr/bin/write
%dir %{_defaultdocdir}/time
%dir %{_defaultdocdir}/which
/var/lib/nfs
%ghost /var/lib/nfs/state
%{_defaultdocdir}/time/*
%{_defaultdocdir}/which/*
%{_infodir}/ipc.info.gz
@ -515,9 +452,12 @@ fi
%{_mandir}/man1/colrm.1.gz
%{_mandir}/man1/column.1.gz
%{_mandir}/man1/ddate.1.gz
%{_mandir}/man1/dmesg.1.gz
%{_mandir}/man1/flock.1.gz
%{_mandir}/man1/getopt.1.gz
%{_mandir}/man1/hexdump.1.gz
%{_mandir}/man1/ipcrm.1.gz
%{_mandir}/man1/ipcs.1.gz
%{_mandir}/man1/hostid.1.gz
%{_mandir}/man1/line.1.gz
%{_mandir}/man1/logger.1.gz
@ -530,6 +470,8 @@ fi
%{_mandir}/man1/readprofile.1.gz
%{_mandir}/man1/rename.1.gz
%{_mandir}/man1/rev.1.gz
%{_mandir}/man1/renice.1.gz
%{_mandir}/man1/setsid.1.gz
%{_mandir}/man1/script.1.gz
%{_mandir}/man1/setterm.1.gz
%{_mandir}/man1/tailf.1.gz
@ -540,7 +482,6 @@ fi
%{_mandir}/man1/write.1.gz
%{_mandir}/man1/which.1.gz
%{_mandir}/man5/fstab.5.gz
%{_mandir}/man5/nfs.5.gz
%{_mandir}/man8/addpart.8.gz
%{_mandir}/man8/agetty.8.gz
%{_mandir}/man8/blockdev.8.gz
@ -551,9 +492,6 @@ fi
%{_mandir}/man8/mkfs.bfs.8.gz
%{_mandir}/man8/mkfs.minix.8.gz
%{_mandir}/man8/fsck.minix.8.gz
%{_mandir}/man8/dmesg.8.gz
%{_mandir}/man8/ipcrm.8.gz
%{_mandir}/man8/ipcs.8.gz
%{_mandir}/man8/isosize.8.gz
%{_mandir}/man8/losetup.8.gz
%{_mandir}/man8/mkfs.8.gz
@ -566,9 +504,6 @@ fi
%{_mandir}/man8/partx.8.gz
%{_mandir}/man8/pivot_root.8.gz
%{_mandir}/man8/raw.8.gz
%{_mandir}/man8/renice.8.gz
%{_mandir}/man8/setsid.8.gz
%{_mandir}/man8/sm-notify.8.gz
%{_mandir}/man8/swapoff.8.gz
%{_mandir}/man8/swapon.8.gz
%{_mandir}/man8/umount.8.gz
@ -619,6 +554,23 @@ fi
%endif
%changelog
* Tue Jun 05 2007 - mkoenig@suse.de
- update to git20070509
mount: NFS code removed (use mount.nfs{,4} from nfs-utils)
- remove sm-notify (nfs-utils)
- removed patches
util-linux-2.11u-mount_nfs_mount_acl.patch
util-linux-2.12-mount_base_nfsv4.patch
util-linux-2.12-mount_mountfallback.patch
util-linux-2.12-mount_nfs_tcp.patch
util-linux-2.12q-mount_strict_aliasing.patch
util-linux-2.12r-mount_nfs_remount_options.patch
util-linux-2.12r-mount_rpcsec_gss.patch
util-linux-2.12r-mount_sec_manpage.patch
util-linux-2.12r-mount_umount_nosysfs.patch
util-linux-2.13-mount_nfs_timeo.patch
util-linux-mount_nfs.8.patch
util-linux-mount_warn_nfsudp.patch
* Tue Jun 05 2007 - pth@suse.de
- Update to which-2.16, mainly because regenerating configure
with newer autotools works.