Skip to content

Commit

Permalink
bootloader: rely on unified GRUB configuration for UEFI and BIOS
Browse files Browse the repository at this point in the history
With the unified GRUB configuration in Fedora and EL, the bootloader setup no longer requires
a custom EFI stub config. The grub2-common package automatically generates this stub,
which points to a single, hybrid configuration file at /boot/grub2/grub.cfg.

This patch simplifies the code by removing redundant EFI-specific configuration steps and
relying on grub2-common to handle the UEFI stub creation.
  • Loading branch information
KKoukiou committed Nov 14, 2024
1 parent 50e55fd commit dce1612
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
2 changes: 2 additions & 0 deletions anaconda.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ Requires: python3-pid
Requires: crypto-policies
Requires: crypto-policies-scripts

Requires: grub2-common

# required because of the rescue mode and RDP question
Requires: anaconda-tui = %{version}-%{release}

Expand Down
22 changes: 1 addition & 21 deletions pyanaconda/modules/storage/bootloader/efi.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,27 +178,7 @@ def efi_config_file(self):
return "%s/%s" % (self.efi_config_dir, self._config_file)

def write_config(self):
config_path = "%s%s" % (conf.target.system_root, self.efi_config_file)

with open(config_path, "w") as fd:
grub_dir = self.config_dir
if self.stage2_device.format.type != "btrfs":
fs_uuid = self.stage2_device.format.uuid
else:
fs_uuid = self.stage2_device.format.vol_uuid

if fs_uuid is None:
raise BootLoaderError("Could not get stage2 filesystem UUID")

grub_dir = util.execWithCapture("grub2-mkrelpath", [grub_dir],
root=conf.target.system_root)
if not grub_dir:
raise BootLoaderError("Could not get GRUB directory path")

fd.write("search --no-floppy --fs-uuid --set=dev %s\n" % fs_uuid)
fd.write("set prefix=($dev)%s\n" % grub_dir)
fd.write("export $prefix\n")
fd.write("configfile $prefix/grub.cfg\n")
""" Use the unified GRUB configuration provided by grub2-common. """

super().write_config()

Expand Down

0 comments on commit dce1612

Please sign in to comment.