]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_bootm.c
* Patch by Yuli Barcohen, 26 Jan 2004:
[karo-tx-uboot.git] / common / cmd_bootm.c
index 34a74ce2c5a6fd0fcdfdb3acfc107b74f5ffdb08..ac9c32e7b8791a313e2835d66c33a6bdc395c3d8 100644 (file)
@@ -333,8 +333,14 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 #ifdef CONFIG_BZIP2
        case IH_COMP_BZIP2:
                printf ("   Uncompressing %s ... ", name);
+               /*
+                * If we've got less than 4 MB of malloc() space,
+                * use slower decompression algorithm which requires
+                * at most 2300 KB of memory.
+                */
                i = BZ2_bzBuffToBuffDecompress ((char*)ntohl(hdr->ih_load),
-                                               &unc_len, (char *)data, len, 0, 0);
+                                               &unc_len, (char *)data, len,
+                                               CFG_MALLOC_LEN < (4096 * 1024), 0);
                if (i != BZ_OK) {
                        printf ("BUNZIP2 ERROR %d - must RESET board to recover\n", i);
                        SHOW_BOOT_PROGRESS (-6);