Skip to content

feat: add auto-detection for Fedora distribution - #428

Merged
Antynea merged 1 commit into
Antynea:masterfrom
reynegton:add-fedora-suport
May 10, 2026
Merged

Antynea merged 1 commit into
Antynea:masterfrom
reynegton:add-fedora-suport

Conversation

@reynegton

Copy link
Copy Markdown
Contributor

Fedora uses non-standard paths and command names for GRUB (e.g., /boot/grub2 instead of /boot/grub, and grub2-mkconfig). This change adds a conditional block to detect Fedora via /etc/fedora-release and automatically sets the appropriate variables, improving the out-of-the-box experience for Fedora users.

@reynegton

reynegton commented May 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi @Antynea,

I’m opening this PR because I recently tried to set up grub-btrfs on Fedora and realized it doesn't work out-of-the-box. Due to Fedora's specific
naming conventions and directory structure, the script fails to locate the necessary GRUB files and commands by default.

With this patch, grub-btrfs becomes 100% "plug and play" for Fedora users.

Detailed changes and reasoning:
The PR adds an auto-detection block that triggers when /etc/fedora-release is detected. It automatically sets the following variables to match
Fedora's standards:

  GRUB_BTRFS_GRUB_DIRNAME & GRUB_BTRFS_GBTRFS_DIRNAME*: Changed to /boot/grub2. Unlike many other distros that use /boot/grub, Fedora explicitly

uses the grub2 suffix for its boot directory.
GRUB_BTRFS_MKCONFIG*: Changed to grub2-mkconfig. Fedora does not provide a grub-mkconfig binary; it uses the grub2- prefixed version.
GRUB_BTRFS_SCRIPT_CHECK*: Changed to grub2-script-check. Similar to the above, this follows Fedora's command naming scheme.

Before these changes, a Fedora user would have to manually investigate why the snapshots weren't appearing and then edit the config file. This
update removes that friction entirely.

I've verified this on Fedora 44 and confirmed that the snapshots are now correctly generated and added to the menu without any manual
intervention.

Let me know if you have any questions!

Fedora uses non-standard paths and command names for GRUB (e.g., /boot/grub2 instead of /boot/grub, and grub2-mkconfig).
This change adds a conditional block to detect Fedora via /etc/fedora-release and automatically sets the appropriate variables, improving the out-of-the-box experience for Fedora users.
@reynegton
reynegton force-pushed the add-fedora-suport branch from c1c7887 to d45a6ce Compare May 7, 2026 16:23
@Antynea

Antynea commented May 7, 2026

Copy link
Copy Markdown
Owner

Hi @reynegton,
That’s right, Fedora uses specific naming conventions and directory structures that haven’t changed for several versions.
The Makefile also includes detection for Fedora, but the config file needs to be edited manually.

Thanks for your time, I’ll merge your PR.

@Antynea
Antynea merged commit a181e2c into Antynea:master May 10, 2026
1 check passed
@reynegton

Copy link
Copy Markdown
Contributor Author

thanks!

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

Successfully merging this pull request may close these issues.

2 participants