Complete Yocto mirror with license table for TQMa6UL (2038-compliance)

- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
Siggi (OpenClaw Agent)
2026-03-01 20:58:18 +00:00
commit 16accb6b24
15086 changed files with 1292356 additions and 0 deletions

View File

@@ -0,0 +1,299 @@
From 690a90a5b7786e40b5447ad7c5f19a7657d27405 Mon Sep 17 00:00:00 2001
From: Mingli Yu <Mingli.Yu@windriver.com>
Date: Fri, 14 Dec 2018 17:44:32 +0800
Subject: [PATCH] Makefile.am: fix undefined function for libnsm.a
The source file of libnsm.a uses some function
in ../support/misc/file.c, add ../support/misc/file.c
to libnsm_a_SOURCES to fix build error when run
"make -C tests statdb_dump":
| ../support/nsm/libnsm.a(file.o): In function `nsm_make_pathname':
| /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'
| /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'
| /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'
| ../support/nsm/libnsm.a(file.o): In function `nsm_setup_pathnames':
| /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'
| collect2: error: ld returned 1 exit status
As there is already one source file named file.c
as support/nsm/file.c in support/nsm/Makefile.am,
so rename ../support/misc/file.c to ../support/misc/misc.c.
Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=154502780423058&w=2]
Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
Rebase it.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
support/misc/Makefile.am | 2 +-
support/misc/file.c | 115 ---------------------------------------------------------------------------------------------------------------
support/misc/misc.c | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
support/nsm/Makefile.am | 2 +-
4 files changed, 113 insertions(+), 117 deletions(-)
diff --git a/support/misc/Makefile.am b/support/misc/Makefile.am
index f9993e3..8b0e9db 100644
--- a/support/misc/Makefile.am
+++ b/support/misc/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
noinst_LIBRARIES = libmisc.a
-libmisc_a_SOURCES = tcpwrapper.c from_local.c mountpoint.c file.c \
+libmisc_a_SOURCES = tcpwrapper.c from_local.c mountpoint.c misc.c \
nfsd_path.c workqueue.c xstat.c
MAINTAINERCLEANFILES = Makefile.in
diff --git a/support/misc/file.c b/support/misc/file.c
deleted file mode 100644
index 06f6bb2..0000000
--- a/support/misc/file.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2009 Oracle. All rights reserved.
- * Copyright 2017 Red Hat, Inc. All rights reserved.
- *
- * This file is part of nfs-utils.
- *
- * nfs-utils is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * nfs-utils is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with nfs-utils. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/stat.h>
-
-#include <string.h>
-#include <libgen.h>
-#include <stdio.h>
-#include <errno.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <limits.h>
-
-#include "xlog.h"
-#include "misc.h"
-
-/*
- * Returns a dynamically allocated, '\0'-terminated buffer
- * containing an appropriate pathname, or NULL if an error
- * occurs. Caller must free the returned result with free(3).
- */
-__attribute__((__malloc__))
-char *
-generic_make_pathname(const char *base, const char *leaf)
-{
- size_t size;
- char *path;
- int len;
-
- size = strlen(base) + strlen(leaf) + 2;
- if (size > PATH_MAX)
- return NULL;
-
- path = malloc(size);
- if (path == NULL)
- return NULL;
-
- len = snprintf(path, size, "%s/%s", base, leaf);
- if ((len < 0) || ((size_t)len >= size)) {
- free(path);
- return NULL;
- }
-
- return path;
-}
-
-
-/**
- * generic_setup_basedir - set up basedir
- * @progname: C string containing name of program, for error messages
- * @parentdir: C string containing pathname to on-disk state, or NULL
- * @base: character buffer to contain the basedir that is set up
- * @baselen: size of @base in bytes
- *
- * This runs before logging is set up, so error messages are directed
- * to stderr.
- *
- * Returns true and sets up our basedir, if @parentdir was valid
- * and usable; otherwise false is returned.
- */
-_Bool
-generic_setup_basedir(const char *progname, const char *parentdir, char *base,
- const size_t baselen)
-{
- static char buf[PATH_MAX];
- struct stat st;
- char *path;
-
- /* First: test length of name and whether it exists */
- if ((strlen(parentdir) >= baselen) || (strlen(parentdir) >= PATH_MAX)) {
- (void)fprintf(stderr, "%s: Directory name too long: %s",
- progname, parentdir);
- return false;
- }
- if (lstat(parentdir, &st) == -1) {
- (void)fprintf(stderr, "%s: Failed to stat %s: %s",
- progname, parentdir, strerror(errno));
- return false;
- }
-
- /* Ensure we have a clean directory pathname */
- strncpy(buf, parentdir, sizeof(buf)-1);
- path = dirname(buf);
- if (*path == '.') {
- (void)fprintf(stderr, "%s: Unusable directory %s",
- progname, parentdir);
- return false;
- }
-
- xlog(D_CALL, "Using %s as the state directory", parentdir);
- strcpy(base, parentdir);
- return true;
-}
diff --git a/support/misc/misc.c b/support/misc/misc.c
new file mode 100644
index 0000000..e7c3819
--- /dev/null
+++ b/support/misc/misc.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2009 Oracle. All rights reserved.
+ * Copyright 2017 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of nfs-utils.
+ *
+ * nfs-utils is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * nfs-utils is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with nfs-utils. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <sys/stat.h>
+
+#include <string.h>
+#include <libgen.h>
+#include <stdio.h>
+#include <errno.h>
+#include <dirent.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <limits.h>
+
+#include "xlog.h"
+#include "misc.h"
+
+/*
+ * Returns a dynamically allocated, '\0'-terminated buffer
+ * containing an appropriate pathname, or NULL if an error
+ * occurs. Caller must free the returned result with free(3).
+ */
+__attribute__((__malloc__))
+char *
+generic_make_pathname(const char *base, const char *leaf)
+{
+ size_t size;
+ char *path;
+ int len;
+
+ size = strlen(base) + strlen(leaf) + 2;
+ if (size > PATH_MAX)
+ return NULL;
+
+ path = malloc(size);
+ if (path == NULL)
+ return NULL;
+
+ len = snprintf(path, size, "%s/%s", base, leaf);
+ if ((len < 0) || ((size_t)len >= size)) {
+ free(path);
+ return NULL;
+ }
+
+ return path;
+}
+
+
+/**
+ * generic_setup_basedir - set up basedir
+ * @progname: C string containing name of program, for error messages
+ * @parentdir: C string containing pathname to on-disk state, or NULL
+ * @base: character buffer to contain the basedir that is set up
+ * @baselen: size of @base in bytes
+ *
+ * This runs before logging is set up, so error messages are directed
+ * to stderr.
+ *
+ * Returns true and sets up our basedir, if @parentdir was valid
+ * and usable; otherwise false is returned.
+ */
+_Bool
+generic_setup_basedir(const char *progname, const char *parentdir, char *base,
+ const size_t baselen)
+{
+ static char buf[PATH_MAX];
+ struct stat st;
+ char *path;
+
+ /* First: test length of name and whether it exists */
+ if ((strlen(parentdir) >= baselen) || (strlen(parentdir) >= PATH_MAX)) {
+ (void)fprintf(stderr, "%s: Directory name too long: %s",
+ progname, parentdir);
+ return false;
+ }
+ if (lstat(parentdir, &st) == -1) {
+ (void)fprintf(stderr, "%s: Failed to stat %s: %s",
+ progname, parentdir, strerror(errno));
+ return false;
+ }
+
+ /* Ensure we have a clean directory pathname */
+ strncpy(buf, parentdir, sizeof(buf)-1);
+ path = dirname(buf);
+ if (*path == '.') {
+ (void)fprintf(stderr, "%s: Unusable directory %s",
+ progname, parentdir);
+ return false;
+ }
+
+ xlog(D_CALL, "Using %s as the state directory", parentdir);
+ strcpy(base, parentdir);
+ return true;
+}
diff --git a/support/nsm/Makefile.am b/support/nsm/Makefile.am
index 8f5874e..68f1a46 100644
--- a/support/nsm/Makefile.am
+++ b/support/nsm/Makefile.am
@@ -10,7 +10,7 @@ GENFILES = $(GENFILES_CLNT) $(GENFILES_SVC) $(GENFILES_XDR) $(GENFILES_H)
EXTRA_DIST = sm_inter.x
noinst_LIBRARIES = libnsm.a
-libnsm_a_SOURCES = $(GENFILES) file.c rpc.c
+libnsm_a_SOURCES = $(GENFILES) ../misc/misc.c file.c rpc.c
BUILT_SOURCES = $(GENFILES)

View File

@@ -0,0 +1,36 @@
From 9efa7a0d37665d9bb0f46d2407883a5ab42c2b84 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 24 Jul 2023 20:39:16 -0700
Subject: [PATCH] locktest: Makefile.am: Do not use build flags
Using CFLAGS_FOR_BUILD etc. here means it is using wrong flags
when thse flags are speficied different than target flags which
is common when cross-building. It can pass wrong paths to linker
and it would find incompatible libraries during link since they
are from host system and target maybe not same as build host.
Fixes subtle errors like
| 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
Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=169025681008001&w=2]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tools/locktest/Makefile.am | 3 ---
1 file changed, 3 deletions(-)
diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am
index e8914655..2fd36971 100644
--- a/tools/locktest/Makefile.am
+++ b/tools/locktest/Makefile.am
@@ -2,8 +2,5 @@
noinst_PROGRAMS = testlk
testlk_SOURCES = testlk.c
-testlk_CFLAGS=$(CFLAGS_FOR_BUILD)
-testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
-testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD)
MAINTAINERCLEANFILES = Makefile.in
--
2.41.0

View File

@@ -0,0 +1,34 @@
From 45597a58e98f351b18db8444292b1cf6dd0cd810 Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Sat, 9 Dec 2023 23:34:08 -0800
Subject: [PATCH] reexport.h: Include unistd.h to compile with musl
Fixed error when compile with musl
reexport.c: In function 'reexpdb_init':
reexport.c:62:17: error: implicit declaration of function 'sleep' [-Werror=implicit-function-declaration]
62 | sleep(1);
Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=170254661824522&w=2]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
support/reexport/reexport.h | 1 +
1 files changed, 1 insertions(+)
diff --git a/support/reexport/reexport.h b/support/reexport/reexport.h
index 85fd59c..02f8684 100644
--- a/support/reexport/reexport.h
+++ b/support/reexport/reexport.h
@@ -1,6 +1,8 @@
#ifndef REEXPORT_H
#define REEXPORT_H
+#include <unistd.h>
+
#include "nfslib.h"
enum {
--
2.42.0

View File

@@ -0,0 +1,53 @@
From e2e9251dbeb452f5382179023d8ae18b511167a1 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 25 Jul 2023 23:47:08 -0700
Subject: [PATCH] tools/locktest: Use intmax_t to print off_t
off_t could be 64bit on 32bit architectures which means using %z printf
modifier is not enough to print it and compiler will complain about
format mismatch
Fixes
| testlk.c:84:66: error: format '%zd' expects argument of type 'signed size_t', but argument 4 has type '__off64_t' {aka 'long long int'} [-Werror=format=]
| 84 | printf("%s: conflicting lock by %d on (%zd;%zd)\n",
| | ~~^
| | |
| | int
| | %lld
| 85 | fname, fl.l_pid, fl.l_start, fl.l_len);
| | ~~~~~~~~~~
| | |
| | __off64_t {aka long long int}
Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=169035457128067&w=2]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tools/locktest/testlk.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/locktest/testlk.c b/tools/locktest/testlk.c
index ea51f788..9d4c88c4 100644
--- a/tools/locktest/testlk.c
+++ b/tools/locktest/testlk.c
@@ -2,6 +2,7 @@
#include <config.h>
#endif
+#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -81,8 +82,8 @@ main(int argc, char **argv)
if (fl.l_type == F_UNLCK) {
printf("%s: no conflicting lock\n", fname);
} else {
- printf("%s: conflicting lock by %d on (%zd;%zd)\n",
- fname, fl.l_pid, fl.l_start, fl.l_len);
+ printf("%s: conflicting lock by %d on (%jd;%jd)\n",
+ fname, fl.l_pid, (intmax_t)fl.l_start, (intmax_t)fl.l_len);
}
return 0;
}
--
2.41.0

View File

@@ -0,0 +1,39 @@
From 398fed3bb0350cb1229e54e7020ae0e044c206d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20=C3=96lmann?= <u.oelmann@pengutronix.de>
Date: Wed, 17 Feb 2016 08:33:45 +0100
Subject: bugfix: adjust statd service name
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream uses 'rpc-statd.service' and Yocto introduced 'nfs-statd.service'
instead but forgot to update the mount.nfs helper 'start-statd' accordingly.
Upstream-Status: Inappropriate [other]
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Rebase it.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
utils/statd/start-statd | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/utils/statd/start-statd b/utils/statd/start-statd
index af5c950..df9b9be 100755
--- a/utils/statd/start-statd
+++ b/utils/statd/start-statd
@@ -28,10 +28,10 @@ fi
# First try systemd if it's installed.
if [ -d /run/systemd/system ]; then
# Quit only if the call worked.
- if systemctl start rpc-statd.service; then
+ if systemctl start nfs-statd.service; then
# Ensure systemd knows not to stop rpc.statd or its dependencies
# on 'systemctl isolate ..'
- systemctl add-wants --runtime remote-fs.target rpc-statd.service
+ systemctl add-wants --runtime remote-fs.target nfs-statd.service
exit 0
fi
fi

View File

@@ -0,0 +1,36 @@
From 1ab0c326405c6daa06f1a7eb4b0b60bf4e0584c2 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 31 Dec 2019 08:15:34 -0800
Subject: [PATCH] Detect warning options during configure
Certain options maybe compiler specific therefore its better
to detect them before use.
nfs_error copies the format string and appends newline to it
but compiler can forget that it was format string since its not
same fmt string that was passed. Ignore the warning
Wdiscarded-qualifiers is gcc specific and this is no longer needed
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
support/nfs/xcommon.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c
index 3989f0b..e080423 100644
--- a/support/nfs/xcommon.c
+++ b/support/nfs/xcommon.c
@@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) {
fmt2 = xstrconcat2 (fmt, "\n");
va_start (args, fmt);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
vfprintf (stderr, fmt2, args);
+#pragma GCC diagnostic pop
va_end (args);
free (fmt2);
}

View File

@@ -0,0 +1,18 @@
[Unit]
Description=NFS Mount Daemon
DefaultDependencies=no
After=rpcbind.socket
Requires=proc-fs-nfsd.mount
After=proc-fs-nfsd.mount
After=network.target local-fs.target
BindsTo=nfs-server.service
ConditionPathExists=@SYSCONFDIR@/exports
[Service]
EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS
LimitNOFILE=@HIGH_RLIMIT_NOFILE@
StateDirectory=nfs
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,24 @@
[Unit]
Description=NFS server and services
DefaultDependencies=no
Requires=network.target proc-fs-nfsd.mount
Requires=nfs-mountd.service
Wants=rpcbind.service
After=local-fs.target
After=network.target proc-fs-nfsd.mount rpcbind.service nfs-mountd.service
ConditionPathExists=@SYSCONFDIR@/exports
[Service]
Type=oneshot
EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
ExecStartPre=@SBINDIR@/exportfs -r
ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT
ExecStop=@SBINDIR@/rpc.nfsd 0
ExecStopPost=@SBINDIR@/exportfs -au
ExecStopPost=@SBINDIR@/exportfs -f
ExecReload=@SBINDIR@/exportfs -r
RemainAfterExit=yes
StateDirectory=nfs
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,16 @@
[Unit]
Description=NFS status monitor for NFSv2/3 locking.
DefaultDependencies=no
Conflicts=umount.target
Requires=nss-lookup.target rpcbind.service
After=network.target nss-lookup.target rpcbind.service
ConditionPathExists=@SYSCONFDIR@/exports
[Service]
EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS
LimitNOFILE=@HIGH_RLIMIT_NOFILE@
StateDirectory=nfs
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,42 @@
[PATCH] nfs-utils: debianize start-statd
Upstream-Status: Pending
make start-statd command to use nfscommon configure, too.
Signed-off-by: Henrik Riomar <henrik.riomar@ericsson.com>
Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
utils/statd/start-statd | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/utils/statd/start-statd b/utils/statd/start-statd
index 2fd6039..f591b34 100755
--- a/utils/statd/start-statd
+++ b/utils/statd/start-statd
@@ -17,6 +17,14 @@ then
# statd already running - must have been slow to respond.
exit 0
fi
+
+# Read config
+DEFAULTFILE=/etc/default/nfs-common
+NEED_IDMAPD=
+if [ -f $DEFAULTFILE ]; then
+ . $DEFAULTFILE
+fi
+
# First try systemd if it's installed.
if [ -d /run/systemd/system ]; then
# Quit only if the call worked.
@@ -25,4 +33,4 @@ fi
cd /
# Fall back to launching it ourselves.
-exec rpc.statd --no-notify
+exec rpc.statd --no-notify $STATDOPTS
--
2.6.6

View File

@@ -0,0 +1,35 @@
# Parameters to be passed to nfs-utils (clients & server) service files.
#
# Options to pass to rpc.nfsd.
NFSD_OPTS=""
# Number of servers to start up; the default is 8 servers.
NFSD_COUNT=""
# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd".
PROCNFSD_MOUNTPOINT=""
# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid".
PROCNFSD_MOUNTOPTS=""
# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option.
MOUNTD_OPTS=""
# Parameters to be passed to nfs-common (nfs clients & server) init script.
#
# If you do not set values for the NEED_ options, they will be attempted
# autodetected; this should be sufficient for most people. Valid alternatives
# for the NEED_ options are "yes" and "no".
# Do you want to start the statd daemon? It is not needed for NFSv4.
NEED_STATD=""
# Options to pass to rpc.statd.
# N.B. statd normally runs on both client and server, and run-time
# options should be specified accordingly.
# STATD_OPTS="-p 32765 -o 32766"
STATD_OPTS=""

View File

@@ -0,0 +1,63 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: nfs-common
# Required-Start: $portmap hwclock
# Required-Stop: $portmap hwclock
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: NFS support for both client and server
# Description: NFS is a popular protocol for file sharing across
# TCP/IP networks. This service provides various
# support functions for NFS mounts.
### END INIT INFO
#
# Startup script for nfs-utils
#
#
# Location of executables:
# Source function library.
. /etc/init.d/functions
test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd
test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid
#
# The default state directory is /var/lib/nfs
test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
#
#----------------------------------------------------------------------
# Startup and shutdown functions.
# Actual startup/shutdown is at the end of this file.
start_statd(){
echo -n "starting statd: "
start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"
echo done
}
stop_statd(){
echo -n 'stopping statd: '
start-stop-daemon --stop --quiet --signal 1 --pidfile "$STATD_PID"
echo done
}
#----------------------------------------------------------------------
#
# supported options:
# start
# stop
# restart: stops and starts mountd
#FIXME: need to create the /var/lib/nfs/... directories
case "$1" in
start)
start_statd;;
stop)
stop_statd;;
status)
status $NFS_STATD
exit $?;;
restart)
$0 stop
$0 start;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1;;
esac

View File

@@ -0,0 +1,110 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: nfs-kernel-server
# Required-Start: $remote_fs nfs-common $portmap hwclock
# Required-Stop: $remote_fs nfs-common $portmap hwclock
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Kernel NFS server support
# Description: NFS is a popular protocol for file sharing across
# TCP/IP networks. This service provides NFS server
# functionality, which is configured via the
# /etc/exports file.
### END INIT INFO
#
# Startup script for nfs-utils
#
# Source function library.
. /etc/init.d/functions
#
# The environment variable NFS_SERVERS may be set in /etc/default/nfsd
# Other control variables may be overridden here too
test -r /etc/default/nfsd && . /etc/default/nfsd
#
# Location of executables:
test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd
test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd
#
# The user mode program must also exist (it just starts the kernel
# threads using the kernel module code).
test -x "$NFS_MOUNTD" || exit 0
test -x "$NFS_NFSD" || exit 0
#
# Default is 8 threads, value is settable between 1 and the truely
# ridiculous 99
test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8
#
#----------------------------------------------------------------------
# Startup and shutdown functions.
# Actual startup/shutdown is at the end of this file.
#mountd
start_mountd(){
echo -n 'starting mountd: '
start-stop-daemon --start --exec "$NFS_MOUNTD" -- "$@"
echo done
}
stop_mountd(){
echo -n 'stopping mountd: '
start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD"
echo done
}
#
#nfsd
start_nfsd(){
modprobe -q nfsd
grep -q nfsd /proc/filesystems || {
echo NFS daemon support not enabled in kernel
exit 1
}
grep -q nfsd /proc/mounts || mount -t nfsd nfsd /proc/fs/nfsd
grep -q nfsd /proc/mounts || {
echo nfsd filesystem could not be mounted at /proc/fs/nfsd
exit 1
}
echo -n "starting $1 nfsd kernel threads: "
start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
echo done
}
stop_nfsd(){
echo -n 'stopping nfsd: '
$NFS_NFSD 0
if pidof nfsd
then
echo failed
else
echo done
fi
}
#----------------------------------------------------------------------
#
# supported options:
# start
# stop
# reload: reloads the exports file
# restart: stops and starts mountd
#FIXME: need to create the /var/lib/nfs/... directories
case "$1" in
start)
test -r /etc/exports && exportfs -r
start_nfsd "$NFS_SERVERS"
start_mountd
test -r /etc/exports && exportfs -a;;
stop) exportfs -ua
stop_mountd
stop_nfsd;;
status)
status /usr/sbin/rpc.mountd
RETVAL=$?
status nfsd
rval=$?
[ $RETVAL -eq 0 ] && exit $rval
exit $RETVAL;;
reload) test -r /etc/exports && exportfs -r;;
restart)
$0 stop
$0 start;;
*) echo "Usage: $0 {start|stop|status|reload|restart}"
exit 1;;
esac

View File

@@ -0,0 +1,8 @@
[Unit]
Description=NFSD configuration filesystem
After=systemd-modules-load.service
[Mount]
What=nfsd
Where=/proc/fs/nfsd
Type=nfsd

View File

@@ -0,0 +1,154 @@
SUMMARY = "userspace utilities for kernel nfs"
DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \
NFS server and related tools."
HOMEPAGE = "http://nfs.sourceforge.net/"
SECTION = "console/network"
LICENSE = "MIT & GPL-2.0-or-later & BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
# util-linux for libblkid
DEPENDS = "libcap libevent util-linux sqlite3 libtirpc"
RDEPENDS:${PN} = "${PN}-client"
RRECOMMENDS:${PN} = "kernel-module-nfsd"
inherit useradd
USERADD_PACKAGES = "${PN}-client"
USERADD_PARAM:${PN}-client = "--system --home-dir /var/lib/nfs \
--shell /bin/false --user-group rpcuser"
SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
file://nfsserver \
file://nfscommon \
file://nfs-utils.conf \
file://nfs-server.service \
file://nfs-mountd.service \
file://nfs-statd.service \
file://proc-fs-nfsd.mount \
file://nfs-utils-debianize-start-statd.patch \
file://bugfix-adjust-statd-service-name.patch \
file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \
file://clang-warnings.patch \
file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \
file://0001-tools-locktest-Use-intmax_t-to-print-off_t.patch \
file://0001-reexport.h-Include-unistd.h-to-compile-with-musl.patch \
"
SRC_URI[sha256sum] = "01b3b0fb9c7d0bbabf5114c736542030748c788ec2fd9734744201e9b0a1119d"
# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
# pull in the remainder of the dependencies.
INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
INITSCRIPT_NAME = "nfsserver"
INITSCRIPT_PARAMS = "defaults"
INITSCRIPT_NAME:${PN}-client = "nfscommon"
INITSCRIPT_PARAMS:${PN}-client = "defaults 19 21"
inherit autotools-brokensep update-rc.d systemd pkgconfig
SYSTEMD_PACKAGES = "${PN} ${PN}-client"
SYSTEMD_SERVICE:${PN} = "nfs-server.service nfs-mountd.service"
SYSTEMD_SERVICE:${PN}-client = "nfs-statd.service"
# --enable-uuid is need for cross-compiling
EXTRA_OECONF = "--with-statduser=rpcuser \
--enable-mountconfig \
--enable-libmount-mount \
--enable-uuid \
--disable-gss \
--disable-nfsdcltrack \
--with-statdpath=/var/lib/nfs/statd \
--with-rpcgen=${HOSTTOOLS_DIR}/rpcgen \
"
LDFLAGS:append = " -lsqlite3 -levent"
PACKAGECONFIG ??= "tcp-wrappers \
${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
"
PACKAGECONFIG:remove:libc-musl = "tcp-wrappers"
PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
# libdevmapper is available in meta-oe
PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmapper"
# keyutils is available in meta-oe
PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils,python3-core"
PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats ${PN}-rpcctl"
CONFFILES:${PN}-client += "${localstatedir}/lib/nfs/etab \
${localstatedir}/lib/nfs/rmtab \
${localstatedir}/lib/nfs/xtab \
${localstatedir}/lib/nfs/statd/state \
${sysconfdir}/nfsmount.conf"
FILES:${PN}-client = "${sbindir}/*statd \
${libdir}/libnfsidmap.so.* \
${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
${sbindir}/showmount ${sbindir}/nfsstat \
${localstatedir}/lib/nfs \
${sysconfdir}/nfs-utils.conf \
${sysconfdir}/nfsmount.conf \
${sysconfdir}/init.d/nfscommon \
${systemd_system_unitdir}/nfs-statd.service"
RDEPENDS:${PN}-client = "${PN}-mount rpcbind"
FILES:${PN}-mount = "${base_sbindir}/*mount.nfs*"
FILES:${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat ${sbindir}/nfsdclnts"
RDEPENDS:${PN}-stats = "python3-core"
FILES:${PN}-rpcctl = "${sbindir}/rpcctl"
RDEPENDS:${PN}-rpcctl = "python3-core"
FILES:${PN}-staticdev += "${libdir}/libnfsidmap/*.a"
FILES:${PN} += "${systemd_unitdir} ${libdir}/libnfsidmap/ ${nonarch_libdir}/modprobe.d"
do_configure:prepend() {
sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
${S}/utils/mount/Makefile.am
}
# Make clean needed because the package comes with
# precompiled 64-bit objects that break the build
do_compile:prepend() {
make clean
}
# Works on systemd only
HIGH_RLIMIT_NOFILE ??= "4096"
do_install:append () {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_system_unitdir}/
install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_system_unitdir}/
install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_system_unitdir}/
sed -i -e 's,@SBINDIR@,${sbindir},g' \
-e 's,@SYSCONFDIR@,${sysconfdir},g' \
-e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},g' \
${D}${systemd_system_unitdir}/*.service
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_system_unitdir}/
install -d ${D}${systemd_system_unitdir}/sysinit.target.wants/
ln -sf ../proc-fs-nfsd.mount ${D}${systemd_system_unitdir}/sysinit.target.wants/proc-fs-nfsd.mount
fi
# kernel code as of 3.8 hard-codes this path as a default
install -d ${D}/var/lib/nfs/v4recovery
# chown the directories and files
chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
# Make python tools use python 3
sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
}