Blame SOURCES/0347-rhel-extra-file-type-fixes.patch

80913e
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
80913e
From: Daniel Axtens <dja@axtens.net>
80913e
Date: Tue, 12 May 2020 17:26:26 +1000
80913e
Subject: [PATCH] rhel: extra file type fixes
80913e
80913e
Signed-off-by: Daniel Axtens <dja@axtens.net>
80913e
[javierm: fix a couple of build errors caused by mismerges]
80913e
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
80913e
---
80913e
 grub-core/commands/blscfg.c         | 2 +-
80913e
 grub-core/loader/arm64/linux.c      | 1 +
80913e
 grub-core/loader/i386/efi/linux.c   | 9 +++++----
80913e
 grub-core/net/net.c                 | 2 +-
80913e
 grub-core/normal/main.c             | 2 +-
80913e
 grub-core/osdep/generic/blocklist.c | 4 ++--
80913e
 6 files changed, 11 insertions(+), 9 deletions(-)
80913e
80913e
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
b32e65
index 70ce5c7bf..795a9f9f1 100644
80913e
--- a/grub-core/commands/blscfg.c
80913e
+++ b/grub-core/commands/blscfg.c
80913e
@@ -463,7 +463,7 @@ static int read_entry (
80913e
 
80913e
   p = grub_xasprintf ("(%s)%s/%s", info->devid, info->dirname, filename);
80913e
 
80913e
-  f = grub_file_open (p);
80913e
+  f = grub_file_open (p, GRUB_FILE_TYPE_CONFIG);
80913e
   if (!f)
80913e
     goto finish;
80913e
 
80913e
diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c
b32e65
index 864724dd4..e1923cf72 100644
80913e
--- a/grub-core/loader/arm64/linux.c
80913e
+++ b/grub-core/loader/arm64/linux.c
80913e
@@ -31,6 +31,7 @@
80913e
 #include <grub/efi/memory.h>
80913e
 #include <grub/efi/linux.h>
80913e
 #include <grub/efi/pe32.h>
80913e
+#include <grub/efi/sb.h>
80913e
 #include <grub/i18n.h>
80913e
 #include <grub/lib/cmdline.h>
80913e
 #include <grub/verify.h>
80913e
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
b32e65
index 361e503cb..576f8c07e 100644
80913e
--- a/grub-core/loader/i386/efi/linux.c
80913e
+++ b/grub-core/loader/i386/efi/linux.c
80913e
@@ -101,8 +101,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
80913e
 
80913e
   for (i = 0; i < argc; i++)
80913e
     {
80913e
-      grub_file_filter_disable_compression ();
80913e
-      files[i] = grub_file_open (argv[i]);
80913e
+      files[i] = grub_file_open (argv[i], GRUB_FILE_TYPE_LINUX_INITRD |
80913e
+				 GRUB_FILE_TYPE_NO_DECOMPRESS);
80913e
       if (! files[i])
80913e
         goto fail;
80913e
       nfiles++;
80913e
@@ -182,7 +182,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
@@ -302,7 +302,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
80913e
   grub_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE));
80913e
   grub_create_loader_cmdline (argc, argv,
80913e
                               linux_cmdline + sizeof (LINUX_IMAGE) - 1,
80913e
-			      lh->cmdline_size - (sizeof (LINUX_IMAGE) - 1));
80913e
+			      lh->cmdline_size - (sizeof (LINUX_IMAGE) - 1),
80913e
+			      GRUB_VERIFY_KERNEL_CMDLINE);
80913e
 
80913e
   grub_dprintf ("linux", "cmdline:%s\n", linux_cmdline);
80913e
   grub_dprintf ("linux", "setting lh->cmd_line_ptr\n");
80913e
diff --git a/grub-core/net/net.c b/grub-core/net/net.c
b32e65
index 0e72bbb9b..1fd104aea 100644
80913e
--- a/grub-core/net/net.c
80913e
+++ b/grub-core/net/net.c
80913e
@@ -1907,7 +1907,7 @@ grub_net_search_configfile (char *config)
80913e
 	  grub_dprintf ("net", "probe %s\n", config);
80913e
 
80913e
           grub_file_t file;
80913e
-          file = grub_file_open (config);
80913e
+          file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG);
80913e
 
80913e
           if (file)
80913e
             {
80913e
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
b32e65
index cee71a4c2..49141039f 100644
80913e
--- a/grub-core/normal/main.c
80913e
+++ b/grub-core/normal/main.c
80913e
@@ -363,7 +363,7 @@ grub_try_normal (const char *variable)
80913e
 	if (config)
80913e
 	  {
80913e
 	    grub_file_t file;
80913e
-	    file = grub_file_open (config);
80913e
+	    file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG);
80913e
 	    if (file)
80913e
 	      {
80913e
 		grub_file_close (file);
80913e
diff --git a/grub-core/osdep/generic/blocklist.c b/grub-core/osdep/generic/blocklist.c
b32e65
index 74024fd06..ab1f96da6 100644
80913e
--- a/grub-core/osdep/generic/blocklist.c
80913e
+++ b/grub-core/osdep/generic/blocklist.c
80913e
@@ -60,7 +60,7 @@ grub_install_get_blocklist (grub_device_t root_dev,
80913e
       grub_disk_cache_invalidate_all ();
80913e
 
80913e
       grub_file_filter_disable_compression ();
80913e
-      file = grub_file_open (core_path_dev);
80913e
+      file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE);
80913e
       if (file)
80913e
 	{
80913e
 	  if (grub_file_size (file) != core_size)
80913e
@@ -118,7 +118,7 @@ grub_install_get_blocklist (grub_device_t root_dev,
80913e
   grub_file_t file;
80913e
   /* Now read the core image to determine where the sectors are.  */
80913e
   grub_file_filter_disable_compression ();
80913e
-  file = grub_file_open (core_path_dev);
80913e
+  file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE);
80913e
   if (! file)
80913e
     grub_util_error ("%s", grub_errmsg);
80913e