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

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