diff mbox series

[v2] package/nfs-utils: making nfs server optional

Message ID 1553781189-15924-1-git-send-email-angelo@amarulasolutions.com
State Changes Requested
Headers show
Series [v2] package/nfs-utils: making nfs server optional | expand

Commit Message

Angelo Compagnucci March 28, 2019, 1:53 p.m. UTC
This patch makes nfs server component optional. This is useful when
only client tools are used and not the nfs server.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
v1->v2: Fixing minor formatting nitpick.

 package/nfs-utils/Config.in    | 6 ++++++
 package/nfs-utils/nfs-utils.mk | 2 ++
 2 files changed, 8 insertions(+)

Comments

Thomas Petazzoni March 28, 2019, 4:48 p.m. UTC | #1
Hello Angelo,

On Thu, 28 Mar 2019 14:53:09 +0100
Angelo Compagnucci <angelo@amarulasolutions.com> wrote:

> +ifeq ($(BR2_PACKAGE_NFS_UTILS_SERVER),y)
>  define NFS_UTILS_INSTALL_INIT_SYSV
>  	$(INSTALL) -D -m 0755 package/nfs-utils/S60nfs \
>  		$(TARGET_DIR)/etc/init.d/S60nfs
> @@ -95,6 +96,7 @@ define NFS_UTILS_INSTALL_INIT_SYSTEMD
>  	$(INSTALL) -D -m 0644 package/nfs-utils/nfs-utils_tmpfiles.conf \
>  		$(TARGET_DIR)/usr/lib/tmpfiles.d/nfs-utils.conf
>  endef
> +endif

This is only removing the installation of the init script/systemd unit
files, not really disabling the server.

Shouldn't we do like BR2_PACKAGE_NFS_UTILS_RPCDEBUG,
BR2_PACKAGE_NFS_UTILS_RPC_LOCKD and BR2_PACKAGE_NFS_UTILS_RPC_RQUOTAD
are doing, and also remove the unnecessary programs ?

Another question is: the systemd stuff installs a nfs-client.service
unit file, and you're no longer installing this. It's named
nfs-client... so it seems to be needed even when you are just a client.

In fact, I think *some* of the daemons are needed even when you are
just a client. See what nfs-client.service is doing.

Best regards,

Thomas
Angelo Compagnucci March 28, 2019, 5:01 p.m. UTC | #2
Hi Thomas,

On Thu, Mar 28, 2019 at 5:49 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Angelo,
>
> On Thu, 28 Mar 2019 14:53:09 +0100
> Angelo Compagnucci <angelo@amarulasolutions.com> wrote:
>
> > +ifeq ($(BR2_PACKAGE_NFS_UTILS_SERVER),y)
> >  define NFS_UTILS_INSTALL_INIT_SYSV
> >       $(INSTALL) -D -m 0755 package/nfs-utils/S60nfs \
> >               $(TARGET_DIR)/etc/init.d/S60nfs
> > @@ -95,6 +96,7 @@ define NFS_UTILS_INSTALL_INIT_SYSTEMD
> >       $(INSTALL) -D -m 0644 package/nfs-utils/nfs-utils_tmpfiles.conf \
> >               $(TARGET_DIR)/usr/lib/tmpfiles.d/nfs-utils.conf
> >  endef
> > +endif
>
> This is only removing the installation of the init script/systemd unit
> files, not really disabling the server.>
>
> Shouldn't we do like BR2_PACKAGE_NFS_UTILS_RPCDEBUG,
> BR2_PACKAGE_NFS_UTILS_RPC_LOCKD and BR2_PACKAGE_NFS_UTILS_RPC_RQUOTAD
> are doing, and also remove the unnecessary programs ?

Probably yes. It could save some space and it coulb be betetr for fs
cleaning. Will do.

> Another question is: the systemd stuff installs a nfs-client.service
> unit file, and you're no longer installing this. It's named
> nfs-client... so it seems to be needed even when you are just a client.
>
>
> In fact, I think *some* of the daemons are needed even when you are
> just a client. See what nfs-client.service is doing.

I'll have a better look at the systemd part. I tested with sysy and
the system can mount an nfs share without having any service running.

>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
diff mbox series

Patch

diff --git a/package/nfs-utils/Config.in b/package/nfs-utils/Config.in
index 055b711..50c47aa 100644
--- a/package/nfs-utils/Config.in
+++ b/package/nfs-utils/Config.in
@@ -30,4 +30,10 @@  config BR2_PACKAGE_NFS_UTILS_RPC_RQUOTAD
 	help
 	  NFS remote quota server
 
+config BR2_PACKAGE_NFS_UTILS_SERVER
+        bool "server daemon"
+        default y
+        help
+          Install the NFS server daemon
+
 endif
diff --git a/package/nfs-utils/nfs-utils.mk b/package/nfs-utils/nfs-utils.mk
index 9fa7ae2..ec39588 100644
--- a/package/nfs-utils/nfs-utils.mk
+++ b/package/nfs-utils/nfs-utils.mk
@@ -71,6 +71,7 @@  else
 NFS_UTILS_CONF_OPTS += --without-systemd
 endif
 
+ifeq ($(BR2_PACKAGE_NFS_UTILS_SERVER),y)
 define NFS_UTILS_INSTALL_INIT_SYSV
 	$(INSTALL) -D -m 0755 package/nfs-utils/S60nfs \
 		$(TARGET_DIR)/etc/init.d/S60nfs
@@ -95,6 +96,7 @@  define NFS_UTILS_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 package/nfs-utils/nfs-utils_tmpfiles.conf \
 		$(TARGET_DIR)/usr/lib/tmpfiles.d/nfs-utils.conf
 endef
+endif
 
 define NFS_UTILS_REMOVE_NFSIOSTAT
 	rm -f $(TARGET_DIR)/usr/sbin/nfsiostat