bfcfs-freebsd

A FreeBSD 14.3+ kernel module that mounts BFC containers read-only — files, directories and symlinks, with optional CRC32C verification.

Cfreebsd · kernel · vfs · read-onlybfc & filesystemssource on github

Why

Read-only mounts of single-file containers on FreeBSD: static sites, application assets, software distribution, embedded systems — one file to ship, a normal directory tree to read.

How

  • A struct vfsops registered with VFS_SET(..., VFCF_READONLY); the source file is resolved with namei.
  • A vop_vector implements lookup, open, read, readdir and getattr; vnodes come from getnewvnode, and create or rename lookups are refused.
  • The header, footer and index are parsed into memory at mount; reads go through VOP_READ on the backing vnode, with the kernel’s calculate_crc32c() for verification.
  • Mount options: ro (required) and noverify. Tested with ATF/Kyua against a fixture container in FreeBSD CI.

Status

Handles uncompressed, unencrypted objects; ZSTD and ChaCha20-Poly1305 are on the roadmap, together with xattrs. It already goes further than the Linux driver on symlinks.

doas kldload ./bfcfs.ko
doas mount -t bfcfs -o ro,noverify /home/user/mysite.bfc /mnt/bfc
$ git clone https://github.com/zombocoder/bfcfs-freebsd
← all projects