Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbarm/stand/gzboot Allow MAXIMAGESIZE to be set to...



details:   https://anonhg.NetBSD.org/src/rev/2281469c1af3
branches:  trunk
changeset: 546426:2281469c1af3
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Apr 29 05:01:34 2003 +0000

description:
Allow MAXIMAGESIZE to be set to 0.  For gzboot's that are linked
for flash, this allows us to basically do:

        cat gzboot.bin netbsd.bin.gz > gzimg

to produce the bootable image.

diffstat:

 sys/arch/evbarm/stand/gzboot/gzboot.c |  13 ++++++++++---
 sys/arch/evbarm/stand/gzboot/image.S  |   3 +--
 2 files changed, 11 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r c3ac6d076075 -r 2281469c1af3 sys/arch/evbarm/stand/gzboot/gzboot.c
--- a/sys/arch/evbarm/stand/gzboot/gzboot.c     Tue Apr 29 01:49:33 2003 +0000
+++ b/sys/arch/evbarm/stand/gzboot/gzboot.c     Tue Apr 29 05:01:34 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gzboot.c,v 1.6 2002/04/17 17:38:58 thorpej Exp $       */
+/*     $NetBSD: gzboot.c,v 1.7 2003/04/29 05:01:34 thorpej Exp $       */
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -133,7 +133,14 @@
        board_init();
 
        printf(">> Load address: 0x%x\n", md_root_loadaddr);
-       printf(">> Image size: %u\n", md_root_size);
+
+       /*
+        * If md_root_size is 0, then it means that we are simply
+        * decompressing from an image which was concatenated onto
+        * the end of the gzboot binary.
+        */
+       if (md_root_size != 0)
+               printf(">> Image size: %u\n", md_root_size);
 
        printf("Uncompressing image...");
        gzcopy((void *) loadaddr, md_root_image, md_root_size);
@@ -169,7 +176,7 @@
 readbuf(struct state *s, void *buf, size_t len)
 {
 
-       if (len > (s->srcsize - s->srcoff))
+       if (s->srcsize != 0 && len > (s->srcsize - s->srcoff))
                len = s->srcsize - s->srcoff;
 
        if ((s->spinny++ & 7) == 0)
diff -r c3ac6d076075 -r 2281469c1af3 sys/arch/evbarm/stand/gzboot/image.S
--- a/sys/arch/evbarm/stand/gzboot/image.S      Tue Apr 29 01:49:33 2003 +0000
+++ b/sys/arch/evbarm/stand/gzboot/image.S      Tue Apr 29 05:01:34 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: image.S,v 1.1 2002/02/24 20:29:44 thorpej Exp $        */
+/*     $NetBSD: image.S,v 1.2 2003/04/29 05:01:34 thorpej Exp $        */
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -49,5 +49,4 @@
 
        .global _C_LABEL(md_root_image)
 _C_LABEL(md_root_image):
-       .asciz  "|This is the gzboot image!\n"
        .org    _C_LABEL(md_root_image) + MAXIMAGESIZE;



Home | Main Index | Thread Index | Old Index