Measure kernel and initrd on BIOS systems

Measure the kernel and initrd when loaded on BIOS systems
This commit is contained in:
Matthew Garrett 2015-08-09 16:28:29 -07:00
parent 738f6f09b3
commit 20e355fd5a
3 changed files with 10 additions and 0 deletions

View file

@ -35,6 +35,7 @@
#include <grub/i386/floppy.h>
#include <grub/lib/cmdline.h>
#include <grub/linux.h>
#include <grub/tpm.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -160,6 +161,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
grub_tpm_measure (kernel, len, GRUB_KERNEL_PCR, "BIOS Linux Kernel");
grub_memcpy (&lh, kernel, sizeof (lh));
kernel_offset = sizeof (lh);