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/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.conf35
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon90
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver129
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.9.bb110
13 files changed, 566 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 0000000..4633da9
--- /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 0000000..d81c7c5
--- /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 0000000..fcc9e87
--- /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 0000000..7025fb5
--- /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/nfs-mountd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
new file mode 100644
index 0000000..613ddc0
--- /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 0000000..147d7a7
--- /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 0000000..746dacf
--- /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 0000000..c344238
--- /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 0000000..d8f8181
--- /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.conf b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf
new file mode 100644
index 0000000..a1007a7
--- /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 0000000..65fdd1d
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
@@ -0,0 +1,90 @@
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#directories
32create_directories(){
33 echo -n 'creating NFS state directory: '
34 mkdir -p "$NFS_STATEDIR"
35 ( cd "$NFS_STATEDIR"
36 umask 077
37 mkdir -p rpc_pipefs
38 mkdir -p sm sm.bak statd
39 chown rpcuser:rpcuser sm sm.bak statd
40 test -w statd/state || {
41 rm -f statd/state
42 :>statd/state
43 }
44 umask 022
45 for file in xtab etab smtab rmtab
46 do
47 test -w "$file" || {
48 rm -f "$file"
49 :>"$file"
50 }
51 done
52 )
53 chown rpcuser:rpcuser "$NFS_STATEDIR"
54 echo done
55}
56
57#statd
58start_statd(){
59 echo -n "starting statd: "
60 start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"
61 echo done
62}
63stop_statd(){
64 echo -n 'stopping statd: '
65 start-stop-daemon --stop --quiet --signal 1 --pidfile "$STATD_PID"
66 echo done
67}
68#----------------------------------------------------------------------
69#
70# supported options:
71# start
72# stop
73# restart: stops and starts mountd
74#FIXME: need to create the /var/lib/nfs/... directories
75case "$1" in
76 start)
77 create_directories
78 start_statd;;
79 stop)
80 stop_statd;;
81 status)
82 status $NFS_STATD
83 exit $?;;
84 restart)
85 $0 stop
86 $0 start;;
87 *)
88 echo "Usage: $0 {start|stop|status|restart}"
89 exit 1;;
90esac
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 0000000..6e0df7e
--- /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.2.9.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.9.bb
new file mode 100644
index 0000000..da37160
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.9.bb
@@ -0,0 +1,110 @@
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.bz2 \
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
33SRC_URI[md5sum] = "18869d16db3f49c053f8c68eba3fe2e0"
34SRC_URI[sha256sum] = "90b76d5692a520b74273e607a4fd69df4cc35f65e242e22e2bc61b58759722f3"
35
36PARALLEL_MAKE = ""
37
38# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
39# pull in the remainder of the dependencies.
40
41INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
42INITSCRIPT_NAME = "nfsserver"
43INITSCRIPT_PARAMS = "defaults"
44INITSCRIPT_NAME_${PN}-client = "nfscommon"
45INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
46
47inherit autotools-brokensep update-rc.d systemd
48
49SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
50SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
51SYSTEMD_AUTO_ENABLE = "disable"
52
53# --enable-uuid is need for cross-compiling
54EXTRA_OECONF = "--with-statduser=nobody \
55 --enable-mountconfig \
56 --enable-libmount-mount \
57 --disable-nfsv41 \
58 --enable-uuid \
59 --disable-gss \
60 --disable-tirpc \
61 --disable-nfsdcltrack \
62 --with-statdpath=/var/lib/nfs/statd \
63 "
64
65PACKAGECONFIG ??= "tcp-wrappers"
66PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
67PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
68
69INHIBIT_AUTO_STAGE = "1"
70
71PACKAGES =+ "${PN}-client ${PN}-stats"
72FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \
73 ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
74 ${sbindir}/showmount ${sbindir}/nfsstat \
75 ${localstatedir}/lib/nfs \
76 ${sysconfdir}/nfs-utils.conf \
77 ${sysconfdir}/init.d/nfscommon \
78 ${systemd_unitdir}/system/nfs-statd.service"
79FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
80RDEPENDS_${PN}-stats = "python"
81
82# Make clean needed because the package comes with
83# precompiled 64-bit objects that break the build
84do_compile_prepend() {
85 make clean
86}
87
88do_install_append () {
89 install -d ${D}${sysconfdir}/init.d
90 install -d ${D}${localstatedir}/lib/nfs/statd
91 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
92 install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
93
94 install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
95 install -d ${D}${systemd_unitdir}/system
96 install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
97 install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
98 install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
99 sed -i -e 's,@SBINDIR@,${sbindir},g' \
100 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
101 ${D}${systemd_unitdir}/system/*.service
102
103 # kernel code as of 3.8 hard-codes this path as a default
104 install -d ${D}/var/lib/nfs/v4recovery
105
106 # the following are built by CC_FOR_BUILD
107 rm -f ${D}${sbindir}/rpcdebug
108 rm -f ${D}${sbindir}/rpcgen
109 rm -f ${D}${sbindir}/locktest
110}