summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/nfs-utils
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/nfs-utils')
-rw-r--r--meta/recipes-connectivity/nfs-utils/files/Set_nobody_user_group.patch18
-rw-r--r--meta/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch13
-rw-r--r--meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb24
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch43
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/0001-statd-fixed-the-with-statdpath-flag.patch41
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service11
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service18
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service12
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch27
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch36
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch42
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf35
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon63
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver129
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb116
15 files changed, 628 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/files/Set_nobody_user_group.patch b/meta/recipes-connectivity/nfs-utils/files/Set_nobody_user_group.patch
new file mode 100644
index 0000000000..4633da919e
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/files/Set_nobody_user_group.patch
@@ -0,0 +1,18 @@
1Set nobody user and group
2
3Upstream-Status: Inappropriate [configuration]
4
5Signed-off-by: Roy.Li <rongqing.li@windriver.com>
6--- a/idmapd.conf
7+++ b/idmapd.conf
8@@ -17,8 +17,8 @@
9
10 [Mapping]
11
12-#Nobody-User = nobody
13-#Nobody-Group = nobody
14+Nobody-User = nobody
15+Nobody-Group = nogroup
16
17 [Translation]
18
diff --git a/meta/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch b/meta/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch
new file mode 100644
index 0000000000..d81c7c5f32
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch
@@ -0,0 +1,13 @@
1Upstream-Status: Inappropriate [configuration]
2
3--- a/configure.in
4+++ b/configure.in
5@@ -1,7 +1,7 @@
6 # -*- Autoconf -*-
7 # Process this file with autoconf to produce a configure script.
8
9-AC_PREREQ([2.68])
10+AC_PREREQ([2.65])
11 AC_INIT([libnfsidmap],[0.25],[linux-nfs@vger.kernel.org])
12 AC_CONFIG_SRCDIR([nfsidmap.h])
13 AC_CONFIG_MACRO_DIR([m4])
diff --git a/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb b/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb
new file mode 100644
index 0000000000..fcc9e87db5
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb
@@ -0,0 +1,24 @@
1SUMMARY = "NFS id mapping library"
2HOMEPAGE = "http://www.citi.umich.edu/projects/nfsv4/linux/"
3SECTION = "libs"
4
5LICENSE = "BSD"
6LIC_FILES_CHKSUM = "file://COPYING;md5=d9c6a2a0ca6017fda7cd905ed2739b37"
7
8SRC_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${BPN}-${PV}.tar.gz \
9 file://fix-ac-prereq.patch \
10 file://Set_nobody_user_group.patch \
11 "
12
13SRC_URI[md5sum] = "2ac4893c92716add1a1447ae01df77ab"
14SRC_URI[sha256sum] = "656d245d84400e1030f8f40a5a27da76370690c4a932baf249110f047fe7efcf"
15
16inherit autotools
17
18EXTRA_OECONF = "--disable-ldap"
19
20do_install_append () {
21 install -d ${D}${sysconfdir}/
22 install -m 0644 ${WORKDIR}/${BPN}-${PV}/idmapd.conf ${D}${sysconfdir}/idmapd.conf
23}
24
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch
new file mode 100644
index 0000000000..7025fb555c
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch
@@ -0,0 +1,43 @@
1From 9b84cff305866abd150cf1a4c6e7e5ebf8a7eb3a Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Fri, 15 Nov 2013 23:21:35 +0100
4Subject: [PATCH] configure: Allow to explicitly disable nfsidmap
5
6* keyutils availability is autodetected and builds aren't reproducible
7
8Upstream-Status: Pending
9
10Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
11---
12 configure.ac | 10 +++++++++-
13 1 file changed, 9 insertions(+), 1 deletion(-)
14
15diff --git a/configure.ac b/configure.ac
16index bf433d6..28a8f62 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -69,6 +69,12 @@ AC_ARG_ENABLE(nfsv4,
20 AC_SUBST(enable_nfsv4)
21 AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"])
22
23+AC_ARG_ENABLE(nfsidmap,
24+ [AC_HELP_STRING([--enable-nfsidmap],
25+ [enable support for NFSv4 idmapper @<:@default=yes@:>@])],
26+ enable_nfsidmap=$enableval,
27+ enable_nfsidmap=yes)
28+
29 AC_ARG_ENABLE(nfsv41,
30 [AC_HELP_STRING([--enable-nfsv41],
31 [enable support for NFSv41 @<:@default=yes@:>@])],
32@@ -296,7 +302,7 @@ fi
33
34 dnl enable nfsidmap when its support by libnfsidmap
35 AM_CONDITIONAL(CONFIG_NFSDCLTRACK, [test "$enable_nfsdcltrack" = "yes" ])
36-AM_CONDITIONAL(CONFIG_NFSIDMAP, [test "$ac_cv_header_keyutils_h$ac_cv_lib_nfsidmap_nfs4_owner_to_uid" = "yesyes"])
37+AM_CONDITIONAL(CONFIG_NFSIDMAP, [test "$enable_nfsidmap$ac_cv_header_keyutils_h$ac_cv_lib_nfsidmap_nfs4_owner_to_uid" = "yesyesyes"])
38
39
40 if test "$knfsd_cv_glibc2" = no; then
41--
421.8.4.3
43
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-statd-fixed-the-with-statdpath-flag.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-statd-fixed-the-with-statdpath-flag.patch
new file mode 100644
index 0000000000..2ce824cf9e
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-statd-fixed-the-with-statdpath-flag.patch
@@ -0,0 +1,41 @@
1From 3b1457d219ceb1058d44bacc657581f13437ae40 Mon Sep 17 00:00:00 2001
2From: Steve Dickson <steved@redhat.com>
3Date: Tue, 17 Jun 2014 13:28:53 -0400
4Subject: [PATCH] statd: fixed the --with-statdpath= flag
5
6Create the given path set with --with-statdpath
7
8Signed-off-by: chendt.fnst@cn.fujitsu.com
9Reported-by: yaoxp@cn.fujitsu.com
10Signed-off-by: Steve Dickson <steved@redhat.com>
11Upstream-Status: Backport
12---
13 Makefile.am | 10 +++++-----
14 1 file changed, 5 insertions(+), 5 deletions(-)
15
16diff --git a/Makefile.am b/Makefile.am
17index ae7cd16..5824adc 100644
18--- a/Makefile.am
19+++ b/Makefile.am
20@@ -54,13 +54,13 @@ install-data-hook:
21 touch $(DESTDIR)$(statedir)/xtab; chmod 644 $(DESTDIR)$(statedir)/xtab
22 touch $(DESTDIR)$(statedir)/etab; chmod 644 $(DESTDIR)$(statedir)/etab
23 touch $(DESTDIR)$(statedir)/rmtab; chmod 644 $(DESTDIR)$(statedir)/rmtab
24- mkdir -p $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak
25- touch $(DESTDIR)$(statedir)/state
26- chmod go-rwx $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
27- -chown $(statduser) $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
28+ mkdir -p $(DESTDIR)$(statdpath)/sm $(DESTDIR)$(statdpath)/sm.bak
29+ touch $(DESTDIR)$(statdpath)/state
30+ chmod go-rwx $(DESTDIR)$(statdpath)/sm $(DESTDIR)$(statdpath)/sm.bak $(DESTDIR)$(statdpath)/state
31+ -chown $(statduser) $(DESTDIR)$(statdpath)/sm $(DESTDIR)$(statdpath)/sm.bak $(DESTDIR)$(statdpath)/state
32
33 uninstall-hook:
34 rm $(DESTDIR)$(statedir)/xtab
35 rm $(DESTDIR)$(statedir)/etab
36 rm $(DESTDIR)$(statedir)/rmtab
37- rm $(DESTDIR)$(statedir)/state
38+ rm $(DESTDIR)$(statdpath)/state
39--
401.8.4.2
41
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
new file mode 100644
index 0000000000..613ddc003a
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=NFS Mount Daemon
3After=rpcbind.service nfs-server.service
4Requires=rpcbind.service nfs-server.service
5
6[Service]
7EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
8ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS
9
10[Install]
11WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
new file mode 100644
index 0000000000..147d7a7b5f
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
@@ -0,0 +1,18 @@
1[Unit]
2Description=NFS Server
3Requires=rpcbind.service nfs-mountd.service
4After=rpcbind.service
5
6[Service]
7Type=oneshot
8EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
9ExecStartPre=@SBINDIR@/exportfs -r
10ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT
11ExecStop=@SBINDIR@/rpc.nfsd 0
12ExecStopPost=@SBINDIR@/exportfs -f
13ExecReload=@SBINDIR@/exportfs -r
14StandardError=syslog
15RemainAfterExit=yes
16
17[Install]
18WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
new file mode 100644
index 0000000000..746dacf056
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
@@ -0,0 +1,12 @@
1[Unit]
2Description=NFS file locking service
3After=rpcbind.service
4Requires=rpcbind.service
5Before=remote-fs-pre.target
6
7[Service]
8EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
9ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS
10
11[Install]
12WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch
new file mode 100644
index 0000000000..c3442380e1
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch
@@ -0,0 +1,27 @@
1Signed-off-by: Khem Raj <raj.khem@gmail.com>
2
3Upstream-Status: Inappropriate [embedded specific]
4
5Index: nfs-utils-1.2.6/support/nfs/svc_socket.c
6===================================================================
7--- nfs-utils-1.2.6.orig/support/nfs/svc_socket.c 2012-05-14 07:40:52.000000000 -0700
8+++ nfs-utils-1.2.6/support/nfs/svc_socket.c 2012-10-28 02:42:50.179222457 -0700
9@@ -40,8 +40,9 @@
10 char rpcdata[1024], servdata[1024];
11 struct rpcent rpcbuf, *rpcp;
12 struct servent servbuf, *servp = NULL;
13- int ret;
14+ int ret = 0;
15
16+#ifndef __UCLIBC__ /* neither getrpcbynumber() nor getrpcbynumber_r() is SuSv3 */
17 ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof rpcdata,
18 &rpcp);
19 if (ret == 0 && rpcp != NULL) {
20@@ -60,6 +61,7 @@
21 }
22 }
23 }
24+#endif /* __UCLIBC__ */
25
26 if (ret == 0 && servp != NULL)
27 return ntohs(servp->s_port);
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch
new file mode 100644
index 0000000000..d8f8181670
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch
@@ -0,0 +1,36 @@
1Fixes errors like
2sm-notify[1070]: DNS resolution of a.b.c.d..com failed; retrying later
3This error will occur anytime sm-notify is run before the network if fully up,
4which is happening more and more with parallel startup systems.
5The res_init() call is simple, safe, quick, and a patch to use it should be
6able to go upstream. Presumably the whole reason sm-notify tries several
7times is to wait for possible changes to the network configuration, but without
8calling res_init() it will never be aware of those changes
9
10Backported drom Fedora
11
12Upstream-Status: Pending
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14
15
16diff -up nfs-utils-1.2.3/utils/statd/sm-notify.c.orig nfs-utils-1.2.3/utils/statd/sm-notify.c
17--- nfs-utils-1.2.3/utils/statd/sm-notify.c.orig 2010-09-28 08:24:16.000000000 -0400
18+++ nfs-utils-1.2.3/utils/statd/sm-notify.c 2010-10-15 16:44:43.487119601 -0400
19@@ -28,6 +28,9 @@
20 #include <netdb.h>
21 #include <errno.h>
22 #include <grp.h>
23+#include <netinet/in.h>
24+#include <arpa/nameser.h>
25+#include <resolv.h>
26
27 #include "sockaddr.h"
28 #include "xlog.h"
29@@ -84,6 +87,7 @@ smn_lookup(const char *name)
30 };
31 int error;
32
33+ res_init();
34 error = getaddrinfo(name, NULL, &hint, &ai);
35 if (error != 0) {
36 xlog(D_GENERAL, "getaddrinfo(3): %s", gai_strerror(error));
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch
new file mode 100644
index 0000000000..993f1e5ea5
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch
@@ -0,0 +1,42 @@
1nfs-utils: Do not pass CFLAGS to gcc while building
2
3Do not pass CFLAGS/LDFLAGS to gcc while building, The needed flags has
4been passed by xxx_CFLAGS=$(CFLAGS_FOR_BUILD).
5
6Upstream-Status: Pending
7
8Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
9---
10 tools/locktest/Makefile.am | 2 ++
11 tools/rpcgen/Makefile.am | 2 ++
12 2 files changed, 4 insertions(+)
13
14diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am
15index 3156815..1729fd1 100644
16--- a/tools/locktest/Makefile.am
17+++ b/tools/locktest/Makefile.am
18@@ -1,6 +1,8 @@
19 ## Process this file with automake to produce Makefile.in
20
21 CC=$(CC_FOR_BUILD)
22+CFLAGS=
23+LDFLAGS=
24 LIBTOOL = @LIBTOOL@ --tag=CC
25
26 noinst_PROGRAMS = testlk
27diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am
28index 8a9ec89..8bacdaa 100644
29--- a/tools/rpcgen/Makefile.am
30+++ b/tools/rpcgen/Makefile.am
31@@ -1,6 +1,8 @@
32 ## Process this file with automake to produce Makefile.in
33
34 CC=$(CC_FOR_BUILD)
35+CFLAGS=
36+LDFLAGS=
37 LIBTOOL = @LIBTOOL@ --tag=CC
38
39 noinst_PROGRAMS = rpcgen
40--
411.7.9.5
42
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf
new file mode 100644
index 0000000000..a1007a7fbf
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf
@@ -0,0 +1,35 @@
1# Parameters to be passed to nfs-utils (clients & server) service files.
2#
3
4# Options to pass to rpc.nfsd.
5NFSD_OPTS=""
6
7# Number of servers to start up; the default is 8 servers.
8NFSD_COUNT=""
9
10# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd".
11PROCNFSD_MOUNTPOINT=""
12
13# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid".
14PROCNFSD_MOUNTOPTS=""
15
16# Options for rpc.mountd.
17# If you have a port-based firewall, you might want to set up
18# a fixed port here using the --port option.
19MOUNTD_OPTS=""
20
21# Parameters to be passed to nfs-common (nfs clients & server) init script.
22#
23
24# If you do not set values for the NEED_ options, they will be attempted
25# autodetected; this should be sufficient for most people. Valid alternatives
26# for the NEED_ options are "yes" and "no".
27
28# Do you want to start the statd daemon? It is not needed for NFSv4.
29NEED_STATD=""
30
31# Options to pass to rpc.statd.
32# N.B. statd normally runs on both client and server, and run-time
33# options should be specified accordingly.
34# STATD_OPTS="-p 32765 -o 32766"
35STATD_OPTS=""
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
new file mode 100644
index 0000000000..992267d5a1
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
@@ -0,0 +1,63 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: nfs-common
4# Required-Start: $portmap hwclock
5# Required-Stop: $portmap hwclock
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: NFS support for both client and server
9# Description: NFS is a popular protocol for file sharing across
10# TCP/IP networks. This service provides various
11# support functions for NFS mounts.
12### END INIT INFO
13#
14# Startup script for nfs-utils
15#
16#
17# Location of executables:
18
19# Source function library.
20. /etc/init.d/functions
21
22test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd
23test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid
24#
25# The default state directory is /var/lib/nfs
26test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
27#
28#----------------------------------------------------------------------
29# Startup and shutdown functions.
30# Actual startup/shutdown is at the end of this file.
31
32start_statd(){
33 echo -n "starting statd: "
34 start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"
35 echo done
36}
37stop_statd(){
38 echo -n 'stopping statd: '
39 start-stop-daemon --stop --quiet --signal 1 --pidfile "$STATD_PID"
40 echo done
41}
42#----------------------------------------------------------------------
43#
44# supported options:
45# start
46# stop
47# restart: stops and starts mountd
48#FIXME: need to create the /var/lib/nfs/... directories
49case "$1" in
50 start)
51 start_statd;;
52 stop)
53 stop_statd;;
54 status)
55 status $NFS_STATD
56 exit $?;;
57 restart)
58 $0 stop
59 $0 start;;
60 *)
61 echo "Usage: $0 {start|stop|status|restart}"
62 exit 1;;
63esac
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
new file mode 100644
index 0000000000..6e0df7e2ea
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
@@ -0,0 +1,129 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: nfs-kernel-server
4# Required-Start: $remote_fs nfs-common $portmap hwclock
5# Required-Stop: $remote_fs nfs-common $portmap hwclock
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Kernel NFS server support
9# Description: NFS is a popular protocol for file sharing across
10# TCP/IP networks. This service provides NFS server
11# functionality, which is configured via the
12# /etc/exports file.
13### END INIT INFO
14#
15# Startup script for nfs-utils
16#
17# Source function library.
18. /etc/init.d/functions
19#
20# The environment variable NFS_SERVERS may be set in /etc/default/nfsd
21# Other control variables may be overridden here too
22test -r /etc/default/nfsd && . /etc/default/nfsd
23#
24# Location of executables:
25test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd
26test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd
27#
28# The user mode program must also exist (it just starts the kernel
29# threads using the kernel module code).
30test -x "$NFS_MOUNTD" || exit 0
31test -x "$NFS_NFSD" || exit 0
32#
33# Default is 8 threads, value is settable between 1 and the truely
34# ridiculous 99
35test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8
36#
37#----------------------------------------------------------------------
38# Startup and shutdown functions.
39# Actual startup/shutdown is at the end of this file.
40#mountd
41start_mountd(){
42 echo -n 'starting mountd: '
43 start-stop-daemon --start --exec "$NFS_MOUNTD" -- "-f /etc/exports $@"
44 echo done
45}
46stop_mountd(){
47 echo -n 'stopping mountd: '
48 start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD"
49 echo done
50}
51#
52#nfsd
53start_nfsd(){
54 modprobe -q nfsd
55 grep -q nfsd /proc/filesystems || {
56 echo NFS daemon support not enabled in kernel
57 exit 1
58 }
59 grep -q nfsd /proc/mounts || mount -t nfsd nfsd /proc/fs/nfsd
60 grep -q nfsd /proc/mounts || {
61 echo nfsd filesystem could not be mounted at /proc/fs/nfsd
62 exit 1
63 }
64
65 echo -n "starting $1 nfsd kernel threads: "
66 start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
67 echo done
68}
69delay_nfsd(){
70 for delay in 0 1 2 3 4 5 6 7 8 9
71 do
72 if pidof nfsd >/dev/null
73 then
74 echo -n .
75 sleep 1
76 else
77 return 0
78 fi
79 done
80 return 1
81}
82stop_nfsd(){
83 # WARNING: this kills any process with the executable
84 # name 'nfsd'.
85 echo -n 'stopping nfsd: '
86 start-stop-daemon --stop --quiet --signal 1 --name nfsd
87 if delay_nfsd || {
88 echo failed
89 echo ' using signal 9: '
90 start-stop-daemon --stop --quiet --signal 9 --name nfsd
91 delay_nfsd
92 }
93 then
94 echo done
95 else
96 echo failed
97 fi
98}
99
100#----------------------------------------------------------------------
101#
102# supported options:
103# start
104# stop
105# reload: reloads the exports file
106# restart: stops and starts mountd
107#FIXME: need to create the /var/lib/nfs/... directories
108case "$1" in
109 start)
110 start_nfsd "$NFS_SERVERS"
111 start_mountd
112 test -r /etc/exports && exportfs -a;;
113 stop) exportfs -ua
114 stop_mountd
115 stop_nfsd;;
116 status)
117 status /usr/sbin/rpc.mountd
118 RETVAL=$?
119 status nfsd
120 rval=$?
121 [ $RETVAL -eq 0 ] && exit $rval
122 exit $RETVAL;;
123 reload) test -r /etc/exports && exportfs -r;;
124 restart)
125 $0 stop
126 $0 start;;
127 *) echo "Usage: $0 {start|stop|status|reload|restart}"
128 exit 1;;
129esac
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
new file mode 100644
index 0000000000..6e6d09bf42
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
@@ -0,0 +1,116 @@
1SUMMARY = "userspace utilities for kernel nfs"
2DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \
3NFS server and related tools."
4HOMEPAGE = "http://nfs.sourceforge.net/"
5SECTION = "console/network"
6
7LICENSE = "MIT & GPLv2+ & BSD"
8LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
9
10# util-linux for libblkid
11DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3"
12RDEPENDS_${PN}-client = "rpcbind bash"
13RDEPENDS_${PN} = "${PN}-client bash"
14RRECOMMENDS_${PN} = "kernel-module-nfsd"
15
16inherit useradd
17
18USERADD_PACKAGES = "${PN}-client"
19USERADD_PARAM_${PN}-client = "--system --home-dir /var/lib/nfs \
20 --shell /bin/false --user-group rpcuser"
21
22SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
23 file://0001-configure-Allow-to-explicitly-disable-nfsidmap.patch \
24 file://nfs-utils-1.0.6-uclibc.patch \
25 file://nfs-utils-1.2.3-sm-notify-res_init.patch \
26 file://nfsserver \
27 file://nfscommon \
28 file://nfs-utils.conf \
29 file://nfs-server.service \
30 file://nfs-mountd.service \
31 file://nfs-statd.service \
32 file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
33 file://0001-statd-fixed-the-with-statdpath-flag.patch \
34"
35
36SRC_URI[md5sum] = "6e93a7997ca3a1eac56bf219adab72a8"
37SRC_URI[sha256sum] = "ab8384d0e487ed6a18c5380d5df28015f7dd98680bf08f3247c97d9f7d99e56f"
38
39PARALLEL_MAKE = ""
40
41# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
42# pull in the remainder of the dependencies.
43
44INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
45INITSCRIPT_NAME = "nfsserver"
46INITSCRIPT_PARAMS = "defaults"
47INITSCRIPT_NAME_${PN}-client = "nfscommon"
48INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
49
50inherit autotools-brokensep update-rc.d systemd pkgconfig
51
52SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
53SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
54SYSTEMD_AUTO_ENABLE = "disable"
55
56# --enable-uuid is need for cross-compiling
57EXTRA_OECONF = "--with-statduser=rpcuser \
58 --enable-mountconfig \
59 --enable-libmount-mount \
60 --disable-nfsv41 \
61 --enable-uuid \
62 --disable-gss \
63 --disable-tirpc \
64 --disable-nfsdcltrack \
65 --with-statdpath=/var/lib/nfs/statd \
66 "
67
68PACKAGECONFIG ??= "tcp-wrappers"
69PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
70PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
71
72INHIBIT_AUTO_STAGE = "1"
73
74PACKAGES =+ "${PN}-client ${PN}-stats"
75FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \
76 ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
77 ${sbindir}/showmount ${sbindir}/nfsstat \
78 ${localstatedir}/lib/nfs \
79 ${sysconfdir}/nfs-utils.conf \
80 ${sysconfdir}/init.d/nfscommon \
81 ${systemd_unitdir}/system/nfs-statd.service"
82FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
83RDEPENDS_${PN}-stats = "python"
84
85# Make clean needed because the package comes with
86# precompiled 64-bit objects that break the build
87do_compile_prepend() {
88 make clean
89}
90
91do_install_append () {
92 install -d ${D}${sysconfdir}/init.d
93 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
94 install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
95
96 install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
97 install -d ${D}${systemd_unitdir}/system
98 install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
99 install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
100 install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
101 sed -i -e 's,@SBINDIR@,${sbindir},g' \
102 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
103 ${D}${systemd_unitdir}/system/*.service
104
105 # kernel code as of 3.8 hard-codes this path as a default
106 install -d ${D}/var/lib/nfs/v4recovery
107
108 # chown the directories and files
109 chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
110 chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
111
112 # the following are built by CC_FOR_BUILD
113 rm -f ${D}${sbindir}/rpcdebug
114 rm -f ${D}${sbindir}/rpcgen
115 rm -f ${D}${sbindir}/locktest
116}