dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0339-arm-uboot-ia64-sparc64-Fix-up-grub_file_open-calls.patch

80913e
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
80913e
From: Leif Lindholm <leif.lindholm@linaro.org>
80913e
Date: Wed, 14 Nov 2018 19:29:19 +0000
80913e
Subject: [PATCH] arm-uboot, ia64, sparc64: Fix up grub_file_open() calls
80913e
80913e
The verifiers framework changed the grub_file_open() interface, breaking all
80913e
non-x86 linux loaders. Add file types to the grub_file_open() calls to make
80913e
them build again.
80913e
80913e
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
80913e
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
80913e
---
80913e
 grub-core/loader/arm/linux.c              | 6 +++---
80913e
 grub-core/loader/ia64/efi/linux.c         | 2 +-
80913e
 grub-core/loader/sparc64/ieee1275/linux.c | 2 +-
80913e
 3 files changed, 5 insertions(+), 5 deletions(-)
80913e
80913e
diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c
80913e
index beceda52030..1e944a2b671 100644
80913e
--- a/grub-core/loader/arm/linux.c
80913e
+++ b/grub-core/loader/arm/linux.c
80913e
@@ -363,7 +363,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
80913e
   if (argc == 0)
80913e
     return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
80913e
 
80913e
-  file = grub_file_open (argv[0]);
80913e
+  file = grub_file_open (argv[0], GRUB_FILE_TYPE_LINUX_KERNEL);
80913e
   if (!file)
80913e
     goto fail;
80913e
 
80913e
@@ -408,7 +408,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
80913e
   if (argc == 0)
80913e
     return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
80913e
 
80913e
-  file = grub_file_open (argv[0]);
80913e
+  file = grub_file_open (argv[0], GRUB_FILE_TYPE_LINUX_INITRD);
80913e
   if (!file)
80913e
     return grub_errno;
80913e
 
80913e
@@ -471,7 +471,7 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)),
80913e
   if (argc != 1)
80913e
     return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
80913e
 
80913e
-  dtb = grub_file_open (argv[0]);
80913e
+  dtb = grub_file_open (argv[0], GRUB_FILE_TYPE_DEVICE_TREE_IMAGE);
80913e
   if (!dtb)
80913e
     return grub_errno;
80913e
 
80913e
diff --git a/grub-core/loader/ia64/efi/linux.c b/grub-core/loader/ia64/efi/linux.c
80913e
index e325fe0ee83..2ad0b0c0407 100644
80913e
--- a/grub-core/loader/ia64/efi/linux.c
80913e
+++ b/grub-core/loader/ia64/efi/linux.c
80913e
@@ -502,7 +502,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
80913e
       goto fail;
80913e
     }
80913e
 
80913e
-  file = grub_file_open (argv[0]);
80913e
+  file = grub_file_open (argv[0], GRUB_FILE_TYPE_LINUX_KERNEL);
80913e
   if (! file)
80913e
     goto fail;
80913e
 
80913e
diff --git a/grub-core/loader/sparc64/ieee1275/linux.c b/grub-core/loader/sparc64/ieee1275/linux.c
80913e
index abe46faa012..bb47ee0cc64 100644
80913e
--- a/grub-core/loader/sparc64/ieee1275/linux.c
80913e
+++ b/grub-core/loader/sparc64/ieee1275/linux.c
80913e
@@ -306,7 +306,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
80913e
       goto out;
80913e
     }
80913e
 
80913e
-  file = grub_file_open (argv[0]);
80913e
+  file = grub_file_open (argv[0], GRUB_FILE_TYPE_LINUX_KERNEL);
80913e
   if (!file)
80913e
     goto out;
80913e