rancher / elemental-toolkit

:snowflake: The toolkit to build, ship and maintain cloud-init driven Linux derivatives based on container images
https://rancher.github.io/elemental-toolkit/docs/
Apache License 2.0
290 stars 52 forks source link

Bring btrfs snapshotter to debian/ubuntu derivatives #2206

Open rdesaintleger opened 2 hours ago

rdesaintleger commented 2 hours ago

Is your feature request related to a problem? Please describe.

Need to add btrfs support for debian derivative distros

Describe the solution you'd like

The snapshotter implementation is actually dependant of btrfs default subvolume which create a dependency over the Opensuse grub implementation. Ideally Grub configuration should be able to boot any distro without depending on the btrfs subvolumes handled by grub.

Describe alternatives you've considered

As a first try. I bundled Opensuze grub implementation in /usr/lib/elemental (added also modules in /usr/lib/elemental/bootloader/*-efi). this solution works quite well (packaging only efi executables and modules). However I don't find this solution elegant. Repackaging a full bootloader (compiling and installing from sources relevant packages under /usr/lib/elemental) would be far more better but It takes a huge amount of work both for initial implementation and maintenance over time as grub is a heavilly patched package.

This solution requires minor modifications to the sources and works quite well. Basically it add the following:

Additional context

I've set up a working configuration with modified snapshotter. It implements the following changes:

Removing usage of default subvolume make elemental work with any distro grub implementation (a least tested with debian trixie/bookworm, ubuntu and tumbleweed). However it is a breaking change over existing btrfs installed elementals.

rdesaintleger commented 2 hours ago

Here is the associated PR : #2207