[coreboot-gerrit] New patch to review for coreboot: 6974d63 cbfstool: account for the trampoline code in bzImage payload

Aaron Durbin (adurbin@google.com) gerrit at coreboot.org
Thu May 8 18:57:24 CEST 2014


Aaron Durbin (adurbin at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5702

-gerrit

commit 6974d6308f59fbcf6712159a55713f68f76f1f43
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Thu May 8 11:54:25 2014 -0500

    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 at chromium.org>
---
 util/cbfstool/cbfs-payload-linux.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/util/cbfstool/cbfs-payload-linux.c b/util/cbfstool/cbfs-payload-linux.c
index 12fa238..33a5e1a 100644
--- a/util/cbfstool/cbfs-payload-linux.c
+++ b/util/cbfstool/cbfs-payload-linux.c
@@ -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;
 



More information about the coreboot-gerrit mailing list