Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grub-install on EFI if forced #135

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 26 additions & 16 deletions util/grub-install.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,22 +899,6 @@ main (int argc, char *argv[])

platform = grub_install_get_target (grub_install_source_directory);

switch (platform)
{
case GRUB_INSTALL_PLATFORM_ARM_EFI:
case GRUB_INSTALL_PLATFORM_ARM64_EFI:
case GRUB_INSTALL_PLATFORM_I386_EFI:
case GRUB_INSTALL_PLATFORM_IA64_EFI:
case GRUB_INSTALL_PLATFORM_X86_64_EFI:
is_efi = 1;
grub_util_error (_("this utility cannot be used for EFI platforms"
" because it does not support UEFI Secure Boot"));
break;
default:
is_efi = 0;
break;
}

{
char *platname = grub_install_get_platform_name (platform);
fprintf (stderr, _("Installing for %s platform.\n"), platname);
Expand Down Expand Up @@ -1027,6 +1011,32 @@ main (int argc, char *argv[])
grub_hostfs_init ();
grub_host_init ();

switch (platform)
{
case GRUB_INSTALL_PLATFORM_I386_EFI:
case GRUB_INSTALL_PLATFORM_X86_64_EFI:
case GRUB_INSTALL_PLATFORM_ARM_EFI:
case GRUB_INSTALL_PLATFORM_ARM64_EFI:
case GRUB_INSTALL_PLATFORM_RISCV32_EFI:
case GRUB_INSTALL_PLATFORM_RISCV64_EFI:
case GRUB_INSTALL_PLATFORM_IA64_EFI:
is_efi = 1;
if (!force)
grub_util_error (_("This utility should not be used for EFI platforms"
" because it does not support UEFI Secure Boot."
" If you really wish to proceed, invoke the --force"
" option.\nMake sure Secure Boot is disabled before"
" proceeding"));
break;
default:
is_efi = 0;
break;

/* pacify warning. */
case GRUB_INSTALL_PLATFORM_MAX:
break;
}

/* Find the EFI System Partition. */
if (is_efi)
{
Expand Down