Hi Jan,
Like Kai says: nowadays we recommend the sysext approach. You will need to dive fairly deep into Flatcar to build a zfs one and will need to setup your own pipeline to keep it up to date (and to fetch a new version after an OS update). There are also some OS integrations that currently don't work so well with sysexts, most of which a zfs sysext appears to hit ( :) ):
- systemd presets don't work so you'll need to enable zfs related services/targets yourself
- udev rules don't work so the default approach of loading zfs mods when a zfs formatted volume is found doesn't work
- kernel module loading through /etc/modules-load.d happens before sysext activation so you'll need to mess with systemd service dependencies through drop-ins until you succeed
- kernel modules dependencies may be overwritten, which can break modprobe (though for a single sysext things appear to work)
Now that you've been warned about the dragons, this is more or less the incantation that you need to build one:
./run_sdk_container -t -a amd64
./build_packages --usepkgonly
./build_image
./update_ebuilds sys-fs/zfs
./update_ebuilds sys-fs/zfs-kmod
# repeat update_ebuilds for any additional dependency or required eclasses
sudo USE="-rootfs minimal" KBUILD_OUTPUT=$(echo /build/amd64-usr/lib/modules/*/build) KERNEL_DIR=$(echo /build/amd64-usr/lib/modules/*/source) ./build_sysext --metapkgs=sys-fs/zfs,sys-fs/zfs-kmod --build_dir=../build/images/amd64-usr/latest/ zfs
Hope this helps,
Jeremi