bfcfs-freebsd
A FreeBSD 14.3+ kernel module that mounts BFC containers read-only — files, directories and symlinks, with optional CRC32C verification.
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 vfsopsregistered withVFS_SET(..., VFCF_READONLY); the source file is resolved withnamei. - A
vop_vectorimplements lookup, open, read, readdir and getattr; vnodes come fromgetnewvnode, and create or rename lookups are refused. - The header, footer and index are parsed into memory at mount; reads go through
VOP_READon the backing vnode, with the kernel’scalculate_crc32c()for verification. - Mount options:
ro(required) andnoverify. 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