diff options
author | Milton Miller <miltonm@bga.com> | 2007-03-29 09:31:41 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-12 13:55:17 -0400 |
commit | 02cc51149f99e3c6c106e1e16dcc2e016b1bc3b5 (patch) | |
tree | 911e09a9aad7536f778cb27264b45f08f99cf0d3 /arch/powerpc/boot/main.c | |
parent | 1383a34fafeb9f49975fc33783960729fbd2cddf (diff) |
[POWERPC] bootwrapper: Decompress less, check more
Our kernels put everything in the first load segment, and we read that.
Instead of decompressing to the end of the gzip stream or supplied image
and hoping we get it all, decompress the expected size and complain if
it is not available.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/main.c')
-rw-r--r-- | arch/powerpc/boot/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c index 30390621203..56b56a8d4b2 100644 --- a/arch/powerpc/boot/main.c +++ b/arch/powerpc/boot/main.c | |||
@@ -79,7 +79,10 @@ static struct addr_range prep_kernel(void) | |||
79 | vmlinuz_addr, vmlinuz_addr+vmlinuz_size); | 79 | vmlinuz_addr, vmlinuz_addr+vmlinuz_size); |
80 | /* discard up to the actual load data */ | 80 | /* discard up to the actual load data */ |
81 | gunzip_discard(&gzstate, ei.elfoffset - sizeof(elfheader)); | 81 | gunzip_discard(&gzstate, ei.elfoffset - sizeof(elfheader)); |
82 | len = gunzip_finish(&gzstate, addr, ei.memsize); | 82 | len = gunzip_finish(&gzstate, addr, ei.loadsize); |
83 | if (len != ei.loadsize) | ||
84 | fatal("ran out of data! only got 0x%x of 0x%lx bytes.\n\r", | ||
85 | len, ei.loadsize); | ||
83 | printf("done 0x%x bytes\n\r", len); | 86 | printf("done 0x%x bytes\n\r", len); |
84 | 87 | ||
85 | flush_cache(addr, ei.loadsize); | 88 | flush_cache(addr, ei.loadsize); |