Build and install from source
Build the kernel module and tools with make, and install them by hand so the module loads automatically on mount.
Prerequisites
sudo apt install build-essential linux-headers-$(uname -r)
The module is built against the headers of one specific kernel. The tools are plain C and have no kernel dependency.
Build
git clone https://github.com/cetrafs/cetrafs.git
cd cetrafs
make # kernel module + userspace tools
Or build each half on its own:
make userspace # mkfs.cetra, fsck.cetra, defrag.cetra, growfs.cetra
make mod # kmod/cetrafs.ko
To build the module for a kernel other than the running one, pass its build tree:
make mod KDIR=/lib/modules/<version>/build
Both the module and the tools build with -Werror. If you are bisecting on an unrelated kernel or compiler combination and need to get past a warning, set CETRAFS_NO_WERROR=1.
Install
There is no make install target. Copy the tools onto your PATH and put the module where modprobe can find it:
sudo install -m 0755 userspace/mkfs.cetra userspace/fsck.cetra userspace/defrag.cetra userspace/growfs.cetra /usr/local/sbin/
sudo install -D -m 0644 kmod/cetrafs.ko /lib/modules/$(uname -r)/extra/cetrafs.ko
sudo depmod -a
That’s all. The module declares the fs-cetrafs alias, so the first mount -t cetrafs loads it, including mounts from /etc/fstab. You don’t need a /etc/modules-load.d entry.
Load by hand (optional)
To try a fresh build without installing it:
sudo insmod kmod/cetrafs.ko
grep cetrafs /proc/filesystems
If insmod fails with an unknown crc32c symbol, your kernel has CRC32C as a module. Run sudo modprobe libcrc32c and retry. (modprobe resolves this by itself; insmod doesn’t.)
With Secure Boot enabled, an unsigned module is refused with Key was rejected by service or Required key not available. Sign it after every build.
A module built this way is a developer build: its test-only parameters can be set, and properties shows test_params: settable. The DKMS and Debian packages build with CETRAFS_RELEASE=1, which locks them. For production, build the same way:
make mod CETRAFS_RELEASE=1
After a kernel upgrade
A module built for one kernel won’t load on another. Rebuild and reinstall after every kernel upgrade, or use DKMS so it happens automatically.
Validate the build (optional)
sudo make check
This runs the loop-device test suite, which takes about 8 hours on one machine. It never touches a real device. See Run the test suites.
Last updated