无法在 Yocto Linux 上启用 NFS

无法在 Yocto Linux 上启用 NFS

我正在尝试在使用 Yocto 构建的 Linux 映像上启用 NFS。该映像在开发板上运行 - Qualcomm RB5。启动后,mount.nfs 似乎不起作用,抱怨

mount.nfs: No such device

当我使用 dmesg | 检查时grep nfs,我得到以下信息,但无法弄清楚失败的原因是什么

[    7.323526] systemd[597]: proc-fs-nfsd.mount: Failed to connect stdout to the journal socket, ignoring: No such file or directory
[    7.326328] request_module fs-nfsd succeeded, but still no fs?
[    7.337908] systemd[1]: proc-fs-nfsd.mount: Mount process exited, code=exited, status=32/n/a
[    7.338655] systemd[1]: proc-fs-nfsd.mount: Failed with result 'exit-code'.
[    7.346027] systemd[1]: nfs-mountd.service: Job nfs-mountd.service/start failed with result 'dependency'.
[    7.346754] systemd[1]: nfs-server.service: Job nfs-server.service/start failed with result 'dependency'.
[    7.454332] systemd[649]: proc-fs-nfsd.mount: Failed to connect stdout to the journal socket, ignoring: No such file or directory
[    7.459122] systemd[1]: proc-fs-nfsd.mount: Mount process exited, code=exited, status=32/n/a
[    7.460157] systemd[1]: proc-fs-nfsd.mount: Failed with result 'exit-code'.
[    8.235626] systemd[726]: proc-fs-nfsd.mount: Failed to connect stdout to the journal socket, ignoring: No such file or directory
[    8.241962] systemd[1]: proc-fs-nfsd.mount: Mount process exited, code=exited, status=32/n/a
[    8.243164] systemd[1]: proc-fs-nfsd.mount: Failed with result 'exit-code'.

当我使用“”检查时systemctl status proc-fs-nfsd.mount,它显示以下内容:

Jan 01 06:55:40 qrb5165-rb5 mount[1377]: mount: /proc/fs/nfsd: unknown filesystem type 'nfsd'.

这很令人困惑,因为我以为我启用了 nfs。

我确保在 local.conf 中启用了 NFS 支持。以下是我用来启用 NFS 的行:

DISTRO_FEATURES_append = " nfs"
EXTRA_IMAGE_FEATURES += "nfs-server"
EXTRA_IMAGE_FEATURES += "nfs-client"

我错过了什么吗?

答案1

经过几个小时的挖掘,我刚刚让 NFS 在设备上运行。该失败是由我的新手错误引起的尚未在内核中启用 NFS 文件系统支持所以没有构建相应的内核驱动程序。我想我以某种方式假设 Yocto 会为你做到这一点,但实际上它不会。我在内核配置中添加了以下更改以在设备上启用 NFS:

CONFIG_NFS_FS=y
CONFIG_NFSD=y

相关内容