cbfstool: account for the trampoline code in bzImage payload

For bzImages the trampoline segment is added unconditionally.
However, that segment wasn't properly being accounted for.
Explicitly add the trampoline segments like the other ones.

Change-Id: I74f6fcc2a65615bb87578a8a3a76cecf858fe856
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/5702
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
Aaron Durbin 2014-05-08 11:54:25 -05:00 committed by Patrick Georgi
parent 639f02b3ba
commit b275757212
1 changed files with 9 additions and 2 deletions

View File

@ -67,8 +67,6 @@ static int bzp_init(struct bzpayload *bzp, comp_algo algo)
*/
bzp->num_segments = 1;
buffer_init(&bzp->trampoline, NULL, trampoline_start, trampoline_size);
bzp->algo = algo;
bzp->compress = compression_function(algo);
if (bzp->compress == NULL) {
@ -101,6 +99,12 @@ static void bzp_add_segment(struct bzpayload *bzp, struct buffer *b, void *data,
bzp->num_segments++;
}
static int bzp_add_trampoline(struct bzpayload *bzp)
{
bzp_add_segment(bzp, &bzp->trampoline, trampoline_start,
trampoline_size);
return 0;
}
static int bzp_add_cmdline(struct bzpayload *bzp, char *cmdline)
{
@ -209,6 +213,9 @@ int parse_bzImage_to_payload(const struct buffer *input,
if (bzp_init(&bzp, algo) != 0)
return -1;
if (bzp_add_trampoline(&bzp) != 0)
return -1;
if (bzp_add_initrd(&bzp, initrd_name) != 0)
return -1;