Skip to contentSkip to conversation

package/nfs-utils: fix unnecessary files removal

PATCH New Angelo Compagnucci 3 participants 5 messages Apr 28, 2019 – May 10, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 package/nfs-utils: fix unnecessary files removal

Removing of unnecessary files is actually broken by the fact that the rm command is executed inside build directory and not the target directory.

This patch fixes the problem changing to target directory before removing files.

---
v3->v4: separate fix patch as requested by Arnout

 package/nfs-utils/nfs-utils.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/nfs-utils/nfs-utils.mk +1 -1
index 9fa7ae2..4bb62de 100644
@@ -57,7 +57,7 @@ NFS_UTILS_CONF_OPTS += --disable-tirpc
 endif
 
 define NFS_UTILS_INSTALL_FIXUP
-	rm -f $(NFS_UTILS_TARGETS_)
+	cd $(TARGET_DIR) && rm -f $(NFS_UTILS_TARGETS_)
 	touch $(TARGET_DIR)/etc/exports
 	$(INSTALL) -D -m 644 \
 		$(@D)/utils/mount/nfsmount.conf $(TARGET_DIR)/etc/nfsmount.conf
Signature · 1 line
2.7.4
#1 lore raw

PATCH v4 2/2 package/nfs-utils: making nfs server optional

This patch makes nfs server component optional. This is useful when only client tools are needed instead of the full nfs server.

---
v1->v2: Fixing minor formatting nitpick.
v2->v3: Fixing systemd stuff as suggested by Thomas
v3->v4: Added conditional define for nfs unit file as requested by Arnout

 package/nfs-utils/Config.in    |  6 ++++++
 package/nfs-utils/nfs-utils.mk | 13 +++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
package/nfs-utils/Config.in +6 -0
index 055b711..04ea4db 100644
@@ -25,6 +25,12 @@ config BR2_PACKAGE_NFS_UTILS_RPC_LOCKD
 	help
 	  NFS lock manager for Linux kernels older than 2.4
 
+config BR2_PACKAGE_NFS_UTILS_RPC_NFSD
+	bool "rpc.nfsd"
+	default y
+	help
+	  NFS server
+
 config BR2_PACKAGE_NFS_UTILS_RPC_RQUOTAD
 	bool "rpc.rquotad"
 	help
package/nfs-utils/nfs-utils.mk +11 -2
index 4bb62de..b81891a 100644
@@ -41,6 +41,8 @@ HOST_NFS_UTILS_DEPENDENCIES = host-pkgconf host-libtirpc
 NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPCDEBUG) += usr/sbin/rpcdebug
 NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_LOCKD) += usr/sbin/rpc.lockd
 NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_RQUOTAD) += usr/sbin/rpc.rquotad
+NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_NFSD) += usr/sbin/exportfs \
+	usr/sbin/rpc.mountd usr/sbin/rpc.nfsd usr/lib/systemd/system/nfs-server.service
 
 ifeq ($(BR2_PACKAGE_LIBCAP),y)
 NFS_UTILS_CONF_OPTS += --enable-caps
@@ -71,16 +73,23 @@ else
 NFS_UTILS_CONF_OPTS += --without-systemd
 endif
 
+ifeq ($(BR2_PACKAGE_NFS_UTILS_RPC_NFSD),y)
 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_NFSD
+	ln -fs ../../../../usr/lib/systemd/system/nfs-server.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-server.service
+endef
+endif
+
 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
+	$(NFS_UTILS_INSTALL_INIT_SYSTEMD_NFSD)
+
 	ln -fs ../../../../usr/lib/systemd/system/nfs-client.target \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-client.target
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH v4 2/2 package/nfs-utils: making nfs server optional

Quoted 4 lines · Angelo Compagnucci

This patch makes nfs server component optional. This is useful when only client tools are needed instead of the full nfs server.

Applied to master, thanks.

Regards,
Arnout

#3 lore raw

PATCH v4 1/2 package/nfs-utils: fix unnecessary files removal

In reply to Angelo Compagnucci
Quoted 18 lines · Angelo Compagnucci

Removing of unnecessary files is actually broken by the fact that the rm command is executed inside build directory and not the target directory.

This patch fixes the problem changing to target directory before removing files.

---
v3->v4: separate fix patch as requested by Arnout

 package/nfs-utils/nfs-utils.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/nfs-utils/nfs-utils.mk +0 -0
index 9fa7ae2..4bb62de 100644

package/nfs-utils/nfs-utils.mk NFS_UTILS_CONF_OPTS += --disable-tirpc · line 60

Quoted 5 lines
package/nfs-utils/nfs-utils.mk +1 -1
@@ -57,7 +57,7 @@ NFS_UTILS_CONF_OPTS += --disable-tirpc
 endif
 
 define NFS_UTILS_INSTALL_FIXUP
-	rm -f $(NFS_UTILS_TARGETS_)
+	cd $(TARGET_DIR) && rm -f $(NFS_UTILS_TARGETS_)

Personally, I'd have used $(addprefix) instead of cd, but that's just my own
thing, so: applied to master, thanks.

Regards,
Arnout

Quoted 4 lines
package/nfs-utils/nfs-utils.mk +0 -0
 	touch $(TARGET_DIR)/etc/exports
 	$(INSTALL) -D -m 644 \
 		$(@D)/utils/mount/nfsmount.conf $(TARGET_DIR)/etc/nfsmount.conf
#4 lore raw

PATCH v4 1/2 package/nfs-utils: fix unnecessary files removal

In reply to Angelo Compagnucci
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Angelo" == Angelo Compagnucci <[email protected]> writes:

Removing of unnecessary files is actually broken by the fact that the rm command is executed inside build directory and not the target directory.

This patch fixes the problem changing to target directory before removing files.

---
v3-> v4: separate fix patch as requested by Arnout

Committed to 2019.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard