Commit Graph

54 Commits

Author SHA1 Message Date
John Audia
4151ca2efb nfs-kernel-server: disable kerberos and ldap
Some targets are failing due likely to build order issues suggested by
Daniel[1] so disable these two options for the v4 package.

Example:
make[4]: Leaving directory '/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/nfs-utils-2.8.4'
Package nfs-kernel-server-v4 is missing dependencies for the following libraries:
libgssapi_krb5.so.2
libldap.so.2

1. https://github.com/openwrt/packages/pull/27150#issuecomment-3446589119

Signed-off-by: John Audia <therealgraysky@proton.me>
2025-10-25 15:46:34 +03:00
Daniel Golle
d6a3943cc4 nfs-kernel-server: fix recursive Kconfig dependencies
Move CONFLICTS definition to the respective v4 packages to avoid
creating a recursive dependency.

Fixes: ee3b06e42 ("nfs-kernel-server: provide a NFSv3 and NFSv4 daemon")
Fixes: #27555
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-09-29 21:06:56 +01:00
John Audia
ee3b06e42c nfs-kernel-server: provide a NFSv3 and NFSv4 daemon
Summary:

The current build does not produce an NFSV4 capable package. This commit
fixes that providing a v3 and v4 variant to empower users to have either.

Approx. size differences between v3 and v4:

The v4 variant is approximately 16 MiB larger than the v3 variant
due to additional dependencies, kernel modules, etc.[1]

Detailed changes:

1. Split into a v3 and v4 version series of packages. In doing
   this, the build-time V4 options are removed which is a major "win"
   from a user's perspective because it means that for both release and
   for snapshot builds, both options will be available to users of the
   binary hosted packages.

2. Since V3 and V4 require different init processes, we should simplify
   daemon management by providing a single init script unique to each
   variant.

3. Added CPE_ID and PKG_LICENSE and also added myself as the Makefile
   MAINTAINER.

Discussion about the v4 initd script:

It should be noted that mimicking the systemd implementation in an init.d
script with procd was not straight forward. There are some quirks
associated with the interplay of the five executables (listed below)
with procd, but despite of them, the init script works reliably based
on my somewhat extensive testing.

My observations and justification for the script as-is:
1a. procd_set_param command /usr/sbin/nfsdcld cannot be started with an
    appended -F as doing so will somehow cause the executable to never
    connect to the communication pipe: /var/lib/nfs/rpc_pipefs/nfsd/cld.

    In fact, if you run `watch -n 1 tree /var/lib/nfs/rpc_pipefs` while
    calling the init.d script to start, this pipe will quickly disappear
    resulting in nfsdcld being unable to find it and thus fail to track
    clients. On the other hand, starting it as I have in the init.d
    script works as expected.

1b. Starting /usr/sbin/nfsdcld even with the -F arg outside of procd
    also results in the communication pipe quickly disappearing.

2.  Even though rpc.nfsd is a user space util, and even though it runs
    and then exits, it must be started by procd with the procd_set_param
    or else, the communication pipe: /var/lib/nfs/rpc_pipefs/nfsd/cld
    will again quickly disappear breaking client tracking.

3.  The addition of the umountem function keeps syslog output cleaner as
    a shutdown of rpc.idmapd will cause the following to be logged:

    daemon.warn rpc.idmapd[xxxxx]: dirscancb: scandir(/var/lib/nfs/rpc_pipefs//nfs): No such file or directory

    Adding a 1 sec delay allows procd to kill it before we umount the
    nfs related mounts to prevent that warning.

4.  I can find no way to suppress rpc.idmapd and nfsv4.exportd reporting
    that they received a SIGTERM (signal 15). The syslog will contain
    two lines on exit, e.g.:
    daemon.warn rpc.idmapd[1894]: exiting on signal 15
    daemon.notice nfsv4.exportd[1893]: Caught signal 15, exiting.

The result of points 1 and 2 mean that if a users queries the status of
the daemon when running, (ie /etc/init.d/nfsv4d status), it will show:
running (2/4) despite the kernel serving up NFSV4 mounts 100% correctly.

I am unaware of a more perfect approximation of the systemd units.

List of the five needed calls:
* /usr/sbin/nfsv4.exportd (run once then quit)
* /usr/sbin/rpc.idmapd (needs to continue running)
* /usr/sbin/nfsdcld (needs to continue running)
* /usr/sbin/exportfs -r (run once then quit)
* /usr/sbin/rpc.nfsd -N 3 (run once then quit)

1. As assessed by comparing the uncompressed img files from a build of a
   minimal image for x86/64 with the v3 variant vs with the v4.

Both variants have been tested and work.

v3:
On a network node, the NFSV3 export is fully functional:

% mount -t nfs -o vers=3 10.9.8.1:/mnt/data/nfs/misc ok
% mount | grep ok
10.9.8.1:/mnt/data/nfs/misc on /home/facade/ok type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.9.8.1,mountvers=3,mountport=32780,mountproto=udp,local_lock=none,addr=10.9.8.1)

v4:
On a network node, the NFSV4 export is fully functional:

% mount 10.9.8.1:/misc ok
% mount | grep ok
10.9.8.1:/mnt/data/nfs/misc on /home/facade/ok type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.9.8.102,local_lock=none,addr=10.9.8.1)

Finally, added 240-fix-cleanup_lockfiles-function-linkage-in-exportd.patch[1]

1. https://marc.info/?l=linux-nfs&m=175604879721922&w=2

From commit msg therein:
The cleanup_lockfiles function in utils/exportd/exportd.c was declared
as 'inline void' without a proper function prototype, causing linker
errors during the build process:

  exportd.c:(.text+0x5a): undefined reference to `cleanup_lockfiles'
  exportd.c:(.text.startup+0x317): undefined reference to `cleanup_lockfiles'

This occurred because:
1. The inline keyword prevented the compiler from generating a callable
   function symbol in some build configurations
2. The function lacked a proper prototype declaration, triggering
   -Werror=missing-prototypes

The fix changes the function to:
- Remove the 'inline' keyword to ensure symbol generation
- Add a proper static function prototype
- Make the function 'static' since it's only used within exportd.c

This resolves both the linking error and the missing prototype warning,
allowing exportd to build successfully in OpenWrt's cross-compilation
environment.

Co-authored-by: Maxim Storchak <m.storchak@gmail.com>
Co-authored-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: John Audia <therealgraysky@proton.me>
2025-09-27 17:46:14 +01:00
John Audia
a4577bef1a nfs-kernel-server: update to v2.8.4
Update to v2.8.4

Shortlog:
Anna Schumaker (4):
      rpcctl: Add support for `rpcctl switch add-xprt`
      rpcctl: Display new rpc_clnt sysfs attributes
      rpcctl: Add support for the xprtsec sysfs attribute
      rpcctl: Rename {read,write}_addr_file()

Antonio Alvarez Feijoo (3):
      nfsroot-generator: do not fail if nfsroot is not configured
      systemd: Add a generator to mount /sysroot via NFSv4 in the initrd
      systemd: Allow nfs-idmapd.service to be started without the server

Scott Mayhew (3):
      rpc-statd.service: define dependency on both rpcbind.service and rpcbind.socket
      nfsdctl: fix lockd config during autostart
      nfsdctl: debug logging fixups

Steve Dickson (3):
      Release: 2.8.4
      configure.ac: AC_PROG_GCC_TRADITIONAL is obsolete.
      nfsdctl: Warning Clean Up

zhangyaqi (2):
      gssd:fix the possible buffer overflow in get_full_hostname
      nfsdcld:Fix a memory leak

Thiago Becker (1):
      nfsrahead: modify get_device_info logic

Yaakov Selkowitz (1):
      Fix build with glibc-2.42

Build system: x86/64
Build-tested: x86/64-glibc
Run-tested: x86/64-glibc

Signed-off-by: John Audia <therealgraysky@proton.me>
2025-09-15 19:14:26 -03:00
John Audia
b606b58ac2 nfs-kernel-server: fix build
Add nls.mk and patch to avoid the build ending in an error:
In function 'write_table',
    inlined from 'write_tables' at rpc_tblout.c:73:4,
    inlined from 't_output.constprop' at rpc_main.c:841:3:
rpc_tblout.c:91:26: error: '%s' directive writing likely 1 or more bytes into a region of size between 0 and 99 [-Werror=format-overflow=]
   91 |       s_print (progvers, "%s_%s",
      |                          ^
rpc_tblout.c:91:26: note: assuming directive output of 1 byte
In function 'sprintf',
    inlined from 'write_table' at rpc_tblout.c:91:7,
    inlined from 'write_tables' at rpc_tblout.c:73:4,
    inlined from 't_output.constprop' at rpc_main.c:841:3:
/scratch/union/staging_dir/toolchain-x86_64_gcc-15.1.0_glibc/include/bits/stdio2.h:30:10: note: '__builtin___sprintf_chk' output 2 or more bytes (assuming 102) into a destination of size 100
   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^
lto1: some warnings being treated as errors
make[6]: *** [/scratch/union/tmp/ccHfYNRX.mk:2: /scratch/union/tmp/ccudJcWZ.ltrans0.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
mold: fatal: lto-wrapper failed

Build system: x86/64
Build-tested: x86/64-glibc
Run-tested: x86/64-glibc

Co-developed-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: John Audia <therealgraysky@proton.me>
2025-08-01 10:05:08 +08:00
John Audia
c851cf35c5 nfs-kernel-server: update to v2.8.3
Update to v2.8.3
Removed upstreamed: 210-patch-for-broken-libnfsimapd-static-and-regex-plugins.patch
Added: 210-nfsdctl.c-add-missing-basename.patch

Build system: x86/64
Build-tested: x86/64
Run-tested: x86/64

Signed-off-by: John Audia <therealgraysky@proton.me>
2025-05-10 09:00:41 +03:00
John Audia
f2030e6256 nfs-kernel-server: update to v2.8.2
Update to latest release and change URL to official upstream mirror.

Removed upstreamed patch: 130-musl-svcgssd-sysconf.patch

Added new patch to correct host build error as we do not build with
gss enabled anyway: 100-fix-host-build.patch

Build system: x86/64
Build-tested: bcm27xx/bcm2712
Run-tested: bcm27xx/bcm2712

Signed-off-by: John Audia <therealgraysky@proton.me>
2025-05-10 09:00:41 +03:00
Yangyu Chen
c3232005cb nfs-kernel-server: do not export /mnt by default
Currently, the nfs-kernel-server package exports /mnt by default after
it is installed. This is not a good default behavior, as it may expose
sensitive data to the network if a user mounts something on /mnt. This
commit commented out the line that exports /mnt, so the user has to
enable it explicitly.

Signed-off-by: Yangyu Chen <cyy@cyyself.name>
2024-06-23 11:10:59 -07:00
Maxim Storchak
33e1deadf8 nfs-kernel-server: remove libwrap from the dependencies
Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
2023-06-02 15:53:04 +03:00
Tianling Shen
79e507cb34 nfs-kernel-server: fix compilation with musl 1.2.4
musl 1.2.4 deprecated legacy "LFS64" ("large file support") interfaces so
just having _GNU_SOURCE defined is not enough anymore.

Manually pass -D_LARGEFILE64_SOURCE to allow to keep using LFS64 definitions.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-05-17 16:03:28 +08:00
Oskari Rauta
a1c80c1f37 nfs-kernel-server: update to v2.6.2
Also added patch that is from alpine's same package to assist building on musl.
Hostpkg build on musl also kept failing, so I added few more overrides, which
made it work perfectly.

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
2023-03-01 17:02:42 +08:00
Rosen Penev
6fab78170c nfs-kernel-server: disable IPv6 for host
Some issue with static libtirpc

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-06-04 22:47:53 -07:00
Rosen Penev
196e15162d treewide: remove rpath-link
Most usages seem to be outdated and fixed a long time ago.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-13 00:02:02 -08:00
Sergey V. Lobanov
8457944e61 nfs-kernel-server: fix build on macos arm64
1. prctl() check is not required for host-compile on any OS due to prctl
is not used in rpcgen which is only one is compiled during host-compile
phase. prctl() check is disabled via HOST_CONFIGURE_VARS in OpenWrt makefile

2. __DARWIN_ONLY_64_BIT_INO_T is true on macos arm64 so struct stat64
and stat64() are not available. This patch defines stat64 as stat if
__DARWIN_ONLY_64_BIT_INO_T is true

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
2021-12-13 19:57:18 -08:00
Daniel Golle
ded4ab79b2 nfs-kernel-server: move hardcoded /run to /tmp/run
statd currently fails to start due to missing /run which doesn't exist
on OpenWrt.

Add a patch moving /run to /tmp/run as the path is hardcoded in several
places and cannot be configured neither at buildtime nor at runtime.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-11-13 01:11:34 +00:00
Daniel Golle
025bca81a0 nfs-kernel-server: reload when exported mountpoints show
Use newly introduced procd_add_reload_mount_trigger to reload nfsd
when a mountpoint covering an exported filesystem is added by blockd.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-10-28 19:54:29 +01:00
Rosen Penev
2d3409d5c4 nfs-kernel-server: update to 2.5.4
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-08-28 16:47:52 -07:00
Rosen Penev
d09d428c2e nfs-kernel-server: update to 2.5.2
Remove uClibc-ng patch as it was upstreamed.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-01-17 15:05:19 -08:00
Javier Marcet
c48bae07be nfs-kernel-server: update to 2.5.1
Signed-off-by: Javier Marcet <javier@marcet.info>
2020-06-29 17:50:31 +02:00
Peter Wagner
d76f90fd43 nfs-kernel-server: update to 2.4.1
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2019-06-30 13:10:35 +02:00
Rosen Penev
732b1c4c0e nfs-kernel-server: Fix compile with uClibc-ng
NS_MAXMSG is not defined.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-06-28 20:12:15 +02:00
Peter Wagner
c86fdd679b nfs-kernel-server: compile with internal rpcgen
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2019-05-26 00:48:23 +02:00
Peter Wagner
c01f3bf0ba nfs-kernel-server: update to 2.3.4
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2019-05-12 21:12:55 +02:00
Peter Wagner
20468cfef1 nfs-kernel-server: create nfs user and group
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2019-04-22 11:26:28 +02:00
Rosen Penev
46fc281e9e nfs-utils: Fix compilation on some platforms
Added a patch sent upstream.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-04-20 13:17:50 +02:00
Peter Wagner
6d65505c26 nfs-kernel-server: fix dependencies
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2019-03-21 20:28:57 +01:00
Peter Wagner
edbac15a55 nfs-kernel-server: update patches
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2019-02-19 20:14:42 +01:00
Peter Wagner
274ce493eb nfs-kernel-server: fix freeaddrinfo usage in nfs-kernel-server, because freeaddrinfo in musl after the 1.1.21
update, doesn't handly NULL pointers (which seems to spec conform) see
https://www.openwall.com/lists/musl/2019/02/03/3 for more info

Signed-off-by: Peter Wagner <tripolar@gmx.at>
2019-02-17 00:17:03 +01:00
W. Michael Petullo
95db98bd7d nfs-kernel-server: add support for NFSv4
Signed-off-by: W. Michael Petullo <mike@flyn.org>
2018-09-29 20:34:33 +02:00
Guo Li
3fc7f7b8cc nfs-kernel-server: fix missing libbsd dependency
libbsd may compile before nfs-kernel-server, it  will make
nfs-kernel-server depends libbsd.so.0, that is not we want to see. so
gave option to 'configure' to disable libbsd detect and tell it we have
no libbsd

Signed-off-by: Guo Li <uxgood.org@gmail.com>
2018-09-11 22:56:46 +02:00
Peter Wagner
e5216bb0d5 nfs-kernel-server: update to 2.3.3
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2018-09-09 19:20:22 +02:00
Daniel Engberg
cfba4f0874 nfs-kernel-server: Switch to xz tarball
Switch to smaller xz tarball

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2018-08-31 19:50:59 +02:00
Andy Walsh
22ebb5a8d6 nfs-kernel-server: switch to libtirpc, enable ipv6
Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
2018-08-13 00:58:48 +02:00
Andy Walsh
19dfe3b173 nfs-kernel-server: fix missing host symbol res_querydomain/missing-include-dir
Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
2018-08-08 11:45:15 +02:00
Peter Wagner
b1be3f9c06 nfs-kernel-server: add -Wno-error=format-security to TARGET_CFLAGS to a fix compily error
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2018-08-02 23:17:35 +02:00
Peter Wagner
0d1f48893c nfs-kernel-server: update to 2.3.2
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2018-05-28 20:53:18 +02:00
Peter Wagner
ec61733de4 nfs-kernel-server: update to 2.3.1
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2017-12-27 00:39:04 +01:00
Peter Wagner
274eb1e720 nfs-kernel-server: update to 2.2.1
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2017-11-06 12:21:12 +01:00
Etienne Champetier
4006865ae8 treewide: run "make check FIXUP=1"
fix Makefile chmod (644)
replace MD5SUM with HASH
add PKG_MIRROR_HASH when PKG_SOURCE_PROTO:=git

(PKG_SOURCE_PROTO:=svn tarballs are not reproducible for now)

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-08-29 21:41:14 -07:00
Peter Wagner
91d59c5d02 nfs-kernel-sever: update to 2.1.1
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2017-01-15 21:31:44 +01:00
Matthias Schiffer
4a984a8d60 treewide: replace $(STAGING_DIR)/host and $(HOST_BUILD_PREFIX) with $(STAGING_DIR_HOSTPKG)
As both LEDE and OpenWrt have STAGING_DIR_HOSTPKG now, we can start to rely
on it. See 73b7f55424 for more information on
STAGING_DIR_HOSTPKG.

STAGING_DIR_HOSTPKG won't actually be changed before the first LEDE release
(it is equivalent to $(STAGING_DIR)/host), so this simple search/replace
cleanup is safe to apply. Doing this cleanup now will be useful for the
Gluon project (an OpenWrt/LEDE based firmware framework) for experimenting
with modifying STAGING_DIR_HOSTPKG before doing this in the LEDE upstream.

Also fixes a typo in the dbus Makefile ("STAGIND_DIR").

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2017-01-10 18:25:54 +01:00
Peter Wagner
c64a84937e nfs-kernel-server: update to 1.3.4
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2016-12-01 16:11:37 +01:00
Maxim Storchak
ed81839e52 nfs-kernel-server: add workaround for getservbyport
Fixes https://dev.openwrt.org/ticket/20038

Patch is based on http://git.alpinelinux.org/cgit/aports/plain/main/nfs-utils/musl-getservbyport.patch?id=3579df3582b5e5ea53be8cd8eef240f3f0cabb10

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
2016-06-13 22:57:45 +03:00
diizzyy
c7d0a55a08 nfs-kernel-server: use libevent2, update copyright and bump PKG_RELEASE
Use libevent2 instead of libevent
Update copyright to 2016
Bump PKG_RELEASE due to package changes

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2016-02-02 05:32:42 +01:00
Felix Fietkau
9f8e5aca34 treewide: use $(STAGING_DIR)/host instead of $(STAGING_DIR_HOST), sync with changes in trunk
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2016-01-20 21:56:03 +01:00
Peter Wagner
a5729ee727 nfs-kernel-server: update to 1.3.3
Signed-off-by: Peter Wagner <tripolar@gmx.at>
2015-10-03 11:19:22 +02:00
Jo-Philipp Wich
f5ca16f98d nfs-kernel-server: revert CONFIG_IPV6 handling
Building nfs-kernel-server with --enable-ipv6 requires not yet packaged
libtirpc, therfore unconditionally disable IPv6 support again for now.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-05-29 17:41:33 +02:00
Alexander Ryzhov
b0f2853135 nfs-kernel-server: respect IPv6 settings
Signed-off-by: Alexander Ryzhov <openwrt@ryzhov-al.ru>
2015-05-21 06:13:35 +00:00
Dirk Neukirchen
12e57878fe nfs-kernel-server: fix build with libblkid, libuuid
config.log reports
WARNING: uuid support disabled as libblkid is too old
because the test macro AC_BLKID_VERS is not cross compile friendly
resulting in libblkid_cv_is_recent=unknown

Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de>
2015-03-04 19:31:57 +01:00
Nicolas Thill
6bdc2e1eae nfs-kerne-server: fix host/build
Signed-off-by: Nicolas Thill <nico@openwrt.org>
2015-02-02 13:35:48 +01:00