nfs-utils: Add systemd support

- Remove dependency on meta-systemd

(From OE-Core rev: 644394c074c359505fcd750356fb4db58b939729)

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Muhammad Shakeel 2013-09-04 11:05:02 +00:00 committed by Richard Purdie
parent 06ecd689ae
commit 703104c278
5 changed files with 95 additions and 2 deletions

View File

@ -0,0 +1,11 @@
[Unit]
Description=NFS Mount Daemon
After=rpcbind.service nfs-server.service
Requires=rpcbind.service nfs-server.service
[Service]
EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,18 @@
[Unit]
Description=NFS Server
Requires=rpcbind.service nfs-mountd.service
After=rpcbind.service
[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 -f
ExecReload=@SBINDIR@/exportfs -r
StandardError=syslog
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,12 @@
[Unit]
Description=NFS file locking service
After=rpcbind.service
Requires=rpcbind.service
Before=remote-fs-pre.target
[Service]
EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS
[Install]
WantedBy=multi-user.target

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

@ -15,7 +15,11 @@ RRECOMMENDS_${PN} = "kernel-module-nfsd"
SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.bz2 \
file://nfs-utils-1.0.6-uclibc.patch \
file://nfs-utils-1.2.3-sm-notify-res_init.patch \
file://nfsserver"
file://nfsserver \
file://nfs-utils.conf \
file://nfs-server.service \
file://nfs-mountd.service \
file://nfs-statd.service "
SRC_URI[md5sum] = "6e7d97de51e428a0b8698c16ca23db77"
SRC_URI[sha256sum] = "1cc8f02a633eddbf0a1d93421f331479c4cdab4c5ab33b8bf8c7c369f9156ac6"
@ -31,7 +35,10 @@ INITSCRIPT_NAME = "nfsserver"
# in the shutdown levels, but that works fine.
INITSCRIPT_PARAMS = "defaults"
inherit autotools update-rc.d
inherit autotools update-rc.d systemd
SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service nfs-statd.service"
SYSTEMD_AUTO_ENABLE = "disable"
# --enable-uuid is need for cross-compiling
EXTRA_OECONF = "--with-statduser=nobody \
@ -65,6 +72,16 @@ do_install_append () {
install -d ${D}${sysconfdir}/init.d
install -d ${D}${localstatedir}/lib/nfs/statd
install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
sed -i -e 's,@SBINDIR@,${sbindir},g' \
-e 's,@SYSCONFDIR@,${sysconfdir},g' \
${D}${systemd_unitdir}/system/*.service
# kernel code as of 3.8 hard-codes this path as a default
install -d ${D}/var/lib/nfs/v4recovery