]> git.proxmox.com Git - grub2.git/commitdiff
Fall back to arm-uboot if booted using EFI but -efi is missing
authorSteve McIntyre <93sam@debian.org>
Tue, 26 Feb 2019 14:14:17 +0000 (14:14 +0000)
committerSteve McIntyre <93sam@debian.org>
Tue, 25 Jun 2019 09:11:12 +0000 (10:11 +0100)
It may be possible, particularly in recovery situations, to be booted
using EFI on ARM when only the arm-uboot target is installed.  There's
nothing actually stopping us installing arm-uboot from an EFI
environment, and it's better than returning a confusing error.

(When convenient, this patch should be merged with
install_efi_fallback.patch.)

Forwarded: no
Last-Update: 2019-02-26

Patch-Name: install_efi_fallback_arm.patch

Gbp-Pq: Name install_efi_fallback_arm.patch

grub-core/osdep/linux/platform.c

index 54a9b9eccc72fea7f97c51640976cb0e6dbb9342..fae85430cac491c3267e4f837e7f16a221de8c77 100644 (file)
@@ -114,8 +114,21 @@ grub_install_get_default_arm_platform (void)
   grub_util_info ("Looking for /sys/firmware/efi ..");
   if (is_not_empty_directory ("/sys/firmware/efi"))
     {
+      const char *pkglibdir = grub_util_get_pkglibdir ();
+      const char *platform;
+      char *pd;
+      int found;
+
       grub_util_info ("...found");
-      return "arm-efi";
+      platform = "arm-efi";
+
+      pd = grub_util_path_concat (2, pkglibdir, platform);
+      found = grub_util_is_directory (pd);
+      free (pd);
+      if (found)
+       return platform;
+      else
+       grub_util_info ("... but %s platform not available", platform);
     }
 
   grub_util_info ("... not found");