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