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

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