diff options
author | Kenneth J. Miller <ken@miller.ec> | 2021-03-18 13:55:01 +0100 |
---|---|---|
committer | Kenneth J. Miller <ken@miller.ec> | 2021-03-18 14:31:28 +0100 |
commit | cfe313afae7aff392442838420125e2c73102aa9 (patch) | |
tree | caaf5626346d280ebd97c12d6a6f831751568bce /src/libostree | |
parent | 407477f1911499f843300956af6beb303facd06b (diff) | |
download | ostree-cfe313afae7aff392442838420125e2c73102aa9.tar.gz |
Add configure option for unsuffixed GRUB2 commands
GRUB starting with version 2.02 permits the use of the linux and
initrd commands for both EFI boot in *-efi installations, as
well as 32-bit BIOS boot in i386-pc installations.
This makes the use of the -16 and -efi suffixes for BIOS and EFI
boot obsolete on systems with a modern GRUB installation.
The --with-modern-grub configure flag makes ostree use the
unsuffixed linux/initrd commands when generating a GRUB
configuration, while defaulting to the previous behaviour for
users not wanted this option.
Diffstat (limited to 'src/libostree')
-rw-r--r-- | src/libostree/ostree-bootloader-grub2.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/libostree/ostree-bootloader-grub2.c b/src/libostree/ostree-bootloader-grub2.c index ceea682e..0ef751dc 100644 --- a/src/libostree/ostree-bootloader-grub2.c +++ b/src/libostree/ostree-bootloader-grub2.c @@ -28,25 +28,26 @@ #include <string.h> -/* I only did some cursory research here, but it appears - * that we only want to use "linux16" for x86 platforms. - * At least, I got a report that "linux16" is definitely wrong - * for ppc64. See - * http://pkgs.fedoraproject.org/cgit/rpms/grub2.git/tree/0036-Use-linux16-when-appropriate-880840.patch?h=f25 - * https://bugzilla.redhat.com/show_bug.cgi?id=1108296 - * among others. +/* Maintain backwards compatibility with legacy GRUB + * installations that might rely on the -16 suffix + * for real-mode booting. + * Allow us to override this at build time if we're + * using a modern GRUB installation. */ -#if defined(__i386__) || defined(__x86_64__) +#if !defined(WITH_MODERN_GRUB) && ( defined(__i386__) || defined(__x86_64__) ) #define GRUB2_SUFFIX "16" #else #define GRUB2_SUFFIX "" #endif -/* https://github.com/projectatomic/rpm-ostree-toolbox/issues/102#issuecomment-316483554 - * https://github.com/rhboot/grubby/blob/34b1436ccbd56eab8024314cab48f2fc880eef08/grubby.c#L63 - * - * This is true at least on Fedora/Red Hat Enterprise Linux for aarch64. +/* Maintain backwards compatibility with legacy GRUB + * installations that might rely on the -efi suffix + * for RHEL/fedora-based distros. + * Allow us to override this at build time if we're + * using a modern GRUB installation that makes the + * suffix-less linux/initrd commands synonymous for + * both EFI and BIOS booting. */ -#if defined(__aarch64__) +#if defined(WITH_MODERN_GRUB) || defined(__aarch64__) #define GRUB2_EFI_SUFFIX "" #else #define GRUB2_EFI_SUFFIX "efi" |