summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2015-07-08 16:52:45 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-09 16:37:43 -0700
commit2f2b0e84282035be4e80a4a9dabbd511f4e0abc6 (patch)
treebf9bc56a9a03df28d915f1e7a2eda9a37043127b /meta
parentc9f56848e0efd1fe5daa0fac8ce8fa5b84c61e78 (diff)
downloadast2050-yocto-poky-2f2b0e84282035be4e80a4a9dabbd511f4e0abc6.zip
ast2050-yocto-poky-2f2b0e84282035be4e80a4a9dabbd511f4e0abc6.tar.gz
nfs-utils: fix to start nfs-server correctly in systemd
Add /etc/modules-load.d/nfsd.conf so that the system loads nfsd at start-up. Add proc-fs-nfsd.mount systemd unit file because it's needed for nfs server to start correctly. After this change, in a systemd based image, we can use `systemctl start nfs-server' to start the nfs server and things would work correctly. (From OE-Core rev: 3d4380bb36eb108dc75fee7215b615f7800b0990) (From OE-Core rev: 27633405aa3509c207d986b434d430f2cd380541) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount8
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb10
2 files changed, 18 insertions, 0 deletions
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
new file mode 100644
index 0000000..630801b
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
@@ -0,0 +1,8 @@
+[Unit]
+Description=NFSD configuration filesystem
+After=systemd-modules-load.service
+
+[Mount]
+What=nfsd
+Where=/proc/fs/nfsd
+Type=nfsd
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
index 6f64e9d..f7b4551 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
@@ -28,6 +28,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
file://nfs-server.service \
file://nfs-mountd.service \
file://nfs-statd.service \
+ file://proc-fs-nfsd.mount \
file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
"
@@ -86,6 +87,8 @@ FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \
FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
RDEPENDS_${PN}-stats = "python"
+FILES_${PN} += "${systemd_unitdir}"
+
# Make clean needed because the package comes with
# precompiled 64-bit objects that break the build
do_compile_prepend() {
@@ -107,6 +110,13 @@ do_install_append () {
sed -i -e 's,@SBINDIR@,${sbindir},g' \
-e 's,@SYSCONFDIR@,${sysconfdir},g' \
${D}${systemd_unitdir}/system/*.service
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${sysconfdir}/modules-load.d
+ echo "nfsd" > ${D}${sysconfdir}/modules-load.d/nfsd.conf
+ install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
+ install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
+ ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/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
OpenPOWER on IntegriCloud