Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: nfsd support as module package #713

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ TARGETS += \
kernel \
drbd-pkg \
gasket-driver-pkg \
nfsd-pkg \
nvidia-open-gpu-kernel-modules-pkg \

# Temporarily disabled until mellanox builds with Linux 6.1
Expand Down
9 changes: 9 additions & 0 deletions nfsd/nfsd.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CONFIG_NFSD=m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we simply build nfsd as a module as part of the main kernel build @frezbo ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we update the the Kconfig and only build the modules that we ship by default in talos, then these extra can be build as separate modules shipped as extensions, so we don't increase initramfs size

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, okay... makes sense.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the same approach as I'm taking here. Right?

LMK if there is anything else needed to get this approved and merged in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the same approach as I'm taking here. Right?

meant adding to the actual kernel config under kernel/build/config-<arch>, I'll try to experiment and see if that approach works for our use case. Might take a while

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't currently figure out where kernel is being used to build installer. If you can point me, I'll be more than happy to run a few experiments of my own.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/siderolabs/talos/blob/main/Dockerfile#L77-L99 you can update this with your kernel image and do make installer PUSH=true

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick question: does this work without rpc service running?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TMaYaD does this require rpc service? Else I can fix this up and get this merged.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worked on this a while back and don't remember how I got this working. I'll check and get back to you.

CONFIG_NFSD_V2_ACL=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
28 changes: 28 additions & 0 deletions nfsd/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: nfsd-pkg
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: kernel-build
steps:
- env:
ARCH: '{{ if eq .ARCH "aarch64"}}arm64{{ else if eq .ARCH "x86_64" }}x86_64{{ else }}unsupported{{ end }}'
prepare:
- |
cd /src
cat /pkg/nfsd.config >> .config
build:
- |
cd /src
make olddefconfig
make scripts
install:
- |
cd /src
make -j $(nproc) -C /src M=fs/nfsd modules_install DESTDIR=/rootfs INSTALL_MOD_PATH=/rootfs INSTALL_MOD_STRIP=1 CONFIG_MODULE_SIG_ALL=y
test:
- |
# https://www.kernel.org/doc/html/v4.15/admin-guide/module-signing.html#signed-modules-and-stripping
find /rootfs/lib/modules -name '*.ko' -exec grep -FL '~Module signature appended~' {} \+
finalize:
- from: /rootfs
to: /