core/nfs-utils to 1.2.5-4

This commit is contained in:
Kevin Mihelich 2012-04-27 12:15:26 -04:00
parent c139d53917
commit e48f649ebf
12 changed files with 176 additions and 69 deletions

View file

@ -1,4 +1,4 @@
# $Id: PKGBUILD 139844 2011-10-05 07:58:31Z tpowa $
# $Id: PKGBUILD 157235 2012-04-26 13:06:16Z tpowa $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: John Proctor <jproctor@prium.net>
# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>
@ -12,27 +12,38 @@ plugrel=1
pkgname=nfs-utils
pkgver=1.2.5
pkgrel=2
pkgrel=4
pkgdesc="Support programs for Network File Systems"
arch=('i686' 'x86_64')
url='http://nfs.sourceforge.net'
license=('GPL')
backup=(etc/{exports,idmapd.conf} etc/conf.d/{nfs-common.conf,nfs-server.conf})
backup=(etc/{exports,idmapd.conf,nfsmount.conf} etc/conf.d/{nfs-common.conf,nfs-server.conf})
depends=('glibc' 'e2fsprogs' 'rpcbind' 'libtirpc>=0.2.1' 'librpcsecgss>=0.19-2' 'nfsidmap' 'libevent>=2.0.10' 'libgssglue' 'device-mapper')
makedepends=('pkgconfig' 'autoconf' 'automake')
source=(http://downloads.sourceforge.net/project/nfs/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2
nfs-common
nfs-common.conf
nfs-server
nfs-server.conf
exports
idmapd.conf
start-statd.patch
nfs-utils-1.1.4-mtab-sym.patch
nfs-utils-1.1.4-no-exec.patch
18-dont-use-PAGE_SIZE.patch)
18-dont-use-PAGE_SIZE.patch
nfs-common
nfs-common.conf
nfs-server
nfs-server.conf
exports
idmapd.conf
start-statd.patch
nfs
nfs-utils-1.1.4-mtab-sym.patch
nfs-utils-1.1.4-no-exec.patch
rpc-gssd.service
rpc-mountd.service
rpc-svcgssd.service
rpc-idmapd.service
rpc-statd.service
nfsd.service
var-lib-nfs-rpc_pipefs.mount
proc-fs-nfsd.mount
nfs-utils.conf)
install=nfs-utils.install
md5sums=('8395ac770720b83c5c469f88306d7765'
'1a56922af585f4cc3ec4e7504f00c3a2'
'dd0d65fc6e8f422fa12520813098264b'
'f73f197a16b02c3e248488ec35c4cf43'
'e619f18354ff958ed624d05d08853d8f'
@ -40,9 +51,18 @@ md5sums=('8395ac770720b83c5c469f88306d7765'
'ff585faf410a62c4333a027c50b56bae'
'eb4f4027fab6fc1201f1ca04f5954c76'
'e9144277a89a620d9bc80413158a7d27'
'f5e7bba09a46c5c5d7007cac6eff9df5'
'7674106eaaa4c149bccd4f05fe3604e9'
'4f4827dfc93008dfadd0a530ad0872b2'
'1a56922af585f4cc3ec4e7504f00c3a2')
'38855936dc55a5afe37d84edc0f11066'
'8d888de677a217c5e5f7244a2e3a2d3a'
'e05705d9ccccaeaeb1ecaee20adc05bc'
'd7df7bc311fd95c5b80017dd1741570d'
'2e72ee082cba5d3ec6f51d2a105664da'
'5d33d2e754fd37280365b287603bac90'
'1cd65909fa0983047f3f06a3ab352401'
'02a34835aa077146a90eb7d191e612d0'
'8ac484023d786766d287ccbe878ae4ba')
build() {
cd $srcdir/${pkgname}-${pkgver}
@ -54,9 +74,10 @@ build() {
# ALARM
patch -Np1 -i ../18-dont-use-PAGE_SIZE.patch
./configure --prefix=/usr --enable-nfsv3 --enable-nfsv4 --enable-gss \
./configure --prefix=/usr --enable-nfsv4 --enable-nfsv41 --enable-gss \
--without-tcp-wrappers --with-statedir=/var/lib/nfs \
--enable-ipv6 --sysconfdir=/etc --enable-libmount-mount
--enable-ipv6 --sysconfdir=/etc --enable-libmount-mount \
--enable-mountconfig
make
}
@ -76,6 +97,13 @@ package() {
install -D -m 644 ../idmapd.conf "$pkgdir/"etc/idmapd.conf
install -D -m 644 ../nfs-common.conf "$pkgdir/"etc/conf.d/nfs-common.conf
install -D -m 644 ../nfs-server.conf "$pkgdir/"etc/conf.d/nfs-server.conf
install -D -m 644 ../nfs "$pkgdir/"etc/conf.d/nfs
install -D -m 644 utils/mount/nfsmount.conf "$pkgdir/"etc/nfsmount.conf
# systemd files
for i in ${srcdir}/*.{service,mount}; do
install -D -m 644 $i "$pkgdir/"usr/lib/systemd/system/$(basename $i)
done
install -D -m 644 ../nfs-utils.conf "$pkgdir/"usr/lib/modules-load.d/nfs-utils.conf
# directories
mkdir "$pkgdir/"etc/exports.d
mkdir "$pkgdir/"var/lib/nfs/rpc_pipefs

View file

@ -1,53 +0,0 @@
mount.nfs segfaults if kernel version number does not contain
at least 3 components delimited with a dot.
Avoid this by matching up to three unsigned integers inialised
to zero, separated by dots.
A version that does not start with an integer is probably a future
version where the versioning evolved to another scheme.
Return UINT_MAX which is guaranteed to be higher than existing
versions. This would also make it possible to easily identify
versions that do not start with an integer.
Signed-off-by: Luk Claes <luk@...>
---
utils/mount/version.h | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/utils/mount/version.h b/utils/mount/version.h
index af61a6f..531cf68 100644
--- a/utils/mount/version.h
+++ b/utils/mount/version.h
@@ -23,8 +23,8 @@
#ifndef _NFS_UTILS_MOUNT_VERSION_H
#define _NFS_UTILS_MOUNT_VERSION_H
-#include <stdlib.h>
-#include <string.h>
+#include <stdio.h>
+#include <limits.h>
#include <sys/utsname.h>
@@ -37,14 +37,16 @@ static inline unsigned int MAKE_VERSION(unsigned int p, unsigned int q,
static inline unsigned int linux_version_code(void)
{
struct utsname my_utsname;
- unsigned int p, q, r;
+ unsigned int p, q = 0, r = 0;
+ /* UINT_MAX as backward compatibility code should not be run */
if (uname(&my_utsname))
- return 0;
+ return UINT_MAX;
- p = (unsigned int)atoi(strtok(my_utsname.release, "."));
- q = (unsigned int)atoi(strtok(NULL, "."));
- r = (unsigned int)atoi(strtok(NULL, "."));
+ /* UINT_MAX as future versions might not start with an integer */
+ if (sscanf(my_utsname.release, "%u.%u.%u", &p, &q, &r) < 1)
+ return UINT_MAX;
+
return MAKE_VERSION(p, q, r);
}

40
core/nfs-utils/nfs Normal file
View file

@ -0,0 +1,40 @@
#
# Optinal options passed to rquotad
RPCRQUOTADOPTS=""
#
# Optional arguments passed to in-kernel lockd
#LOCKDARG=
# TCP port rpc.lockd should listen on.
#LOCKD_TCPPORT=32803
# UDP port rpc.lockd should listen on.
#LOCKD_UDPPORT=32769
#
# Optional arguments passed to rpc.nfsd. See rpc.nfsd(8)
RPCNFSDARGS=""
# Number of nfs server processes to be started.
# The default is 8.
RPCNFSDCOUNT=8
# Set V4 grace period in seconds
#NFSD_V4_GRACE=90
#
# Optional arguments passed to rpc.mountd. See rpc.mountd(8)
RPCMOUNTDOPTS=""
#
# Optional arguments passed to rpc.statd. See rpc.statd(8)
STATDARG=""
#
# Optional arguments passed to rpc.idmapd. See rpc.idmapd(8)
RPCIDMAPDARGS=""
#
# Optional arguments passed to rpc.gssd. See rpc.gssd(8)
RPCGSSDARGS=""
#
# Optional arguments passed to rpc.svcgssd. See rpc.svcgssd(8)
RPCSVCGSSDARGS=""
#
# To enable RDMA support on the server by setting this to
# the port the server should listen on
#RDMA_PORT=20049
#
# Optional arguments passed to blkmapd. See blkmapd(8)
BLKMAPDARGS=""

View file

@ -0,0 +1 @@
nfs

View file

@ -0,0 +1,16 @@
[Unit]
Description=NFS server
After=rpcbind.service
Requires=rpcbind.service
[Service]
Type=oneshot
EnvironmentFile=/etc/conf.d/nfs-server.conf
ExecStart=/usr/sbin/rpc.nfsd $NFSD_OPTS $NFSD_COUNT
ExecStartPost=/usr/sbin/exportfs -a
ExecStop=/usr/sbin/rpc.nfsd 0
ExecStopPost=/usr/sbin/exportfs -a -u
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,8 @@
[Unit]
Description=RPC Pipe File System
DefaultDependencies=no
[Mount]
What=sunrpc
Where=/proc/fs/nfsd
Type=rpc_pipefs

View file

@ -0,0 +1,12 @@
[Unit]
Description=RPC GSS-API client-side daemon
After=rpcbind.service var-lib-nfs-rpc_pipefs.mount
Requires=rpcbind.service var-lib-nfs-rpc_pipefs.mount
[Service]
Type=forking
EnvironmentFile=/etc/conf.d/nfs-common.conf
ExecStart=/usr/sbin/rpc.gssd $GSSD_OPTS
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,12 @@
[Unit]
Description=NFSv4 ID-name mapping daemon
After=var-lib-nfs-rpc_pipefs.mount nfsd.service
Requires=var-lib-nfs-rpc_pipefs.mount
[Service]
Type=forking
EnvironmentFile=/etc/conf.d/nfs-common.conf
ExecStart=/usr/sbin/rpc.idmapd $IDMAPD_OPTS
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,12 @@
[Unit]
Description=NFSv2/3 Mount Daemon
After=rpcbind.service nfsd.service
Requires=rpcbind.service nfsd.service
[Service]
Type=forking
EnvironmentFile=/etc/conf.d/nfs-server.conf
ExecStart=/usr/sbin/rpc.mountd $MOUNTD_OPTS
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,12 @@
[Unit]
Description=NFSv2/3 Network Status Monitor Daemon
After=rpcbind.service
Requires=rpcbind.service
[Service]
Type=forking
EnvironmentFile=/etc/conf.d/nfs-common.conf
ExecStart=/usr/sbin/rpc.statd $STATD_OPTS
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,12 @@
[Unit]
Description=RPC GSS-API server-side daemon
After=rpcbind.service
Requires=rpcbind.service
[Service]
Type=forking
EnvironmentFile=/etc/conf.d/nfs-server.conf
ExecStart=/usr/sbin/rpc.svcgssd $SVCGSSD_OPTS
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,7 @@
[Unit]
Description=RPC pipe filesystem
[Mount]
What=rpc_pipefs
Where=/var/lib/nfs/rpc_pipefs
Type=rpc_pipefs