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/nfs-utils/0001-locktest-Makefile.am-Do-not-use-build-flags.patch36
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch38
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch42
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon279
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver135
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.4.bb159
6 files changed, 0 insertions, 689 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-locktest-Makefile.am-Do-not-use-build-flags.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-locktest-Makefile.am-Do-not-use-build-flags.patch
deleted file mode 100644
index 351407ddcd..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-locktest-Makefile.am-Do-not-use-build-flags.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From 9efa7a0d37665d9bb0f46d2407883a5ab42c2b84 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 24 Jul 2023 20:39:16 -0700
4Subject: [PATCH] locktest: Makefile.am: Do not use build flags
5
6Using CFLAGS_FOR_BUILD etc. here means it is using wrong flags
7when thse flags are speficied different than target flags which
8is common when cross-building. It can pass wrong paths to linker
9and it would find incompatible libraries during link since they
10are from host system and target maybe not same as build host.
11
12Fixes subtle errors like
13| aarch64-yoe-linux-ld.lld: error: /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/nfs-utils/2.6.3-r0/recipe-sysroot-native/usr/lib/libsqlite3.so is incompatible with elf64-littleaarch64
14
15Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=169025681008001&w=2]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 tools/locktest/Makefile.am | 3 ---
19 1 file changed, 3 deletions(-)
20
21diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am
22index e8914655..2fd36971 100644
23--- a/tools/locktest/Makefile.am
24+++ b/tools/locktest/Makefile.am
25@@ -2,8 +2,5 @@
26
27 noinst_PROGRAMS = testlk
28 testlk_SOURCES = testlk.c
29-testlk_CFLAGS=$(CFLAGS_FOR_BUILD)
30-testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
31-testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD)
32
33 MAINTAINERCLEANFILES = Makefile.in
34--
352.41.0
36
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch
deleted file mode 100644
index bbf44d5977..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From 001913c5eb0aad933a93ee966252905cd46d776b Mon Sep 17 00:00:00 2001
2From: Daniel McGregor <daniel.mcgregor@vecima.com>
3Date: Tue, 6 Jun 2023 16:07:53 -0600
4Subject: [PATCH] Use "nogroup" for nobody group
5
6Upstream-Status: Inappropriate [oe-core specific, configuration]
7Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com>
8---
9 support/nfsidmap/idmapd.conf | 2 +-
10 utils/idmapd/idmapd.c | 2 +-
11 2 files changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/support/nfsidmap/idmapd.conf b/support/nfsidmap/idmapd.conf
14index 2a2f79a1..e6f3724f 100644
15--- a/support/nfsidmap/idmapd.conf
16+++ b/support/nfsidmap/idmapd.conf
17@@ -41,7 +41,7 @@
18 [Mapping]
19
20 #Nobody-User = nobody
21-#Nobody-Group = nobody
22+#Nobody-Group = nogroup
23
24 [Translation]
25
26diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
27index cd9a965f..3be805e9 100644
28--- a/utils/idmapd/idmapd.c
29+++ b/utils/idmapd/idmapd.c
30@@ -89,7 +89,7 @@
31 #endif
32
33 #ifndef NFS4NOBODY_GROUP
34-#define NFS4NOBODY_GROUP "nobody"
35+#define NFS4NOBODY_GROUP "nogroup"
36 #endif
37
38 /* From Niels */
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch
deleted file mode 100644
index 3241e8e859..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From a2af266f013722a64c5d04e0fe097cd711393a53 Mon Sep 17 00:00:00 2001
2From: Daniel McGregor <daniel.mcgregor@vecima.com>
3Date: Wed, 8 Nov 2023 16:24:20 -0600
4Subject: [PATCH] find OE provided Kerberos
5
6Upstream-Status: Inappropriate [oe-core specific]
7Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com>
8---
9 aclocal/kerberos5.m4 | 6 ++++--
10 1 file changed, 4 insertions(+), 2 deletions(-)
11
12diff --git a/aclocal/kerberos5.m4 b/aclocal/kerberos5.m4
13index f96f0fd4..ad85fdf2 100644
14--- a/aclocal/kerberos5.m4
15+++ b/aclocal/kerberos5.m4
16@@ -22,8 +22,8 @@ AC_DEFUN([AC_KERBEROS_V5],[
17 dnl This ugly hack brought on by the split installation of
18 dnl MIT Kerberos on Fedora Core 1
19 K5CONFIG=""
20- if test -f $dir/bin/krb5-config; then
21- K5CONFIG=$dir/bin/krb5-config
22+ if test -f $dir/bin/crossscripts/krb5-config; then
23+ K5CONFIG=$dir/bin/crossscripts/krb5-config
24 elif test -f "/usr/kerberos/bin/krb5-config"; then
25 K5CONFIG="/usr/kerberos/bin/krb5-config"
26 elif test -f "/usr/lib/mit/bin/krb5-config"; then
27@@ -72,6 +72,7 @@ AC_DEFUN([AC_KERBEROS_V5],[
28 AC_MSG_RESULT($KRBDIR)
29
30 dnl Check if -rpath=$(KRBDIR)/lib is needed
31+ if false; then
32 echo "The current KRBDIR is $KRBDIR"
33 if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \
34 -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then
35@@ -81,6 +82,7 @@ AC_DEFUN([AC_KERBEROS_V5],[
36 else
37 KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib"
38 fi
39+ fi
40
41 dnl Now check for functions within gssapi library
42 AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context,
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
deleted file mode 100644
index 9b7fd17b41..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
+++ /dev/null
@@ -1,279 +0,0 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: nfs-common
5# Required-Start: $portmap $time
6# Required-Stop: $portmap $time
7# Default-Start: S
8# Default-Stop: 0 1 6
9# Short-Description: NFS support files common to client and server
10# Description: NFS is a popular protocol for file sharing across
11# TCP/IP networks. This service provides various
12# support functions for NFS mounts.
13### END INIT INFO
14
15# What is this?
16DESC="NFS common utilities"
17
18# Read config
19DEFAULTFILE=/etc/default/nfs-utils
20NEED_STATD=
21NEED_GSSD=
22if nfsconf --isset general pipefs-directory; then
23 PIPEFS_MOUNTPOINT=$(nfsconf --get general pipefs-directory)
24else
25 PIPEFS_MOUNTPOINT=/var/lib/nfs/rpc_pipefs
26fi
27if [ -f $DEFAULTFILE ]; then
28 . $DEFAULTFILE
29fi
30
31. /etc/init.d/functions
32
33# Exit if required binaries are missing.
34[ -x /usr/sbin/rpc.statd ] || exit 0
35
36#
37# Parse the fstab file, and determine whether we need gssd. (The
38# /etc/defaults settings, if any, will override our autodetection.) This code
39# is partially adapted from the mountnfs.sh script in the sysvinit package.
40#
41AUTO_NEED_GSSD=no
42
43if [ -f /etc/fstab ]; then
44 exec 9<&0 </etc/fstab
45
46 while read -r DEV _ _ OPTS _
47 do
48 case $DEV in
49 ''|\#*)
50 continue
51 ;;
52 esac
53 OLDIFS="$IFS"
54 IFS=","
55 for OPT in $OPTS; do
56 case "$OPT" in
57 sec=krb5|sec=krb5i|sec=krb5p)
58 AUTO_NEED_GSSD=yes
59 ;;
60 esac
61 done
62 IFS="$OLDIFS"
63 done
64
65 exec 0<&9 9<&-
66fi
67
68case "$NEED_STATD" in
69 yes|no)
70 ;;
71 *)
72 NEED_STATD=yes
73 ;;
74esac
75
76case "$NEED_IDMAPD" in
77 yes|no)
78 ;;
79 *)
80 NEED_IDMAPD=yes
81 ;;
82esac
83
84case "$NEED_GSSD" in
85 yes|no)
86 ;;
87 *)
88 NEED_GSSD=$AUTO_NEED_GSSD
89 ;;
90esac
91
92do_modprobe() {
93 if [ -x /sbin/modprobe ] && [ -f /proc/modules ]
94 then
95 modprobe -q "$1" || true
96 fi
97}
98
99do_mount() {
100 if ! grep -E -qs "$1\$" /proc/filesystems
101 then
102 return 1
103 fi
104 if ! mountpoint -q "$2"
105 then
106 mount -t "$1" "$1" "$2"
107 return
108 fi
109 return 0
110}
111
112do_umount() {
113 if mountpoint -q "$1"
114 then
115 umount "$1"
116 fi
117 return 0
118}
119
120# See how we were called.
121case "$1" in
122 start)
123 echo -n "Starting $DESC ..."
124
125 if [ "$NEED_STATD" = yes ]; then
126 echo -n " statd"
127
128 # See if rpcbind is running
129 if [ -x /usr/sbin/rpcinfo ]; then
130 /usr/sbin/rpcinfo -p >/dev/null 2>&1
131 RET=$?
132 if [ $RET != 0 ]; then
133 echo
134 echo "Not starting: portmapper is not running"
135 exit 0
136 fi
137 fi
138 start-stop-daemon --start --oknodo --quiet \
139 --pidfile /run/rpc.statd.pid \
140 --exec /usr/sbin/rpc.statd
141 RET=$?
142 if [ $RET != 0 ]; then
143 echo " failed" $RET
144 exit $RET
145 else
146 if [ -d /run/sendsigs.omit.d ]; then
147 rm -f /run/sendsigs.omit.d/statd
148 ln -s /run/rpc.statd.pid /run/sendsigs.omit.d/statd
149 fi
150 fi
151 fi
152
153 # Don't start idmapd and gssd if we don't have them (say, if /usr is not
154 # up yet).
155 [ -x /usr/sbin/rpc.idmapd ] || NEED_IDMAPD=no
156 [ -x /usr/sbin/rpc.gssd ] || NEED_GSSD=no
157
158 if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]
159 then
160 do_modprobe sunrpc
161 do_modprobe nfs
162 do_modprobe nfsd
163 mkdir -p "$PIPEFS_MOUNTPOINT"
164 if do_mount rpc_pipefs $PIPEFS_MOUNTPOINT
165 then
166 if [ "$NEED_IDMAPD" = yes ]
167 then
168 ecno -n " idmapd"
169 start-stop-daemon --start --oknodo --quiet \
170 --exec /usr/sbin/rpc.idmapd
171 RET=$?
172 if [ $RET != 0 ]; then
173 echo " failed" $RET
174 exit $RET
175 fi
176 fi
177 if [ "$NEED_GSSD" = yes ]
178 then
179 do_modprobe rpcsec_gss_krb5
180 echo -n " gssd"
181
182 start-stop-daemon --start --oknodo --quiet \
183 --exec /usr/sbin/rpc.gssd
184 RET=$?
185 if [ $RET != 0 ]; then
186 echo " failed" $RET
187 exit $RET
188 fi
189 fi
190 fi
191 fi
192 echo " done"
193 ;;
194
195 stop)
196 echo -n "Stopping $DESC ..."
197
198 if [ "$NEED_GSSD" = yes ]
199 then
200 echo -n " gssd"
201 start-stop-daemon --stop --oknodo --quiet \
202 --name rpc.gssd
203 RET=$?
204 if [ $RET != 0 ]; then
205 echo " failed" $RET
206 exit $RET
207 fi
208 fi
209 if [ "$NEED_IDMAPD" = yes ]
210 then
211 echo -n " idmapd"
212 start-stop-daemon --stop --oknodo --quiet \
213 --name rpc.idmapd
214 RET=$?
215 if [ $RET != 0 ]; then
216 echo " failed" $RET
217 exit $RET
218 fi
219 fi
220 if [ "$NEED_STATD" = yes ]
221 then
222 echo -n " statd"
223 start-stop-daemon --stop --oknodo --quiet \
224 --name rpc.statd
225 RET=$?
226 if [ $RET != 0 ]; then
227 echo " failed" $RET
228 exit $RET
229 fi
230 fi
231 do_umount $PIPEFS_MOUNTPOINT 2>/dev/null || true
232 echo " done"
233 ;;
234
235 status)
236 if [ "$NEED_STATD" = yes ]
237 then
238 if ! pidof rpc.statd >/dev/null
239 then
240 echo "rpc.statd not running"
241 exit 3
242 fi
243 fi
244
245 if [ "$NEED_GSSD" = yes ]
246 then
247 if ! pidof rpc.gssd >/dev/null
248 then
249 echo "rpc.gssd not running"
250 exit 3
251 fi
252 fi
253
254 if [ "$NEED_IDMAPD" = yes ]
255 then
256 if ! pidof rpc.idmapd >/dev/null
257 then
258 echo "rpc.idmapd not running"
259 exit 3
260 fi
261 fi
262
263 echo "all daemons running"
264 exit 0
265 ;;
266
267 restart | force-reload)
268 $0 stop
269 sleep 1
270 $0 start
271 ;;
272
273 *)
274 echo "Usage: nfscommon {start|stop|status|restart}"
275 exit 1
276 ;;
277esac
278
279exit 0
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
deleted file mode 100644
index 99ec280b35..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
+++ /dev/null
@@ -1,135 +0,0 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: nfs-kernel-server
5# Required-Start: $remote_fs nfs-common $portmap $time
6# Required-Stop: $remote_fs nfs-common $portmap $time
7# Should-Start: $named
8# Default-Start: 2 3 4 5
9# Default-Stop: 0 1 6
10# Short-Description: Kernel NFS server support
11# Description: NFS is a popular protocol for file sharing across
12# TCP/IP networks. This service provides NFS server
13# functionality, which is configured via the
14# /etc/exports file.
15### END INIT INFO
16#
17# Startup script for nfs-utils
18#
19# Source function library.
20. /etc/init.d/functions
21#
22# The environment variable NFS_SERVERS may be set in /etc/default/nfsd
23# Other control variables may be overridden here too
24test -r /etc/default/nfs-utils && . /etc/default/nfs-utils
25#
26# Location of executables:
27test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd
28test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd
29test -x "$NFS_SVCGSSD" || NFS_SVCGSSD=/usr/sbin/rpc.svcgssd
30#
31# The user mode program must also exist (it just starts the kernel
32# threads using the kernel module code).
33test -x "$NFS_MOUNTD" || exit 0
34test -x "$NFS_NFSD" || exit 0
35
36case "$NEED_SVCGSSD" in
37 yes|no)
38 ;;
39 *)
40 NEED_SVCGSSD=no
41 ;;
42esac
43#
44#----------------------------------------------------------------------
45# Startup and shutdown functions.
46# Actual startup/shutdown is at the end of this file.
47#mountd
48start_mountd(){
49 echo -n 'starting mountd: '
50 start-stop-daemon --start --exec "$NFS_MOUNTD" -- "$@"
51 echo done
52}
53stop_mountd(){
54 echo -n 'stopping mountd: '
55 start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD"
56 echo done
57}
58#
59#svcgssd
60start_svcgssd(){
61 modprobe -q rpcsec_gss_krb5
62 if [ "$NEED_SVCGSSD" = "yes" ]; then
63 echo -n "starting svcgssd: "
64 start-stop-daemon --start --exec "$NFS_SVCGSSD" -- "$@"
65 echo done
66 fi
67}
68stop_svcgssd(){
69 if [ "$NEED_SVCGSSD" = "yes" ]; then
70 echo -n "stop svcgssd: "
71 start-stop-daemon --stop --exec "$NFS_SVCGSSD"
72 echo done
73 fi
74}
75#nfsd
76start_nfsd(){
77 modprobe -q nfsd
78 grep -q nfsd /proc/filesystems || {
79 echo NFS daemon support not enabled in kernel
80 exit 1
81 }
82 grep -q nfsd /proc/mounts || mount -t nfsd nfsd /proc/fs/nfsd
83 grep -q nfsd /proc/mounts || {
84 echo nfsd filesystem could not be mounted at /proc/fs/nfsd
85 exit 1
86 }
87
88 echo -n "starting nfsd: "
89 start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
90 echo done
91}
92stop_nfsd(){
93 echo -n 'stopping nfsd: '
94 $NFS_NFSD 0
95 if pidof nfsd
96 then
97 echo failed
98 else
99 echo done
100 fi
101}
102
103#----------------------------------------------------------------------
104#
105# supported options:
106# start
107# stop
108# reload: reloads the exports file
109# restart: stops and starts mountd
110#FIXME: need to create the /var/lib/nfs/... directories
111case "$1" in
112 start)
113 test -r /etc/exports && exportfs -r
114 start_nfsd
115 start_svcgssd
116 start_mountd
117 test -r /etc/exports && exportfs -a;;
118 stop) exportfs -ua
119 stop_mountd
120 stop_svcgssd
121 stop_nfsd;;
122 status)
123 status /usr/sbin/rpc.mountd
124 RETVAL=$?
125 status nfsd
126 rval=$?
127 [ $RETVAL -eq 0 ] && exit $rval
128 exit $RETVAL;;
129 reload) test -r /etc/exports && exportfs -r;;
130 restart)
131 $0 stop
132 $0 start;;
133 *) echo "Usage: $0 {start|stop|status|reload|restart}"
134 exit 1;;
135esac
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.4.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.4.bb
deleted file mode 100644
index b68a55edcd..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.4.bb
+++ /dev/null
@@ -1,159 +0,0 @@
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 & GPL-2.0-or-later & BSD-3-Clause"
8LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
9
10# util-linux for libblkid
11DEPENDS = "libcap libevent util-linux sqlite3 libtirpc libxml2"
12RDEPENDS:${PN} = "${PN}-client"
13RRECOMMENDS:${PN} = "kernel-module-nfsd"
14
15inherit useradd
16
17USERADD_PACKAGES = "${PN}-client"
18USERADD_PARAM:${PN}-client = "--system --home-dir /var/lib/nfs \
19 --shell /bin/false --user-group rpcuser"
20
21SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
22 file://nfsserver \
23 file://nfscommon \
24 file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \
25 file://0004-Use-nogroup-for-nobody-group.patch \
26 file://0005-find-OE-provided-Kerberos.patch \
27 "
28
29SRC_URI[sha256sum] = "11c4cc598a434d7d340bad3e072a373ba1dcc2c49f855d44b202222b78ecdbf5"
30
31# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
32# pull in the remainder of the dependencies.
33
34INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
35INITSCRIPT_NAME = "nfsserver"
36INITSCRIPT_PARAMS = "defaults"
37INITSCRIPT_NAME:${PN}-client = "nfscommon"
38INITSCRIPT_PARAMS:${PN}-client = "defaults 19 21"
39
40inherit autotools-brokensep update-rc.d systemd pkgconfig
41
42SYSTEMD_PACKAGES = "${PN} ${PN}-client"
43SYSTEMD_SERVICE:${PN} = "nfs-server.service"
44SYSTEMD_SERVICE:${PN}-client = "nfs-client.target"
45
46# --enable-uuid is need for cross-compiling
47EXTRA_OECONF = "--with-statduser=rpcuser \
48 --enable-mountconfig \
49 --enable-libmount-mount \
50 --enable-uuid \
51 --with-statdpath=/var/lib/nfs/statd \
52 --with-pluginpath=${libdir}/libnfsidmap \
53 --with-rpcgen=${HOSTTOOLS_DIR}/rpcgen \
54 "
55
56LDFLAGS += "-lsqlite3 -levent"
57
58PACKAGECONFIG ??= "tcp-wrappers \
59 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \
60"
61
62PACKAGECONFIG:remove:libc-musl = "tcp-wrappers"
63#krb5 is available in meta-oe
64PACKAGECONFIG[gssapi] = "--with-krb5=${STAGING_EXECPREFIXDIR} --enable-gss --enable-svcgss,--disable-gss --disable-svcgss,krb5"
65PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
66PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
67# libdevmapper is available in meta-oe
68PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmapper"
69# keyutils is available in meta-oe
70PACKAGECONFIG[nfsv4] = "--enable-nfsv4 --enable-nfsdcltrack,--disable-nfsv4 --disable-nfsdcltrack,keyutils,python3-core"
71PACKAGECONFIG[nfsdctl] = "--enable-nfsdctl,--disable-nfsdctl,libnl readline,"
72PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd"
73
74PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats ${PN}-rpcctl"
75
76CONFFILES:${PN}-client += "${localstatedir}/lib/nfs/etab \
77 ${localstatedir}/lib/nfs/rmtab \
78 ${localstatedir}/lib/nfs/xtab \
79 ${localstatedir}/lib/nfs/statd/state \
80 ${sysconfdir}/idmapd.conf \
81 ${sysconfdir}/nfs.conf \
82 ${sysconfdir}/nfsmount.conf"
83
84FILES:${PN}-client = "${sbindir}/*statd \
85 ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
86 ${sbindir}/showmount ${sbindir}/nfsstat \
87 ${sbindir}/rpc.gssd \
88 ${sbindir}/nfsconf \
89 ${libdir}/libnfsidmap.so.* \
90 ${libdir}/libnfsidmap/*.so \
91 ${libexecdir}/nfsrahead \
92 ${localstatedir}/lib/nfs \
93 ${sysconfdir}/idmapd.conf \
94 ${sysconfdir}/init.d/nfscommon \
95 ${sysconfdir}/nfs.conf \
96 ${sysconfdir}/nfsmount.conf \
97 ${systemd_system_unitdir}/auth-rpcgss-module.service \
98 ${systemd_system_unitdir}/nfs-client.target \
99 ${systemd_system_unitdir}/nfs-idmapd.service \
100 ${systemd_system_unitdir}/nfs-statd.service \
101 ${systemd_system_unitdir}/nfscommon.service \
102 ${systemd_system_unitdir}/rpc-gssd.service \
103 ${systemd_system_unitdir}/rpc-statd-notify.service \
104 ${systemd_system_unitdir}/rpc-statd.service \
105 ${systemd_system_unitdir}/rpc_pipefs.target \
106 ${systemd_system_unitdir}/var-lib-nfs-rpc_pipefs.mount \
107 ${nonarch_libdir}/udev/rules.d/*"
108RDEPENDS:${PN}-client = "${PN}-mount rpcbind"
109
110FILES:${PN}-mount = "${base_sbindir}/*mount.nfs*"
111
112FILES:${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat ${sbindir}/nfsdclnts"
113RDEPENDS:${PN}-stats = "python3-core"
114
115FILES:${PN}-rpcctl = "${sbindir}/rpcctl"
116RDEPENDS:${PN}-rpcctl = "python3-core"
117
118FILES:${PN}-staticdev += "${libdir}/libnfsidmap/*.a"
119
120FILES:${PN} += "${systemd_unitdir} ${libdir}/libnfsidmap/ ${nonarch_libdir}/modprobe.d"
121
122do_configure:prepend() {
123 sed -i -e 's,sbindir = .*,sbindir = ${base_sbindir},g' \
124 -e 's,udev_rulesdir = .*,udev_rulesdir = ${nonarch_base_libdir}/udev/rules.d/,g' \
125 ${S}/utils/mount/Makefile.am ${S}/utils/nfsdcltrack/Makefile.am \
126 ${S}/systemd/Makefile.am ${S}/tools/nfsrahead/Makefile.am
127}
128
129# Make clean needed because the package comes with
130# precompiled 64-bit objects that break the build
131do_compile:prepend() {
132 make clean
133}
134
135# Works on systemd only
136HIGH_RLIMIT_NOFILE ??= "4096"
137
138do_install:append () {
139 install -d ${D}${sysconfdir}/init.d
140 install -m 0755 ${UNPACKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
141 install -m 0755 ${UNPACKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
142
143 install -m 0644 ${S}/support/nfsidmap/idmapd.conf ${D}${sysconfdir}
144 install -m 0644 ${S}/nfs.conf ${D}${sysconfdir}
145
146 install -d ${D}${systemd_system_unitdir}
147 # Retain historical service name so old scripts keep working
148 ln -s rpc-statd.service ${D}${systemd_system_unitdir}/nfs-statd.service
149 # Add compatibility symlinks for the sysvinit scripts
150 ln -s nfs-server.service ${D}${systemd_system_unitdir}/nfsserver.service
151 ln -s /dev/null ${D}${systemd_system_unitdir}/nfscommon.service
152
153 # kernel code as of 3.8 hard-codes this path as a default
154 install -d ${D}/var/lib/nfs/v4recovery
155
156 # chown the directories and files
157 chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
158 chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
159}