summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfs-payload-linux.c
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@google.com>2016-09-28 10:43:12 -0700
committerRonald G. Minnich <rminnich@gmail.com>2016-09-28 23:05:00 +0200
commitfa74e4705dbb5ecf5ba466fd6a9bc309f7e3e8bf (patch)
treecbbc9a8dfe6e49b6d9c8d85892bf80497044a815 /util/cbfstool/cbfs-payload-linux.c
parent6d16e1ff87f31ff558cea76741f5675763d4ab44 (diff)
cbfstool: set init_size for linux payloads.
We were not setting the init_size for linux payloads. A proper value of init_size is required if the kernel is x86_64. This is tested in qemu and fixes the observed problem that 974f221c84b05b1dc2f5ea50dc16d2a9d1e95eda and later would not boot, and would in fact fail in head_64.S. Change-Id: I254c13d16b1e014a6f1d4fd7c39b1cfe005cd9b0 Signed-off-by: Ronald G. Minnich <rminnich@google.com> Reviewed-on: https://review.coreboot.org/16781 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'util/cbfstool/cbfs-payload-linux.c')
-rw-r--r--util/cbfstool/cbfs-payload-linux.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/cbfstool/cbfs-payload-linux.c b/util/cbfstool/cbfs-payload-linux.c
index 03a41cd7f4..afb0f3ac71 100644
--- a/util/cbfstool/cbfs-payload-linux.c
+++ b/util/cbfstool/cbfs-payload-linux.c
@@ -220,14 +220,19 @@ int parse_bzImage_to_payload(const struct buffer *input,
if (hdr->setup_sects != 0) {
setup_size = (hdr->setup_sects + 1) * 512;
+ } else {
+ WARN("hdr->setup_sects is 0, which could cause boot problems.\n");
}
/* Setup parameter block. Imitate FILO. */
struct linux_params params;
memset(&params, 0, sizeof(struct linux_params));
+
params.mount_root_rdonly = hdr->root_flags;
params.orig_root_dev = hdr->root_dev;
+ params.init_size = hdr->init_size;
+
/* Sensible video defaults. Might be overridden on runtime by coreboot tables. */
params.orig_video_mode = 3;
params.orig_video_cols = 80;
@@ -262,6 +267,10 @@ int parse_bzImage_to_payload(const struct buffer *input,
* so if possible (relocatable kernel) use that to
* avoid a trampoline copy. */
kernel_base = ALIGN(16*1024*1024, params.kernel_alignment);
+ if (hdr->init_size == 0) {
+ ERROR("init_size 0 for relocatable kernel\n");
+ return -1;
+ }
}
}