[PATCH] mount: add option to disable NFS completely

Reimu reimu at sudomaker.com
Thu May 25 14:03:58 UTC 2023


This can save up to ~40 kbytes with uclibc and it helps a lot when
you're building a very tiny busybox for embedded systems.
---
 util-linux/mount.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/util-linux/mount.c b/util-linux/mount.c
index 4e65b6b46..1c3e2bf64 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -77,6 +77,17 @@
 //config:    Note that this option links in RPC support from libc,
 //config:    which is rather large (~10 kbytes on uclibc).
 //config:
+//config:config FEATURE_MOUNT_NFS_ALL
+//config:    bool "Support mounting NFS file systems on Linux >= 2.6.23"
+//config:    default y
+//config:    depends on MOUNT
+//config:    help
+//config:    Enable mounting of NFS file systems on Linux kernels with
+//config:    at least version 2.6.23.
+//config:
+//config:    Disabling this option can save up to ~40 kbytes with uclibc
+//config:    if you have nothing else that requires getnameinfo().
+//config:
 //config:config FEATURE_MOUNT_CIFS
 //config:    bool "Support mounting CIFS/SMB file systems"
 //config:    default y
@@ -2089,7 +2100,8 @@ static int singlemount(struct mntent *mp, int ignore_busy)
     }
 
     // Might this be an NFS filesystem?
-    if (!(vfsflags & (MS_BIND | MS_MOVE))
+    if (ENABLE_FEATURE_MOUNT_NFS_ALL
+     && !(vfsflags & (MS_BIND | MS_MOVE))
      && (!mp->mnt_type || is_prefixed_with(mp->mnt_type, "nfs"))
     ) {
         char *colon = strchr(mp->mnt_fsname, ':');
-- 
2.25.1




More information about the busybox mailing list