aboutsummaryrefslogtreecommitdiff
path: root/core/flash.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-03-19 16:59:12 +1100
committerStewart Smith <stewart@linux.ibm.com>2018-04-11 17:59:57 -0500
commite7a2da8d5e654467df63c03e2be91b435796df25 (patch)
tree789e07b7a962ec41b875b949fe07047613733943 /core/flash.c
parent217e5a4ecbfab8e88b6e250d5d8fdfe502cfe5da (diff)
downloadskiboot-e7a2da8d5e654467df63c03e2be91b435796df25.zip
skiboot-e7a2da8d5e654467df63c03e2be91b435796df25.tar.gz
skiboot-e7a2da8d5e654467df63c03e2be91b435796df25.tar.bz2
core: Correctly load initramfs in stb container
Skiboot does not calculate the actual size and start location of the initramfs if it is wrapped by an STB container (for example if loading an initramfs from the ROOTFS partition). Check if the initramfs is in an STB container and determine the size and location correctly in the same manner as the kernel. Since load_initramfs() is called after load_kernel() move the call to trustedboot_exit_boot_services() into load_and_boot_kernel() so it is called after both of these. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core/flash.c')
-rw-r--r--core/flash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/flash.c b/core/flash.c
index 7140e94..4031e7b 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -748,7 +748,8 @@ static int flash_load_resource(enum resource_id id, uint32_t subid,
* Back to the old way of doing things, no STB header.
*/
if (subid == RESOURCE_SUBID_NONE) {
- if (id == RESOURCE_ID_KERNEL) {
+ if (id == RESOURCE_ID_KERNEL ||
+ id == RESOURCE_ID_INITRAMFS) {
/*
* Because actualSize is a lie, we compute the
* size of the BOOTKERNEL based on what the ELF