diff options
5 files changed, 95 insertions, 2 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service new file mode 100644 index 0000000000..613ddc003a --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=NFS Mount Daemon | ||
| 3 | After=rpcbind.service nfs-server.service | ||
| 4 | Requires=rpcbind.service nfs-server.service | ||
| 5 | |||
| 6 | [Service] | ||
| 7 | EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf | ||
| 8 | ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS | ||
| 9 | |||
| 10 | [Install] | ||
| 11 | WantedBy=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 new file mode 100644 index 0000000000..147d7a7b5f --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=NFS Server | ||
| 3 | Requires=rpcbind.service nfs-mountd.service | ||
| 4 | After=rpcbind.service | ||
| 5 | |||
| 6 | [Service] | ||
| 7 | Type=oneshot | ||
| 8 | EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf | ||
| 9 | ExecStartPre=@SBINDIR@/exportfs -r | ||
| 10 | ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT | ||
| 11 | ExecStop=@SBINDIR@/rpc.nfsd 0 | ||
| 12 | ExecStopPost=@SBINDIR@/exportfs -f | ||
| 13 | ExecReload=@SBINDIR@/exportfs -r | ||
| 14 | StandardError=syslog | ||
| 15 | RemainAfterExit=yes | ||
| 16 | |||
| 17 | [Install] | ||
| 18 | WantedBy=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 new file mode 100644 index 0000000000..746dacf056 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=NFS file locking service | ||
| 3 | After=rpcbind.service | ||
| 4 | Requires=rpcbind.service | ||
| 5 | Before=remote-fs-pre.target | ||
| 6 | |||
| 7 | [Service] | ||
| 8 | EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf | ||
| 9 | ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS | ||
| 10 | |||
| 11 | [Install] | ||
| 12 | WantedBy=multi-user.target | ||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf new file mode 100644 index 0000000000..a1007a7fbf --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | # Parameters to be passed to nfs-utils (clients & server) service files. | ||
| 2 | # | ||
| 3 | |||
| 4 | # Options to pass to rpc.nfsd. | ||
| 5 | NFSD_OPTS="" | ||
| 6 | |||
| 7 | # Number of servers to start up; the default is 8 servers. | ||
| 8 | NFSD_COUNT="" | ||
| 9 | |||
| 10 | # Where to mount nfsd filesystem; the default is "/proc/fs/nfsd". | ||
| 11 | PROCNFSD_MOUNTPOINT="" | ||
| 12 | |||
| 13 | # Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid". | ||
| 14 | PROCNFSD_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. | ||
| 19 | MOUNTD_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. | ||
| 29 | NEED_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" | ||
| 35 | STATD_OPTS="" | ||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.8.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.8.bb index fd6d33efd7..e3e8136c27 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.8.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.8.bb | |||
| @@ -15,7 +15,11 @@ RRECOMMENDS_${PN} = "kernel-module-nfsd" | |||
| 15 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.bz2 \ | 15 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.bz2 \ |
| 16 | file://nfs-utils-1.0.6-uclibc.patch \ | 16 | file://nfs-utils-1.0.6-uclibc.patch \ |
| 17 | file://nfs-utils-1.2.3-sm-notify-res_init.patch \ | 17 | file://nfs-utils-1.2.3-sm-notify-res_init.patch \ |
| 18 | file://nfsserver" | 18 | file://nfsserver \ |
| 19 | file://nfs-utils.conf \ | ||
| 20 | file://nfs-server.service \ | ||
| 21 | file://nfs-mountd.service \ | ||
| 22 | file://nfs-statd.service " | ||
| 19 | 23 | ||
| 20 | SRC_URI[md5sum] = "6e7d97de51e428a0b8698c16ca23db77" | 24 | SRC_URI[md5sum] = "6e7d97de51e428a0b8698c16ca23db77" |
| 21 | SRC_URI[sha256sum] = "1cc8f02a633eddbf0a1d93421f331479c4cdab4c5ab33b8bf8c7c369f9156ac6" | 25 | SRC_URI[sha256sum] = "1cc8f02a633eddbf0a1d93421f331479c4cdab4c5ab33b8bf8c7c369f9156ac6" |
| @@ -31,7 +35,10 @@ INITSCRIPT_NAME = "nfsserver" | |||
| 31 | # in the shutdown levels, but that works fine. | 35 | # in the shutdown levels, but that works fine. |
| 32 | INITSCRIPT_PARAMS = "defaults" | 36 | INITSCRIPT_PARAMS = "defaults" |
| 33 | 37 | ||
| 34 | inherit autotools update-rc.d | 38 | inherit autotools update-rc.d systemd |
| 39 | |||
| 40 | SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service nfs-statd.service" | ||
| 41 | SYSTEMD_AUTO_ENABLE = "disable" | ||
| 35 | 42 | ||
| 36 | # --enable-uuid is need for cross-compiling | 43 | # --enable-uuid is need for cross-compiling |
| 37 | EXTRA_OECONF = "--with-statduser=nobody \ | 44 | EXTRA_OECONF = "--with-statduser=nobody \ |
| @@ -65,6 +72,16 @@ do_install_append () { | |||
| 65 | install -d ${D}${sysconfdir}/init.d | 72 | install -d ${D}${sysconfdir}/init.d |
| 66 | install -d ${D}${localstatedir}/lib/nfs/statd | 73 | install -d ${D}${localstatedir}/lib/nfs/statd |
| 67 | install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver | 74 | install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver |
| 75 | |||
| 76 | install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir} | ||
| 77 | install -d ${D}${systemd_unitdir}/system | ||
| 78 | install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/ | ||
| 79 | install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/ | ||
| 80 | install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/ | ||
| 81 | sed -i -e 's,@SBINDIR@,${sbindir},g' \ | ||
| 82 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ | ||
| 83 | ${D}${systemd_unitdir}/system/*.service | ||
| 84 | |||
| 68 | # kernel code as of 3.8 hard-codes this path as a default | 85 | # kernel code as of 3.8 hard-codes this path as a default |
| 69 | install -d ${D}/var/lib/nfs/v4recovery | 86 | install -d ${D}/var/lib/nfs/v4recovery |
| 70 | 87 | ||
