SystemD: When to start service for file system kernel module

Richard Shaw hobbes1069 at gmail.com
Wed May 23 19:23:30 UTC 2012


Short story:
I'm working on creating kernel module packages for the ZFS file system
from zfsonlinux.org to be hosted at RPM Fusion and will utilize the
akmods utility to make sure that new modules are built on kernel
update.

Problem:
The zfs package also needs the SPL (Solaris Porting Layer) kernel
module so I have to control the order the kernel modules are built and
installed as the SPL one also has a kernel version specific devel
package that ZFS needs to build.

Question:
What is the right way to make sure it's built prior to mounting non
system volumes? Obviously you can't have your system volume be ZFS
with this setup, but with the current performance and stability, you
wouldn't want to.

Here's my current service file for SPL:
[Unit]
Description=Builds and installs new kmods for SPL
Before=local-fs-pre.target

[Service]
Type=oneshot
ExecStart=-/usr/sbin/akmods --from-init --akmod spl-kmod

[Install]
WantedBy=single-user.target

The one for ZFS is essentially the same except it also includes
"After=spl-kmod.service, Requires=spl-kmod.service" in it.

Thanks,
Richard


More information about the devel mailing list