This script automates the process of restoring the Fedora GRUB bootloader on a UEFI system after it has been removed or overwritten, typically by a Windows installation.
It is designed for a common Fedora setup: a LUKS-encrypted BTRFS root partition and a separate /boot partition. The script performs the following actions:
- Prompts for the LUKS encryption password to unlock the Fedora system partition.
- Correctly mounts the BTRFS
rootsubvolume, the/bootpartition, and the EFI System Partition (ESP). - Binds the necessary system directories from the live environment.
- Executes a
chrootcommand to run commands inside the installed Fedora system.