Add zfs kernel module package - #4220
Open
mwaionos wants to merge 2 commits into
Open
Conversation
Builds spl.ko and zfs.ko against a kernel's headers, extracted from the kernel image via the existing kernel-dev.tar/kernel.tar/ linux.tar.xz convention shared with kernel/common/Dockerfile.perf and Dockerfile.bcc. The zfs source version is parameterized via the ZFS_VERSION build arg (default 2.2.9). Final stage is FROM scratch, containing only the built kernel modules. Wired up via kernel/common/build-zfs.yml and added to kernel/Makefile's TOOLS list, so `make build-<version>` builds it for every supported kernel series (currently 6.12.59 and 6.6.71). Includes kmod in the build image's apk install list: Alpine's default depmod is a BusyBox reimplementation that doesn't support /etc/depmod.d overrides, which kernel/common/Dockerfile.drbd relies on to resolve a real module-naming collision — kept consistent here even though zfs/spl have no such collision to resolve. Ported from ionos-cloud/paas-image. Signed-off-by: mwaionos <moritz.wagner@ionos.com>
test/cases/040_packages/027_zfs boots a kernel with the package's spl.ko/zfs.ko, modprobes zfs, and does a real zpool create/list/ destroy cycle against a loop-backed file — not just a module-load smoke check. Requires linuxkit/kernel-zfs:test-local to already exist in the local docker image store (build it from kernel/common/build-zfs.yml); not pulled from any registry, so the test is labeled skip and is meant to be run manually. Build-tested locally: zpool create/list/destroy and zfs list all succeed against a real ZFS 2.2.9 pool created by the module. Signed-off-by: mwaionos <moritz.wagner@ionos.com>
Author
|
Hey, just wanted to ask if you guys have interest in that PR. We use and maintain it internally anyways. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
Added a ZFS kernel module package (ZFS 2.2.9) built against a given kernel's headers, wired into the same per-kernel-series tool-build mechanism already used by
perfandbcc.- How I did it
kernel/common/Dockerfile.zfsexisted but was orphaned (still ZFS 0.8.1, using the oldARG IMAGEconvention, and not referenced by any current build target since theperf/bcctool-build refactor). I rewrote it to:--with-linux=/usr/src/linuxkernel-source extraction needed to build against current kernelsARG BUILD_IMAGE/ARG KERNEL_VERSION/ARG PKG_HASH+FROM linuxkit/kernel:${KERNEL_VERSION}-${PKG_HASH}convention shared withDockerfile.perf/Dockerfile.bccAdded
kernel/common/build-zfs.yml(same shape asbuild-perf.yml/build-bcc.yml) and addedzfstokernel/Makefile'sTOOLSlist, somake build-<version>builds it for every supported kernel series automatically.- How to verify it
```
cd kernel
make buildtool-6.12.59PARTzfs
make buildtool-6.6.71PARTzfs
```
I build-tested both currently non-deprecated series (6.12.59 and 6.6.71) directly via
docker build --build-arg KERNEL_VERSION=... --build-arg PKG_HASH=... -f kernel/common/Dockerfile.zfs kernel/commonagainst the real publishedlinuxkit/kernelimages, and confirmedspl.ko/zfs.koare present in/lib/modules/<version>-linuxkit/extra/in both resulting images.- Description for the changelog
Add a ZFS (2.2.9) kernel module package, buildable per supported kernel series alongside
perf/bcc.- A picture of a cute animal (not mandatory but encouraged)
🦭