From eca94cef8bd53388a0b699912f4ba6a6cb7b8765 Mon Sep 17 00:00:00 2001 From: Subhash Chandra Date: Wed, 26 Apr 2023 13:25:25 +0530 Subject: [PATCH] feat: nfsd support as module package Build nfsd support as module package. This allows to build an nfsd extension to be used with projects like openebs/dynamic-nfs-provisioner. Talos can load it via machine-config: ```yaml machine: # Configures the kernel. kernel: # Kernel modules to load. modules: - name: nfsd # Module name. ``` Signed-off-by: Subhash Chandra --- Makefile | 1 + nfsd/nfsd.config | 9 +++++++++ nfsd/pkg.yaml | 28 ++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 nfsd/nfsd.config create mode 100644 nfsd/pkg.yaml diff --git a/Makefile b/Makefile index c0ad94f67..845ff9773 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/nfsd/nfsd.config b/nfsd/nfsd.config new file mode 100644 index 000000000..c7ee56761 --- /dev/null +++ b/nfsd/nfsd.config @@ -0,0 +1,9 @@ +CONFIG_NFSD=m +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 diff --git a/nfsd/pkg.yaml b/nfsd/pkg.yaml new file mode 100644 index 000000000..c4273bda8 --- /dev/null +++ b/nfsd/pkg.yaml @@ -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: /