diff options
author | Icenowy Zheng <uwu@icenowy.me> | 2022-04-24 15:36:33 +0800 |
---|---|---|
committer | Daniel Kiper <daniel.kiper@oracle.com> | 2022-05-24 13:56:30 +0200 |
commit | 3aec0854104159f41ed6d45baeb551f8743f5ee8 (patch) | |
tree | 2b6c11bb53fde460d668c6f3dfd28ce9dc21fcdd | |
parent | 63d3211403fad20a6431562bcaab01751ae4c00f (diff) | |
download | grub-3aec0854104159f41ed6d45baeb551f8743f5ee8.tar.gz |
grub-install: Allow to install to non-EFI ESP when --force
Although the EFI specification enforces support for FAT ESP, it's free
for EFI implementations to implement support for ESPs with other formats
(e.g. ext4, ntfs, etc), and at least U-Boot EFI will support ext4 ESP if
U-Boot is built with ext4 support. In some situations a GRUB installation
on such a non-FAT ESP could be useful (e.g. a NTFS-based USB disk that
can dual boot a Windows installation media and a Linux LiveCD).
As this is advanced and implementation-dependent behavior, let grub-install
allow this kind of installation, but only when --force is specified.
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
-rw-r--r-- | util/grub-install.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/grub-install.c b/util/grub-install.c index d601c3e8d..7b04bd3c5 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1092,7 +1092,12 @@ main (int argc, char *argv[]) efidir_is_mac = 1; if (!efidir_is_mac && grub_strcmp (fs->name, "fat") != 0) - grub_util_error (_("%s doesn't look like an EFI partition"), efidir); + { + if (force) + grub_util_warn (_("%s doesn't look like an EFI partition, system may not boot"), efidir); + else + grub_util_error (_("%s doesn't look like an EFI partition"), efidir); + } /* The EFI specification requires that an EFI System Partition must contain an "EFI" subdirectory, and that OS loaders are stored in |