Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring btrfs snapshotter to debian/ubuntu derivatives #2206

Open
rdesaintleger opened this issue Oct 17, 2024 · 1 comment
Open

Bring btrfs snapshotter to debian/ubuntu derivatives #2206

rdesaintleger opened this issue Oct 17, 2024 · 1 comment

Comments

@rdesaintleger
Copy link

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:

  • Adds /usr/lib/elemental/bootloader/*-efi as first in grub modules search path
  • Ensure that MokManager.efi if handled properly when packaged in /usr/lib/elemental/bootloader
  • In docker files copy efi files and modules from green flavor to the target flavor

Additional context

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

  • remove usage of btrfs default subvolume,
  • add an 'active_snap' variable to grub environment file,
  • rework of grub config file to always include a relative prefix (the snapshot path)
  • modify dracut to always have an 'elemental.image' with snapshot path even in active mode
  • ensure in elemental init that /boot/vmlinuz and /boot/initrd are relative links (recursively) so grub can handle them properly
  • maintain an 'active' symlink pointing to the active snapshot in the state directory

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
Copy link
Author

Here is the associated PR : #2207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant