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-Makefile.am-fix-undefined-function-for-libnsm.a.patch299
-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/bugfix-adjust-statd-service-name.patch39
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch36
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service17
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service23
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service14
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-debianize-start-statd.patch42
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf35
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon300
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver71
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount8
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_2.5.2.bb145
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.3.bb159
16 files changed, 571 insertions, 733 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch
deleted file mode 100644
index bd350144e3..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch
+++ /dev/null
@@ -1,299 +0,0 @@
1From 690a90a5b7786e40b5447ad7c5f19a7657d27405 Mon Sep 17 00:00:00 2001
2From: Mingli Yu <Mingli.Yu@windriver.com>
3Date: Fri, 14 Dec 2018 17:44:32 +0800
4Subject: [PATCH] Makefile.am: fix undefined function for libnsm.a
5
6The source file of libnsm.a uses some function
7in ../support/misc/file.c, add ../support/misc/file.c
8to libnsm_a_SOURCES to fix build error when run
9"make -C tests statdb_dump":
10| ../support/nsm/libnsm.a(file.o): In function `nsm_make_pathname':
11| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname'
12| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname'
13| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname'
14| ../support/nsm/libnsm.a(file.o): In function `nsm_setup_pathnames':
15| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:280: undefined reference to `generic_setup_basedir'
16| collect2: error: ld returned 1 exit status
17
18As there is already one source file named file.c
19as support/nsm/file.c in support/nsm/Makefile.am,
20so rename ../support/misc/file.c to ../support/misc/misc.c.
21
22Upstream-Status: Submitted[https://marc.info/?l=linux-nfs&m=154502780423058&w=2]
23
24Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
25
26Rebase it.
27
28Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
29---
30 support/misc/Makefile.am | 2 +-
31 support/misc/file.c | 115 ---------------------------------------------------------------------------------------------------------------
32 support/misc/misc.c | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33 support/nsm/Makefile.am | 2 +-
34 4 files changed, 113 insertions(+), 117 deletions(-)
35
36diff --git a/support/misc/Makefile.am b/support/misc/Makefile.am
37index f9993e3..8b0e9db 100644
38--- a/support/misc/Makefile.am
39+++ b/support/misc/Makefile.am
40@@ -1,7 +1,7 @@
41 ## Process this file with automake to produce Makefile.in
42
43 noinst_LIBRARIES = libmisc.a
44-libmisc_a_SOURCES = tcpwrapper.c from_local.c mountpoint.c file.c \
45+libmisc_a_SOURCES = tcpwrapper.c from_local.c mountpoint.c misc.c \
46 nfsd_path.c workqueue.c xstat.c
47
48 MAINTAINERCLEANFILES = Makefile.in
49diff --git a/support/misc/file.c b/support/misc/file.c
50deleted file mode 100644
51index 06f6bb2..0000000
52--- a/support/misc/file.c
53+++ /dev/null
54@@ -1,115 +0,0 @@
55-/*
56- * Copyright 2009 Oracle. All rights reserved.
57- * Copyright 2017 Red Hat, Inc. All rights reserved.
58- *
59- * This file is part of nfs-utils.
60- *
61- * nfs-utils is free software; you can redistribute it and/or modify
62- * it under the terms of the GNU General Public License as published by
63- * the Free Software Foundation; either version 2 of the License, or
64- * (at your option) any later version.
65- *
66- * nfs-utils is distributed in the hope that it will be useful,
67- * but WITHOUT ANY WARRANTY; without even the implied warranty of
68- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
69- * GNU General Public License for more details.
70- *
71- * You should have received a copy of the GNU General Public License
72- * along with nfs-utils. If not, see <http://www.gnu.org/licenses/>.
73- */
74-
75-#ifdef HAVE_CONFIG_H
76-#include <config.h>
77-#endif
78-
79-#include <sys/stat.h>
80-
81-#include <string.h>
82-#include <libgen.h>
83-#include <stdio.h>
84-#include <errno.h>
85-#include <dirent.h>
86-#include <stdlib.h>
87-#include <stdbool.h>
88-#include <limits.h>
89-
90-#include "xlog.h"
91-#include "misc.h"
92-
93-/*
94- * Returns a dynamically allocated, '\0'-terminated buffer
95- * containing an appropriate pathname, or NULL if an error
96- * occurs. Caller must free the returned result with free(3).
97- */
98-__attribute__((__malloc__))
99-char *
100-generic_make_pathname(const char *base, const char *leaf)
101-{
102- size_t size;
103- char *path;
104- int len;
105-
106- size = strlen(base) + strlen(leaf) + 2;
107- if (size > PATH_MAX)
108- return NULL;
109-
110- path = malloc(size);
111- if (path == NULL)
112- return NULL;
113-
114- len = snprintf(path, size, "%s/%s", base, leaf);
115- if ((len < 0) || ((size_t)len >= size)) {
116- free(path);
117- return NULL;
118- }
119-
120- return path;
121-}
122-
123-
124-/**
125- * generic_setup_basedir - set up basedir
126- * @progname: C string containing name of program, for error messages
127- * @parentdir: C string containing pathname to on-disk state, or NULL
128- * @base: character buffer to contain the basedir that is set up
129- * @baselen: size of @base in bytes
130- *
131- * This runs before logging is set up, so error messages are directed
132- * to stderr.
133- *
134- * Returns true and sets up our basedir, if @parentdir was valid
135- * and usable; otherwise false is returned.
136- */
137-_Bool
138-generic_setup_basedir(const char *progname, const char *parentdir, char *base,
139- const size_t baselen)
140-{
141- static char buf[PATH_MAX];
142- struct stat st;
143- char *path;
144-
145- /* First: test length of name and whether it exists */
146- if ((strlen(parentdir) >= baselen) || (strlen(parentdir) >= PATH_MAX)) {
147- (void)fprintf(stderr, "%s: Directory name too long: %s",
148- progname, parentdir);
149- return false;
150- }
151- if (lstat(parentdir, &st) == -1) {
152- (void)fprintf(stderr, "%s: Failed to stat %s: %s",
153- progname, parentdir, strerror(errno));
154- return false;
155- }
156-
157- /* Ensure we have a clean directory pathname */
158- strncpy(buf, parentdir, sizeof(buf)-1);
159- path = dirname(buf);
160- if (*path == '.') {
161- (void)fprintf(stderr, "%s: Unusable directory %s",
162- progname, parentdir);
163- return false;
164- }
165-
166- xlog(D_CALL, "Using %s as the state directory", parentdir);
167- strcpy(base, parentdir);
168- return true;
169-}
170diff --git a/support/misc/misc.c b/support/misc/misc.c
171new file mode 100644
172index 0000000..e7c3819
173--- /dev/null
174+++ b/support/misc/misc.c
175@@ -0,0 +1,111 @@
176+/*
177+ * Copyright 2009 Oracle. All rights reserved.
178+ * Copyright 2017 Red Hat, Inc. All rights reserved.
179+ *
180+ * This file is part of nfs-utils.
181+ *
182+ * nfs-utils is free software; you can redistribute it and/or modify
183+ * it under the terms of the GNU General Public License as published by
184+ * the Free Software Foundation; either version 2 of the License, or
185+ * (at your option) any later version.
186+ *
187+ * nfs-utils is distributed in the hope that it will be useful,
188+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
189+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
190+ * GNU General Public License for more details.
191+ *
192+ * You should have received a copy of the GNU General Public License
193+ * along with nfs-utils. If not, see <http://www.gnu.org/licenses/>.
194+ */
195+
196+#include <sys/stat.h>
197+
198+#include <string.h>
199+#include <libgen.h>
200+#include <stdio.h>
201+#include <errno.h>
202+#include <dirent.h>
203+#include <stdlib.h>
204+#include <stdbool.h>
205+#include <limits.h>
206+
207+#include "xlog.h"
208+#include "misc.h"
209+
210+/*
211+ * Returns a dynamically allocated, '\0'-terminated buffer
212+ * containing an appropriate pathname, or NULL if an error
213+ * occurs. Caller must free the returned result with free(3).
214+ */
215+__attribute__((__malloc__))
216+char *
217+generic_make_pathname(const char *base, const char *leaf)
218+{
219+ size_t size;
220+ char *path;
221+ int len;
222+
223+ size = strlen(base) + strlen(leaf) + 2;
224+ if (size > PATH_MAX)
225+ return NULL;
226+
227+ path = malloc(size);
228+ if (path == NULL)
229+ return NULL;
230+
231+ len = snprintf(path, size, "%s/%s", base, leaf);
232+ if ((len < 0) || ((size_t)len >= size)) {
233+ free(path);
234+ return NULL;
235+ }
236+
237+ return path;
238+}
239+
240+
241+/**
242+ * generic_setup_basedir - set up basedir
243+ * @progname: C string containing name of program, for error messages
244+ * @parentdir: C string containing pathname to on-disk state, or NULL
245+ * @base: character buffer to contain the basedir that is set up
246+ * @baselen: size of @base in bytes
247+ *
248+ * This runs before logging is set up, so error messages are directed
249+ * to stderr.
250+ *
251+ * Returns true and sets up our basedir, if @parentdir was valid
252+ * and usable; otherwise false is returned.
253+ */
254+_Bool
255+generic_setup_basedir(const char *progname, const char *parentdir, char *base,
256+ const size_t baselen)
257+{
258+ static char buf[PATH_MAX];
259+ struct stat st;
260+ char *path;
261+
262+ /* First: test length of name and whether it exists */
263+ if ((strlen(parentdir) >= baselen) || (strlen(parentdir) >= PATH_MAX)) {
264+ (void)fprintf(stderr, "%s: Directory name too long: %s",
265+ progname, parentdir);
266+ return false;
267+ }
268+ if (lstat(parentdir, &st) == -1) {
269+ (void)fprintf(stderr, "%s: Failed to stat %s: %s",
270+ progname, parentdir, strerror(errno));
271+ return false;
272+ }
273+
274+ /* Ensure we have a clean directory pathname */
275+ strncpy(buf, parentdir, sizeof(buf)-1);
276+ path = dirname(buf);
277+ if (*path == '.') {
278+ (void)fprintf(stderr, "%s: Unusable directory %s",
279+ progname, parentdir);
280+ return false;
281+ }
282+
283+ xlog(D_CALL, "Using %s as the state directory", parentdir);
284+ strcpy(base, parentdir);
285+ return true;
286+}
287diff --git a/support/nsm/Makefile.am b/support/nsm/Makefile.am
288index 8f5874e..68f1a46 100644
289--- a/support/nsm/Makefile.am
290+++ b/support/nsm/Makefile.am
291@@ -10,7 +10,7 @@ GENFILES = $(GENFILES_CLNT) $(GENFILES_SVC) $(GENFILES_XDR) $(GENFILES_H)
292 EXTRA_DIST = sm_inter.x
293
294 noinst_LIBRARIES = libnsm.a
295-libnsm_a_SOURCES = $(GENFILES) file.c rpc.c
296+libnsm_a_SOURCES = $(GENFILES) ../misc/misc.c file.c rpc.c
297
298 BUILT_SOURCES = $(GENFILES)
299
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
new file mode 100644
index 0000000000..351407ddcd
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-locktest-Makefile.am-Do-not-use-build-flags.patch
@@ -0,0 +1,36 @@
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
new file mode 100644
index 0000000000..bbf44d5977
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch
@@ -0,0 +1,38 @@
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
new file mode 100644
index 0000000000..3241e8e859
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch
@@ -0,0 +1,42 @@
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/bugfix-adjust-statd-service-name.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/bugfix-adjust-statd-service-name.patch
deleted file mode 100644
index f13d7b380c..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/bugfix-adjust-statd-service-name.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From 398fed3bb0350cb1229e54e7020ae0e044c206d1 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Ulrich=20=C3=96lmann?= <u.oelmann@pengutronix.de>
3Date: Wed, 17 Feb 2016 08:33:45 +0100
4Subject: bugfix: adjust statd service name
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Upstream uses 'rpc-statd.service' and Yocto introduced 'nfs-statd.service'
10instead but forgot to update the mount.nfs helper 'start-statd' accordingly.
11
12Upstream-Status: Inappropriate [other]
13
14Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
15
16Rebase it.
17
18Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
19---
20 utils/statd/start-statd | 4 ++--
21 1 file changed, 2 insertions(+), 2 deletions(-)
22
23diff --git a/utils/statd/start-statd b/utils/statd/start-statd
24index af5c950..df9b9be 100755
25--- a/utils/statd/start-statd
26+++ b/utils/statd/start-statd
27@@ -28,10 +28,10 @@ fi
28 # First try systemd if it's installed.
29 if [ -d /run/systemd/system ]; then
30 # Quit only if the call worked.
31- if systemctl start rpc-statd.service; then
32+ if systemctl start nfs-statd.service; then
33 # Ensure systemd knows not to stop rpc.statd or its dependencies
34 # on 'systemctl isolate ..'
35- systemctl add-wants --runtime remote-fs.target rpc-statd.service
36+ systemctl add-wants --runtime remote-fs.target nfs-statd.service
37 exit 0
38 fi
39 fi
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch
deleted file mode 100644
index fde99b599e..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From 1ab0c326405c6daa06f1a7eb4b0b60bf4e0584c2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 31 Dec 2019 08:15:34 -0800
4Subject: [PATCH] Detect warning options during configure
5
6Certain options maybe compiler specific therefore its better
7to detect them before use.
8
9nfs_error copies the format string and appends newline to it
10but compiler can forget that it was format string since its not
11same fmt string that was passed. Ignore the warning
12
13Wdiscarded-qualifiers is gcc specific and this is no longer needed
14
15Upstream-Status: Pending
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17
18---
19 support/nfs/xcommon.c | 3 +++
20 1 file changed, 3 insertions(+)
21
22diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c
23index 3989f0b..e080423 100644
24--- a/support/nfs/xcommon.c
25+++ b/support/nfs/xcommon.c
26@@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) {
27
28 fmt2 = xstrconcat2 (fmt, "\n");
29 va_start (args, fmt);
30+#pragma GCC diagnostic push
31+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
32 vfprintf (stderr, fmt2, args);
33+#pragma GCC diagnostic pop
34 va_end (args);
35 free (fmt2);
36 }
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
deleted file mode 100644
index c01415de84..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
+++ /dev/null
@@ -1,17 +0,0 @@
1[Unit]
2Description=NFS Mount Daemon
3DefaultDependencies=no
4After=rpcbind.socket
5Requires=proc-fs-nfsd.mount
6After=proc-fs-nfsd.mount
7After=network.target local-fs.target
8BindsTo=nfs-server.service
9ConditionPathExists=@SYSCONFDIR@/exports
10
11[Service]
12EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
13ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS
14LimitNOFILE=@HIGH_RLIMIT_NOFILE@
15
16[Install]
17WantedBy=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
deleted file mode 100644
index 5c845b7e82..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
+++ /dev/null
@@ -1,23 +0,0 @@
1[Unit]
2Description=NFS server and services
3DefaultDependencies=no
4Requires=network.target proc-fs-nfsd.mount
5Requires=nfs-mountd.service
6Wants=rpcbind.service
7After=local-fs.target
8After=network.target proc-fs-nfsd.mount rpcbind.service nfs-mountd.service
9ConditionPathExists=@SYSCONFDIR@/exports
10
11[Service]
12Type=oneshot
13EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
14ExecStartPre=@SBINDIR@/exportfs -r
15ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT
16ExecStop=@SBINDIR@/rpc.nfsd 0
17ExecStopPost=@SBINDIR@/exportfs -au
18ExecStopPost=@SBINDIR@/exportfs -f
19ExecReload=@SBINDIR@/exportfs -r
20RemainAfterExit=yes
21
22[Install]
23WantedBy=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
deleted file mode 100644
index 4fa64e1998..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
+++ /dev/null
@@ -1,14 +0,0 @@
1[Unit]
2Description=NFS status monitor for NFSv2/3 locking.
3DefaultDependencies=no
4Conflicts=umount.target
5Requires=nss-lookup.target rpcbind.service
6After=network.target nss-lookup.target rpcbind.service
7
8[Service]
9EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
10ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS
11LimitNOFILE=@HIGH_RLIMIT_NOFILE@
12
13[Install]
14WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-debianize-start-statd.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-debianize-start-statd.patch
deleted file mode 100644
index ede0dcefc4..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-debianize-start-statd.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1[PATCH] nfs-utils: debianize start-statd
2
3Upstream-Status: Pending
4
5make start-statd command to use nfscommon configure, too.
6
7Signed-off-by: Henrik Riomar <henrik.riomar@ericsson.com>
8Signed-off-by: Li Wang <li.wang@windriver.com>
9Signed-off-by: Roy Li <rongqing.li@windriver.com>
10Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
11---
12 utils/statd/start-statd | 10 +++++++++-
13 1 file changed, 9 insertions(+), 1 deletion(-)
14
15diff --git a/utils/statd/start-statd b/utils/statd/start-statd
16index 2fd6039..f591b34 100755
17--- a/utils/statd/start-statd
18+++ b/utils/statd/start-statd
19@@ -17,6 +17,14 @@ then
20 # statd already running - must have been slow to respond.
21 exit 0
22 fi
23+
24+# Read config
25+DEFAULTFILE=/etc/default/nfs-common
26+NEED_IDMAPD=
27+if [ -f $DEFAULTFILE ]; then
28+ . $DEFAULTFILE
29+fi
30+
31 # First try systemd if it's installed.
32 if [ -d /run/systemd/system ]; then
33 # Quit only if the call worked.
34@@ -25,4 +33,4 @@ fi
35
36 cd /
37 # Fall back to launching it ourselves.
38-exec rpc.statd --no-notify
39+exec rpc.statd --no-notify $STATDOPTS
40--
412.6.6
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
deleted file mode 100644
index a1007a7fbf..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf
+++ /dev/null
@@ -1,35 +0,0 @@
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
index 992267d5a1..9b7fd17b41 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
@@ -1,63 +1,279 @@
1#!/bin/sh 1#!/bin/sh
2
2### BEGIN INIT INFO 3### BEGIN INIT INFO
3# Provides: nfs-common 4# Provides: nfs-common
4# Required-Start: $portmap hwclock 5# Required-Start: $portmap $time
5# Required-Stop: $portmap hwclock 6# Required-Stop: $portmap $time
6# Default-Start: 2 3 4 5 7# Default-Start: S
7# Default-Stop: 0 1 6 8# Default-Stop: 0 1 6
8# Short-Description: NFS support for both client and server 9# Short-Description: NFS support files common to client and server
9# Description: NFS is a popular protocol for file sharing across 10# Description: NFS is a popular protocol for file sharing across
10# TCP/IP networks. This service provides various 11# TCP/IP networks. This service provides various
11# support functions for NFS mounts. 12# support functions for NFS mounts.
12### END INIT INFO 13### END INIT INFO
13#
14# Startup script for nfs-utils
15#
16#
17# Location of executables:
18 14
19# Source function library. 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
20. /etc/init.d/functions 31. /etc/init.d/functions
21 32
22test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd 33# Exit if required binaries are missing.
23test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid 34[ -x /usr/sbin/rpc.statd ] || exit 0
35
24# 36#
25# The default state directory is /var/lib/nfs 37# Parse the fstab file, and determine whether we need gssd. (The
26test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs 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.
27# 40#
28#---------------------------------------------------------------------- 41AUTO_NEED_GSSD=no
29# Startup and shutdown functions. 42
30# Actual startup/shutdown is at the end of this file. 43if [ -f /etc/fstab ]; then
31 44 exec 9<&0 </etc/fstab
32start_statd(){ 45
33 echo -n "starting statd: " 46 while read -r DEV _ _ OPTS _
34 start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID" 47 do
35 echo done 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
36} 110}
37stop_statd(){ 111
38 echo -n 'stopping statd: ' 112do_umount() {
39 start-stop-daemon --stop --quiet --signal 1 --pidfile "$STATD_PID" 113 if mountpoint -q "$1"
40 echo done 114 then
115 umount "$1"
116 fi
117 return 0
41} 118}
42#---------------------------------------------------------------------- 119
43# 120# See how we were called.
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 121case "$1" in
50 start) 122 start)
51 start_statd;; 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
52 stop) 195 stop)
53 stop_statd;; 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
54 status) 235 status)
55 status $NFS_STATD 236 if [ "$NEED_STATD" = yes ]
56 exit $?;; 237 then
57 restart) 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)
58 $0 stop 268 $0 stop
59 $0 start;; 269 sleep 1
270 $0 start
271 ;;
272
60 *) 273 *)
61 echo "Usage: $0 {start|stop|status|restart}" 274 echo "Usage: nfscommon {start|stop|status|restart}"
62 exit 1;; 275 exit 1
276 ;;
63esac 277esac
278
279exit 0
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
index 0f5747cc6d..99ec280b35 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
@@ -1,8 +1,10 @@
1#!/bin/sh 1#!/bin/sh
2
2### BEGIN INIT INFO 3### BEGIN INIT INFO
3# Provides: nfs-kernel-server 4# Provides: nfs-kernel-server
4# Required-Start: $remote_fs nfs-common $portmap hwclock 5# Required-Start: $remote_fs nfs-common $portmap $time
5# Required-Stop: $remote_fs nfs-common $portmap hwclock 6# Required-Stop: $remote_fs nfs-common $portmap $time
7# Should-Start: $named
6# Default-Start: 2 3 4 5 8# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6 9# Default-Stop: 0 1 6
8# Short-Description: Kernel NFS server support 10# Short-Description: Kernel NFS server support
@@ -19,20 +21,25 @@
19# 21#
20# The environment variable NFS_SERVERS may be set in /etc/default/nfsd 22# The environment variable NFS_SERVERS may be set in /etc/default/nfsd
21# Other control variables may be overridden here too 23# Other control variables may be overridden here too
22test -r /etc/default/nfsd && . /etc/default/nfsd 24test -r /etc/default/nfs-utils && . /etc/default/nfs-utils
23# 25#
24# Location of executables: 26# Location of executables:
25test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd 27test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd
26test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd 28test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd
29test -x "$NFS_SVCGSSD" || NFS_SVCGSSD=/usr/sbin/rpc.svcgssd
27# 30#
28# The user mode program must also exist (it just starts the kernel 31# The user mode program must also exist (it just starts the kernel
29# threads using the kernel module code). 32# threads using the kernel module code).
30test -x "$NFS_MOUNTD" || exit 0 33test -x "$NFS_MOUNTD" || exit 0
31test -x "$NFS_NFSD" || exit 0 34test -x "$NFS_NFSD" || exit 0
32# 35
33# Default is 8 threads, value is settable between 1 and the truely 36case "$NEED_SVCGSSD" in
34# ridiculous 99 37 yes|no)
35test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8 38 ;;
39 *)
40 NEED_SVCGSSD=no
41 ;;
42esac
36# 43#
37#---------------------------------------------------------------------- 44#----------------------------------------------------------------------
38# Startup and shutdown functions. 45# Startup and shutdown functions.
@@ -49,6 +56,22 @@ stop_mountd(){
49 echo done 56 echo done
50} 57}
51# 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}
52#nfsd 75#nfsd
53start_nfsd(){ 76start_nfsd(){
54 modprobe -q nfsd 77 modprobe -q nfsd
@@ -62,38 +85,18 @@ start_nfsd(){
62 exit 1 85 exit 1
63 } 86 }
64 87
65 echo -n "starting $1 nfsd kernel threads: " 88 echo -n "starting nfsd: "
66 start-stop-daemon --start --exec "$NFS_NFSD" -- "$@" 89 start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
67 echo done 90 echo done
68} 91}
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(){ 92stop_nfsd(){
83 # WARNING: this kills any process with the executable
84 # name 'nfsd'.
85 echo -n 'stopping nfsd: ' 93 echo -n 'stopping nfsd: '
86 start-stop-daemon --stop --quiet --signal 1 --name nfsd 94 $NFS_NFSD 0
87 if delay_nfsd || { 95 if pidof 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 96 then
94 echo done
95 else
96 echo failed 97 echo failed
98 else
99 echo done
97 fi 100 fi
98} 101}
99 102
@@ -108,11 +111,13 @@ stop_nfsd(){
108case "$1" in 111case "$1" in
109 start) 112 start)
110 test -r /etc/exports && exportfs -r 113 test -r /etc/exports && exportfs -r
111 start_nfsd "$NFS_SERVERS" 114 start_nfsd
115 start_svcgssd
112 start_mountd 116 start_mountd
113 test -r /etc/exports && exportfs -a;; 117 test -r /etc/exports && exportfs -a;;
114 stop) exportfs -ua 118 stop) exportfs -ua
115 stop_mountd 119 stop_mountd
120 stop_svcgssd
116 stop_nfsd;; 121 stop_nfsd;;
117 status) 122 status)
118 status /usr/sbin/rpc.mountd 123 status /usr/sbin/rpc.mountd
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
deleted file mode 100644
index 630801b375..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
+++ /dev/null
@@ -1,8 +0,0 @@
1[Unit]
2Description=NFSD configuration filesystem
3After=systemd-modules-load.service
4
5[Mount]
6What=nfsd
7Where=/proc/fs/nfsd
8Type=nfsd
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.5.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.5.2.bb
deleted file mode 100644
index c7ac67cf31..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.5.2.bb
+++ /dev/null
@@ -1,145 +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 & GPLv2+ & BSD"
8LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
9
10# util-linux for libblkid
11DEPENDS = "libcap libevent util-linux sqlite3 libtirpc"
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://nfs-utils.conf \
25 file://nfs-server.service \
26 file://nfs-mountd.service \
27 file://nfs-statd.service \
28 file://proc-fs-nfsd.mount \
29 file://nfs-utils-debianize-start-statd.patch \
30 file://bugfix-adjust-statd-service-name.patch \
31 file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \
32 file://clang-warnings.patch \
33 "
34SRC_URI[sha256sum] = "d493b81c9d3ffce5d10af701a63ed2b8a21768c23da4a2eceb4d708aea65d9de"
35
36# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
37# pull in the remainder of the dependencies.
38
39INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
40INITSCRIPT_NAME = "nfsserver"
41INITSCRIPT_PARAMS = "defaults"
42INITSCRIPT_NAME_${PN}-client = "nfscommon"
43INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
44
45inherit autotools-brokensep update-rc.d systemd pkgconfig
46
47SYSTEMD_PACKAGES = "${PN} ${PN}-client"
48SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
49SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
50
51# --enable-uuid is need for cross-compiling
52EXTRA_OECONF = "--with-statduser=rpcuser \
53 --enable-mountconfig \
54 --enable-libmount-mount \
55 --enable-uuid \
56 --disable-gss \
57 --disable-nfsdcltrack \
58 --with-statdpath=/var/lib/nfs/statd \
59 --with-rpcgen=${HOSTTOOLS_DIR}/rpcgen \
60 "
61
62PACKAGECONFIG ??= "tcp-wrappers \
63 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
64"
65PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
66PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
67PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
68# libdevmapper is available in meta-oe
69PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmapper"
70# keyutils is available in meta-oe
71PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils,python3-core"
72
73PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats"
74
75CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
76 ${localstatedir}/lib/nfs/rmtab \
77 ${localstatedir}/lib/nfs/xtab \
78 ${localstatedir}/lib/nfs/statd/state \
79 ${sysconfdir}/nfsmount.conf"
80
81FILES_${PN}-client = "${sbindir}/*statd \
82 ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
83 ${sbindir}/showmount ${sbindir}/nfsstat \
84 ${localstatedir}/lib/nfs \
85 ${sysconfdir}/nfs-utils.conf \
86 ${sysconfdir}/nfsmount.conf \
87 ${sysconfdir}/init.d/nfscommon \
88 ${systemd_unitdir}/system/nfs-statd.service"
89RDEPENDS_${PN}-client = "${PN}-mount rpcbind"
90
91FILES_${PN}-mount = "${base_sbindir}/*mount.nfs*"
92
93FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat ${sbindir}/nfsdclnts"
94RDEPENDS_${PN}-stats = "python3-core"
95
96FILES_${PN}-staticdev += "${libdir}/libnfsidmap/*.a"
97
98FILES_${PN} += "${systemd_unitdir} ${libdir}/libnfsidmap/"
99
100do_configure_prepend() {
101 sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
102 ${S}/utils/mount/Makefile.am
103}
104
105# Make clean needed because the package comes with
106# precompiled 64-bit objects that break the build
107do_compile_prepend() {
108 make clean
109}
110
111# Works on systemd only
112HIGH_RLIMIT_NOFILE ??= "4096"
113
114do_install_append () {
115 install -d ${D}${sysconfdir}/init.d
116 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
117 install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
118
119 install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
120 install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
121
122 install -d ${D}${systemd_unitdir}/system
123 install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
124 install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
125 install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
126 sed -i -e 's,@SBINDIR@,${sbindir},g' \
127 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
128 -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},g' \
129 ${D}${systemd_unitdir}/system/*.service
130 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
131 install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
132 install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
133 ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
134 fi
135
136 # kernel code as of 3.8 hard-codes this path as a default
137 install -d ${D}/var/lib/nfs/v4recovery
138
139 # chown the directories and files
140 chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
141 chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
142
143 # Make python tools use python 3
144 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
145}
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.3.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.3.bb
new file mode 100644
index 0000000000..9668ac0e86
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.3.bb
@@ -0,0 +1,159 @@
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] = "11e7c5847a8423a72931c865bd9296e7fd56ff270a795a849183900961711725"
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 = /sbin,sbindir = ${base_sbindir},g' \
124 -e 's,udev_rulesdir = /usr/lib/udev/rules.d/,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}