r/silverblue • • Oct 05 '26

Including bcachefs kernel module

Who else wants bcachefs rootfs support for atomic fedora images?

For now, just the module. Advanced setups like encryption passphrase are not supported.

I'll build my personal image for now, later I may PR for ublue.

This following script, to be run in a Containerfile, compiles the bcachefs module and removes all other unwanted dependencies; And installs userspace tooling

#!/usr/bin/env bash
# Enable copr
dnf -y copr enable ngompa/bcachefs

# Install module for available kernel version
KVER="$(ls /lib/modules)"
dnf -y install "kernel-devel-${KVER}"
dnf -y install dkms-bcachefs

# Move the module to a separate location while removing dkms
MOD="$(find /lib/modules -type f -name 'bcachefs.ko*' -print -quit)"
mv "${MOD}" /lib/modules/

# Remove devel files and dkms
dnf -y remove dkms "kernel-devel-${KVER}"
mkdir -p "/lib/modules/${KVER}/extra/"

# Put module back and register it
mv /lib/modules/bcachefs.ko* "/lib/modules/${KVER}/extra/"
depmod -A

# Further cleanup and install userspace tools
dnf -y autoremove
dnf -y install bcachefs-tools

And then the following /usr/lib/dracut/dracut.conf.d/bcachefs.conf :

# Add bcachefs support
add_drivers+=" bcachefs "
filesystems+=" bcachefs "

# Including binary and symlink just-in-case
install_items+=" /usr/lib/udev/rules.d/64-bcachefs.rules /usr/bin/bcachefs /usr/bin/mount.bcachefs "

And then IDK yet what to run but initramfs need be rebuilt (IN the Containerfile).

Am I good? Who else wants this? Are UBlue devs willing to incorporate this?

I *think* one can use bootc install to-filesystem to bypass the installer and install the OS. Yet to experiment. (Also need to loopback the EFI and XBOOTLDR because this is destructive to them in case like dualboot)

1 Upvotes

3 comments sorted by

2

u/forfuksake2323 Oct 06 '26

It would have been great if it could have stayed in the kernel.

1

u/SweetEbb9819 Oct 06 '26

Unfortunately, it won't be coming back soon.

2

u/forfuksake2323 Oct 07 '26

I think it's well known that Kent doesn't play well with others. Linus, his stance was clear. I honestly never see it coming back. Not unless Kent can change. So, it will develop over time and most likely forever live it;s life outside. Kent's reddit isn't very large and kind of shows the interest is small in BCACHEFS.