Blame SOURCES/0229-Add-some-grub_dprintf-in-the-linuxefi-path.patch

a85e8e
From 81bf71f61f9cbcc1c2244788cbe5002a54be65db Mon Sep 17 00:00:00 2001
a85e8e
From: Peter Jones <pjones@redhat.com>
a85e8e
Date: Mon, 9 May 2016 14:15:17 -0400
a85e8e
Subject: [PATCH 229/260] Add some grub_dprintf() in the linuxefi path.
a85e8e
a85e8e
Signed-off-by: Peter Jones <pjones@redhat.com>
a85e8e
---
a85e8e
 grub-core/loader/efi/linux.c      | 16 +++++++++++++---
a85e8e
 grub-core/loader/i386/efi/linux.c | 10 +++++++++-
a85e8e
 2 files changed, 22 insertions(+), 4 deletions(-)
a85e8e
a85e8e
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
a85e8e
index 8890bdf05..dbf63e20e 100644
a85e8e
--- a/grub-core/loader/efi/linux.c
a85e8e
+++ b/grub-core/loader/efi/linux.c
a85e8e
@@ -43,12 +43,22 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size)
a85e8e
   shim_lock = grub_efi_locate_protocol(&guid, NULL);
a85e8e
   grub_dprintf ("secureboot", "shim_lock: %p\n", shim_lock);
a85e8e
   if (!shim_lock)
a85e8e
-    return 0;
a85e8e
+    {
a85e8e
+      grub_dprintf ("secureboot", "shim not available\n");
a85e8e
+      return 0;
a85e8e
+    }
a85e8e
 
a85e8e
-  status = shim_lock->verify(data, size);
a85e8e
+  grub_dprintf ("secureboot", "Asking shim to verify kernel signature\n");
a85e8e
+  status = shim_lock->verify (data, size);
a85e8e
   grub_dprintf ("secureboot", "shim_lock->verify(): %ld\n", status);
a85e8e
   if (status == GRUB_EFI_SUCCESS)
a85e8e
-    return 1;
a85e8e
+    {
a85e8e
+      grub_dprintf ("secureboot", "Kernel signature verification passed\n");
a85e8e
+      return 1;
a85e8e
+    }
a85e8e
+
a85e8e
+  grub_dprintf ("secureboot", "Kernel signature verification failed (0x%lx)\n",
a85e8e
+		(unsigned long) status);
a85e8e
 
a85e8e
   return -1;
a85e8e
 }
a85e8e
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
a85e8e
index 010bf982d..a95e29700 100644
a85e8e
--- a/grub-core/loader/i386/efi/linux.c
a85e8e
+++ b/grub-core/loader/i386/efi/linux.c
a85e8e
@@ -114,6 +114,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
a85e8e
       goto fail;
a85e8e
     }
a85e8e
 
a85e8e
+  grub_dprintf ("linuxefi", "initrd_mem = %lx\n", (unsigned long) initrd_mem);
a85e8e
+
a85e8e
   params->ramdisk_size = size;
a85e8e
   params->ramdisk_image = (grub_uint32_t)(grub_uint64_t) initrd_mem;
a85e8e
 
a85e8e
@@ -202,6 +204,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
a85e8e
       goto fail;
a85e8e
     }
a85e8e
 
a85e8e
+  grub_dprintf ("linuxefi", "params = %lx\n", (unsigned long) params);
a85e8e
+
a85e8e
   grub_memset (params, 0, 16384);
a85e8e
 
a85e8e
   grub_memcpy (&lh, kernel, sizeof (lh));
a85e8e
@@ -239,6 +243,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
a85e8e
       goto fail;
a85e8e
     }
a85e8e
 
a85e8e
+  grub_dprintf ("linuxefi", "linux_cmdline = %lx\n",
a85e8e
+		(unsigned long)linux_cmdline);
a85e8e
+
a85e8e
   grub_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE));
a85e8e
   grub_create_loader_cmdline (argc, argv,
a85e8e
                               linux_cmdline + sizeof (LINUX_IMAGE) - 1,
a85e8e
@@ -272,9 +279,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
a85e8e
   grub_memcpy (params, &lh, 2 * 512);
a85e8e
 
a85e8e
   params->type_of_loader = 0x21;
a85e8e
+  grub_dprintf("linuxefi", "kernel_mem: %p handover_offset: %08x\n",
a85e8e
+	       kernel_mem, handover_offset);
a85e8e
 
a85e8e
  fail:
a85e8e
-
a85e8e
   if (file)
a85e8e
     grub_file_close (file);
a85e8e
 
a85e8e
-- 
a85e8e
2.13.0
a85e8e