summaryrefslogtreecommitdiffstats
path: root/package/nfs-utils/nfs-utils.mk
diff options
context:
space:
mode:
authorAurélien Chabot <aurelien@chabot.fr>2015-10-03 21:29:09 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-10-04 17:49:00 +0100
commit9b19438c2c0a89fe4da757571604a7ca2fe0663b (patch)
treedbeda4c9803150e0b782438fa5aa46fd3d4b8811 /package/nfs-utils/nfs-utils.mk
parent9bd4ee8e66dbc644b580f06ccc9ce339a98a73a8 (diff)
downloadbuildroot-9b19438c2c0a89fe4da757571604a7ca2fe0663b.tar.gz
buildroot-9b19438c2c0a89fe4da757571604a7ca2fe0663b.zip
nfs-utils: systemd support
nfs-utils has been patched to install only the needed systemd unit files supported. Also tmpfiles was needed because the folder /run/nfs is a tmpfs and nfs-utils need some files to be there to work correctly. Signed-off-by: Aurélien Chabot <aurelien@chabot.fr> [Maxime: Remove patches included originally in the patch as they have have been merged upstream in v1.3.3] Signed-off-by Maxime Hadjinlian <maxime.hadjinlian@gmail.com> [Thomas: - add comment in nfs-utils_env.sh to explain why an empty script is needed. - remove incorrect indentation.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/nfs-utils/nfs-utils.mk')
-rw-r--r--package/nfs-utils/nfs-utils.mk27
1 files changed, 27 insertions, 0 deletions
diff --git a/package/nfs-utils/nfs-utils.mk b/package/nfs-utils/nfs-utils.mk
index 8c06d8eab5..30f12fd445 100644
--- a/package/nfs-utils/nfs-utils.mk
+++ b/package/nfs-utils/nfs-utils.mk
@@ -41,11 +41,38 @@ define NFS_UTILS_INSTALL_FIXUP
endef
NFS_UTILS_POST_INSTALL_TARGET_HOOKS += NFS_UTILS_INSTALL_FIXUP
+ifeq ($(BR2_INIT_SYSTEMD),y)
+NFS_UTILS_CONF_OPTS += --with-systemd=/usr/lib/systemd/system
+NFS_UTILS_DEPENDENCIES += systemd
+else
+NFS_UTILS_CONF_OPTS += --without-systemd
+endif
+
define NFS_UTILS_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/nfs-utils/S60nfs \
$(TARGET_DIR)/etc/init.d/S60nfs
endef
+define NFS_UTILS_INSTALL_INIT_SYSTEMD
+ mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+
+ ln -fs ../../../../usr/lib/systemd/system/nfs-server.service \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-server.service
+ ln -fs ../../../../usr/lib/systemd/system/nfs-client.target \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-client.target
+
+ mkdir -p $(TARGET_DIR)/etc/systemd/system/remote-fs.target.wants
+
+ ln -fs ../../../../usr/lib/systemd/system/nfs-client.target \
+ $(TARGET_DIR)/etc/systemd/system/remote-fs.target.wants/nfs-client.target
+
+ $(INSTALL) -D -m 0755 package/nfs-utils/nfs-utils_env.sh \
+ $(TARGET_DIR)/usr/lib/systemd/scripts/nfs-utils_env.sh
+
+ $(INSTALL) -D -m 0644 package/nfs-utils/nfs-utils_tmpfiles.conf \
+ $(TARGET_DIR)/usr/lib/tmpfiles.d/nfs-utils.conf
+endef
+
define NFS_UTILS_REMOVE_NFSIOSTAT
rm -f $(TARGET_DIR)/usr/sbin/nfsiostat
endef
OpenPOWER on IntegriCloud