summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity
diff options
context:
space:
mode:
authorDaniel McGregor <daniel.mcgregor@vecima.com>2025-02-12 13:12:30 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-02-18 11:56:03 +0000
commitcabf7967090b5ada070473c9beeecd016e04d362 (patch)
tree76b1f54e0fef8a2572713a50f921b3bdc1ed0da4 /meta/recipes-connectivity
parent5d9a26dfb6a9594a8a268e6e91cc48e841b294ff (diff)
downloadpoky-cabf7967090b5ada070473c9beeecd016e04d362.tar.gz
nfs-utils: Use upstream systemd service files
Reduce diffs against upstream by using the service files provided by them. This reduces our dependence on patches that simply change the names of a service. This also changes the way some nfs options get set for systemd, it introduces the nfs.conf file for configuration, which all daemons already support. (From OE-Core rev: eeab3fa1423d499f9b39fda7a7514e619a3ac010) Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity')
-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/nfs-mountd.service18
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service24
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service16
-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/proc-fs-nfsd.mount8
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb33
8 files changed, 11 insertions, 204 deletions
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/nfs-mountd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
deleted file mode 100644
index ebfe64b9ce..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
+++ /dev/null
@@ -1,18 +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@
15StateDirectory=nfs
16
17[Install]
18WantedBy=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 15ceee04d0..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
+++ /dev/null
@@ -1,24 +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
21StateDirectory=nfs
22
23[Install]
24WantedBy=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 b519194121..0000000000
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
+++ /dev/null
@@ -1,16 +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
7ConditionPathExists=@SYSCONFDIR@/exports
8
9[Service]
10EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
11ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS
12LimitNOFILE=@HIGH_RLIMIT_NOFILE@
13StateDirectory=nfs
14
15[Install]
16WantedBy=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/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.8.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb
index df9c95a71f..f07ed2040a 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb
@@ -21,13 +21,6 @@ USERADD_PARAM:${PN}-client = "--system --home-dir /var/lib/nfs \
21SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \ 21SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
22 file://nfsserver \ 22 file://nfsserver \
23 file://nfscommon \ 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 \ 24 file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \
32 file://clang-warnings.patch \ 25 file://clang-warnings.patch \
33 file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \ 26 file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \
@@ -48,8 +41,8 @@ INITSCRIPT_PARAMS:${PN}-client = "defaults 19 21"
48inherit autotools-brokensep update-rc.d systemd pkgconfig 41inherit autotools-brokensep update-rc.d systemd pkgconfig
49 42
50SYSTEMD_PACKAGES = "${PN} ${PN}-client" 43SYSTEMD_PACKAGES = "${PN} ${PN}-client"
51SYSTEMD_SERVICE:${PN} = "nfs-server.service nfs-mountd.service" 44SYSTEMD_SERVICE:${PN} = "nfs-server.service"
52SYSTEMD_SERVICE:${PN}-client = "nfs-statd.service" 45SYSTEMD_SERVICE:${PN}-client = "nfs-client.target"
53 46
54# --enable-uuid is need for cross-compiling 47# --enable-uuid is need for cross-compiling
55EXTRA_OECONF = "--with-statduser=rpcuser \ 48EXTRA_OECONF = "--with-statduser=rpcuser \
@@ -65,7 +58,7 @@ EXTRA_OECONF = "--with-statduser=rpcuser \
65LDFLAGS += "-lsqlite3 -levent" 58LDFLAGS += "-lsqlite3 -levent"
66 59
67PACKAGECONFIG ??= "tcp-wrappers \ 60PACKAGECONFIG ??= "tcp-wrappers \
68 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ 61 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \
69" 62"
70PACKAGECONFIG:remove:libc-musl = "tcp-wrappers" 63PACKAGECONFIG:remove:libc-musl = "tcp-wrappers"
71PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers" 64PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
@@ -75,6 +68,7 @@ PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmap
75# keyutils is available in meta-oe 68# keyutils is available in meta-oe
76PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils,python3-core" 69PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils,python3-core"
77PACKAGECONFIG[nfsdctl] = "--enable-nfsdctl,--disable-nfsdctl,libnl readline," 70PACKAGECONFIG[nfsdctl] = "--enable-nfsdctl,--disable-nfsdctl,libnl readline,"
71PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd"
78 72
79PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats ${PN}-rpcctl" 73PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats ${PN}-rpcctl"
80 74
@@ -82,14 +76,16 @@ CONFFILES:${PN}-client += "${localstatedir}/lib/nfs/etab \
82 ${localstatedir}/lib/nfs/rmtab \ 76 ${localstatedir}/lib/nfs/rmtab \
83 ${localstatedir}/lib/nfs/xtab \ 77 ${localstatedir}/lib/nfs/xtab \
84 ${localstatedir}/lib/nfs/statd/state \ 78 ${localstatedir}/lib/nfs/statd/state \
79 ${sysconfdir}/nfs.conf \
85 ${sysconfdir}/nfsmount.conf" 80 ${sysconfdir}/nfsmount.conf"
86 81
87FILES:${PN}-client = "${sbindir}/*statd \ 82FILES:${PN}-client = "${sbindir}/*statd \
88 ${libdir}/libnfsidmap.so.* \ 83 ${libdir}/libnfsidmap.so.* \
89 ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \ 84 ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
90 ${sbindir}/showmount ${sbindir}/nfsstat \ 85 ${sbindir}/showmount ${sbindir}/nfsstat \
86 ${sbindir}/nfsconf \
91 ${localstatedir}/lib/nfs \ 87 ${localstatedir}/lib/nfs \
92 ${sysconfdir}/nfs-utils.conf \ 88 ${sysconfdir}/nfs.conf \
93 ${sysconfdir}/nfsmount.conf \ 89 ${sysconfdir}/nfsmount.conf \
94 ${sysconfdir}/init.d/nfscommon \ 90 ${sysconfdir}/init.d/nfscommon \
95 ${systemd_system_unitdir}/nfs-statd.service" 91 ${systemd_system_unitdir}/nfs-statd.service"
@@ -109,7 +105,7 @@ FILES:${PN} += "${systemd_unitdir} ${libdir}/libnfsidmap/ ${nonarch_libdir}/modp
109 105
110do_configure:prepend() { 106do_configure:prepend() {
111 sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \ 107 sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
112 ${S}/utils/mount/Makefile.am 108 ${S}/utils/mount/Makefile.am ${S}/utils/nfsdcltrack/Makefile.am
113} 109}
114 110
115# Make clean needed because the package comes with 111# Make clean needed because the package comes with
@@ -126,18 +122,11 @@ do_install:append () {
126 install -m 0755 ${UNPACKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver 122 install -m 0755 ${UNPACKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
127 install -m 0755 ${UNPACKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon 123 install -m 0755 ${UNPACKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
128 124
129 install -m 0755 ${UNPACKDIR}/nfs-utils.conf ${D}${sysconfdir} 125 install -m 0644 ${S}/nfs.conf ${D}${sysconfdir}
130 install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
131 126
132 install -d ${D}${systemd_system_unitdir} 127 install -d ${D}${systemd_system_unitdir}
133 install -m 0644 ${UNPACKDIR}/nfs-server.service ${D}${systemd_system_unitdir}/ 128 # Retain historical service name so old scripts keep working
134 install -m 0644 ${UNPACKDIR}/nfs-mountd.service ${D}${systemd_system_unitdir}/ 129 ln -s rpc-statd.service ${D}${systemd_system_unitdir}/nfs-statd.service
135 install -m 0644 ${UNPACKDIR}/nfs-statd.service ${D}${systemd_system_unitdir}/
136 install -m 0644 ${UNPACKDIR}/proc-fs-nfsd.mount ${D}${systemd_system_unitdir}/
137 sed -i -e 's,@SBINDIR@,${sbindir},g' \
138 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
139 -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},g' \
140 ${D}${systemd_system_unitdir}/*.service
141 # Add compatibility symlinks for the sysvinit scripts 130 # Add compatibility symlinks for the sysvinit scripts
142 ln -s nfs-server.service ${D}${systemd_system_unitdir}/nfsserver.service 131 ln -s nfs-server.service ${D}${systemd_system_unitdir}/nfsserver.service
143 ln -s /dev/null ${D}${systemd_system_unitdir}/nfscommon.service 132 ln -s /dev/null ${D}${systemd_system_unitdir}/nfscommon.service