No nfsd kernel module?

Hi, I’m trying to start NFS server on my PinePhone,
seems I can’t do that because of missing nfsd kernel module:

Dec 10 00:15:11 plasma-mobile mount[4017]: mount: /proc/fs/nfsd: unknown filesystem type 'nfsd'.
Dec 10 00:15:11 plasma-mobile systemd[1]: proc-fs-nfsd.mount: Mount process exited, code=exited, 
Dec 10 00:15:11 plasma-mobile systemd[1]: Failed to mount NFSD configuration filesystem.
Dec 10 00:15:11 plasma-mobile systemd[1]: Dependency failed for NFS server and services.

No nfsd FS support in kernel either:

$ grep nfs /proc/filesystems 
nodev	nfs
nodev	nfs4

And also I’m not able to find the module in any remote packages:

[bam@plasma-mobile ~]$ sudo pacman -Fy nfsd.ko.xz
:: Synchronizing package databases...
 mobile is up to date
 core is up to date
 extra is up to date
 community is up to date
[bam@plasma-mobile ~]$

How can I add the module?
I’m on Manjaro Plasma-Mobile Developer Edition.

Did you enable/start nfs-server.service?

You can tell if the kernel modules are enabled or not:

sudo modprobe configs
zcat /proc/config.gz | grep NFS

Mine on my x64:


[ray@ray-pc ~]$ zcat /proc/config.gz | grep NFS
# CONFIG_USB_FUNCTIONFS is not set
CONFIG_XENFS=m
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_KERNFS=y
CONFIG_NFS_FS=m
CONFIG_NFS_V2=m
CONFIG_NFS_V3=m
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=m
CONFIG_NFS_SWAP=y
CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_2=y
CONFIG_PNFS_FILE_LAYOUT=m
CONFIG_PNFS_BLOCK=m
CONFIG_PNFS_FLEXFILE_LAYOUT=m
CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
# CONFIG_NFS_V4_1_MIGRATION is not set
CONFIG_NFS_V4_SECURITY_LABEL=y
CONFIG_NFS_FSCACHE=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
CONFIG_NFS_DISABLE_UDP_SUPPORT=y
CONFIG_NFS_V4_2_READ_PLUS=y
CONFIG_NFSD=m
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
# CONFIG_NFSD_BLOCKLAYOUT is not set
# CONFIG_NFSD_SCSILAYOUT is not set
# CONFIG_NFSD_FLEXFILELAYOUT is not set
# CONFIG_NFSD_V4_2_INTER_SSC is not set
# CONFIG_NFSD_V4_SECURITY_LABEL is not set
CONFIG_NFS_ACL_SUPPORT=m
CONFIG_NFS_COMMON=y

If they are not enabled then they will have to be enabled and the kernel recompiled. I do not know which kernel you are using to check.

[ray@ray-pc ~]$ grep nfs /proc/filesystems
nodev	nfsd

Thanks for reply!
Yes I tried to enable/start the nfs-service, it can’t start because of errors I posted.

I run stock Manjaro kernel for PP and the module is disabled there:

$ grep NFSD /lib/modules/5.15.5-4-MANJARO-ARM/build/.config
# CONFIG_NFSD is not set

So do you think I can’t recompile the only module and need to compile the whole kernel along with?
What’s the procedure?

A lot of the time one module pulls in others. nfsd might pull in some nfs modules and maybe some others. Some modules sometimes may be disabled by default and might be needed for the user’s special cases. Some modules will not show up in the config until certain ones get enabled. It would be best if the maintainer who maintains that kernel enable and compile it if he chooses to do so. I believe it is @philm

If you want to try compiling it you can start by enabling what I posted above in the PKGBUILD’s config file and build/test it.

Yes it’s here:

@philm would you mind enabling it as a module, please?
RPi kernels have this and it’s needed for a work I do for Plasma SDK:

$ sudo pacman -Fy nfsd.ko
:: Synchronizing package databases...
 mobile is up to date
 core is up to date
 extra is up to date
 community is up to date
core/linux-rpi4 5.10.81-1
    usr/lib/modules/5.10.81-1-MANJARO-ARM-RPI/kernel/fs/nfsd/nfsd.ko
core/linux-rpi4-mainline 5.15.4-1
    usr/lib/modules/5.15.4-1-MANJARO-ARM-RPI/kernel/fs/nfsd/nfsd.ko
core/linux-rpi4-rc 5.15.rc7-1
    usr/lib/modules/5.15.0-rc7-1-MANJARO-ARM/kernel/fs/nfsd/nfsd.ko
community/linux-rpi4-udl 5.10.44-2
    usr/lib/modules/5.10.46-2-udlv8+/kernel/fs/nfsd/nfsd.ko

@bam I had some time to kill today and compiled a test kernel for you to test using the PKGBUILD repo you posted above. I do not have a pinephone so can not test it.

md5sum:
f8a03fafc53912afc2d915cbda9c4373 linux-pinephone-nfsd-test-5.15.7-2.tar

https://drive.google.com/file/d/1TXdiGh5GdQvQdTGMipimxQ6Wo5X1jbb5/view?usp=sharing

Here is the config diff. Some was changed by the system due to different compiling environment, config from older kernel which the newer 5.15.7 kernel added a couple of modules.

[ray@ray-pc Desktop]$ cat config-nfsd.diff

--- config-old	2021-12-10 14:10:03.811950229 -0600
+++ config	2021-12-10 13:46:32.507622484 -0600
@@ -1,8 +1,8 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/arm64 5.15.6-1 Kernel Configuration
+# Linux/arm64 5.15.7-2 Kernel Configuration
 #
-CONFIG_CC_VERSION_TEXT="gcc (GCC) 10.2.0"
+CONFIG_CC_VERSION_TEXT="aarch64-unknown-linux-gnu-gcc (GCC) 10.2.0"
 CONFIG_CC_IS_GCC=y
 CONFIG_GCC_VERSION=100200
 CONFIG_CLANG_VERSION=0
@@ -5972,9 +5972,9 @@
 CONFIG_NFS_FS=y
 CONFIG_NFS_V2=y
 CONFIG_NFS_V3=y
-# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
-# CONFIG_NFS_SWAP is not set
+CONFIG_NFS_SWAP=y
 CONFIG_NFS_V4_1=y
 CONFIG_NFS_V4_2=y
 CONFIG_PNFS_FILE_LAYOUT=y
@@ -5987,16 +5987,27 @@
 # CONFIG_NFS_USE_LEGACY_DNS is not set
 CONFIG_NFS_USE_KERNEL_DNS=y
 CONFIG_NFS_DISABLE_UDP_SUPPORT=y
-# CONFIG_NFS_V4_2_READ_PLUS is not set
-# CONFIG_NFSD is not set
+CONFIG_NFS_V4_2_READ_PLUS=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+# CONFIG_NFSD_BLOCKLAYOUT is not set
+# CONFIG_NFSD_SCSILAYOUT is not set
+# CONFIG_NFSD_FLEXFILELAYOUT is not set
+# CONFIG_NFSD_V4_2_INTER_SSC is not set
+# CONFIG_NFSD_V4_SECURITY_LABEL is not set
 CONFIG_GRACE_PERIOD=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
 CONFIG_NFS_COMMON=y
 CONFIG_NFS_V4_2_SSC_HELPER=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
 CONFIG_SUNRPC_BACKCHANNEL=y
+CONFIG_SUNRPC_SWAP=y
 # CONFIG_SUNRPC_DEBUG is not set
 # CONFIG_CEPH_FS is not set
 CONFIG_CIFS=m

Oh, very kind from your side, thank you!
I’ll try it, hopefully my phone boots :slight_smile:

How am I supposed to install .tar? Maybe you could also create a package for me so I could remove it later? It’s not necessary, though. (I also have to probably check bootloader so it boots the new kernel)

I also would like to point that suggested changes are meant not only for me but for all Plasma developers shall they wanted to use cross-compiler.

I hope it boots also. :crossed_fingers: I maintain only the rpi related stuff only.

Unpack the tarball. There are 2 packages (kernel/kernel-headers) in it. Install them then with sudo pacman -U

Not my call.

Hmm, it seems I would also need to copy the kernel to boot partition after the packages installing, as I see Image file there…

No clue but it should have installed everything. I’m not sure how the pinephone works. I suspect people should have to not do anything on kernel upgrades. Normally old kernel gets removed before new kernel gets installed.

Thanks, I’ll check if the image changes afterwards.
BTW, did you cross-compiled this kernel or compiled it natively?

I compiled it with distcc using a vim3 as master and my rockpro64 and x86 desktop as slaves. That is how I do all rpi kernels.

==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "linux-pinephone-headers"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: linux-pinephone 5.15.7-2 (Fri 10 Dec 2021 02:17:50 PM CST)

real	27m13.017s
user	37m12.557s
sys	7m55.869s
[ray@vim3 linux-pinephone]$

In this scheme, master should always be the same CPU arch, right? And contain all the libs in it’s rootfs?

Pretty much. Everything that is needed as far as depends is installed on the master. It processes everything to the slaves to be compiled and gets sent back to the master to be put together. This simple way will work for building all packages. There is a distcc package especially for this in AUR for the x86 desktop for this scenario.

https://aur.archlinux.org/packages/distccd-alarm-armv8

That’s interesting, but maybe works not very well when you have all the sources on PC side.
So for Plasma ARM development we choice another scheme with sysroot cross-SDK, as I linked above.

That distcc might still be an option, needs further investigation…

I have never had an issue. I have built firefox and kodi-rpi as a couple of examples.

I’m talking about the case when you work with the sources changing them, not only the build.

[bam@plasma-mobile ~]$ systemctl status nfs-server
● nfs-server.service - NFS server and services
     Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
     Active: active (exited) since Sat 2021-12-11 02:59:13 MSK; 21s ago
    Process: 3838 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
    Process: 3840 ExecStart=/usr/sbin/rpc.nfsd (code=exited, status=0/SUCCESS)
   Main PID: 3840 (code=exited, status=0/SUCCESS)
        CPU: 62ms

@Darksky Thanks a lot! :slight_smile:

1 Like

Great!!

@Darksky next time simply create a PR/MR on gitlab, the CI will build the kernel and you can link the output to the user for review. Then the user can comment on the change and I might pick it up next time I push packages