diff options
author | Claudio Carvalho <cclaudio@linux.vnet.ibm.com> | 2016-09-28 05:10:51 -0300 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-10-10 15:29:36 +1100 |
commit | 841ef2517f1acf8b57550d697799c789a2994758 (patch) | |
tree | f7933e2ddf6600f95c1f5cceba4edd535bbecfee /core | |
parent | d15dd47d4a0f766282a034641621529e58ae8b25 (diff) | |
download | skiboot-841ef2517f1acf8b57550d697799c789a2994758.zip skiboot-841ef2517f1acf8b57550d697799c789a2994758.tar.gz skiboot-841ef2517f1acf8b57550d697799c789a2994758.tar.bz2 |
core/init.c: adjust offset to run BOOTKERNEL containers
This adjusts the kernel header offset if BOOTKERNEL is a secure boot
container
Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/init.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/init.c b/core/init.c index 85263f9..bde5637 100644 --- a/core/init.c +++ b/core/init.c @@ -45,6 +45,7 @@ #include <sensor.h> #include <xive.h> #include <nvram.h> +#include <libstb/container.h> enum proc_gen proc_gen; @@ -369,7 +370,11 @@ static bool load_kernel(void) if (!kernel_size) printf("INIT: Assuming kernel at %p\n", KERNEL_LOAD_BASE); - kh = (struct elf_hdr *)KERNEL_LOAD_BASE; + if (stb_is_container(KERNEL_LOAD_BASE, kernel_size)) + kh = (struct elf_hdr *) (KERNEL_LOAD_BASE + + SECURE_BOOT_HEADERS_SIZE); + else + kh = (struct elf_hdr *) (KERNEL_LOAD_BASE); } printf("INIT: Kernel loaded, size: %zu bytes (0 = unknown preload)\n", |