[PATCH 09/16] zlib-decompression-status.diff

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux Kernel Mailing List <linux-kernel@...>
Cc: Andrew Morton <akpm@...>
Date: Sunday, April 1, 2007 - 2:15 pm

Shows some stars during decompression. This is particularly useful on 
old 386s where one asterisk is probably printed every second - making 
the long linux and initramfs uncompress progress more evident.

Not compile tested outside {i386, x86_64} - don't have other machines.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>

 arch/alpha/boot/misc.c                    |    2 +-
 arch/arm/boot/compressed/misc.c           |    4 ++--
 arch/arm26/boot/compressed/misc.c         |    4 ++--
 arch/cris/arch-v10/boot/compressed/misc.c |    2 +-
 arch/cris/arch-v32/boot/compressed/misc.c |    2 +-
 arch/i386/boot/compressed/misc.c          |    2 +-
 arch/m32r/boot/compressed/misc.c          |    2 +-
 arch/sh/boot/compressed/misc.c            |    2 +-
 arch/sh64/boot/compressed/misc.c          |    2 +-
 arch/x86_64/boot/compressed/misc.c        |    2 +-
 init/do_mounts_rd.c                       |    7 ++++++-
 init/initramfs.c                          |    7 ++++++-
 lib/inflate.c                             |    9 +++++----
 13 files changed, 29 insertions(+), 18 deletions(-)

Index: linux-2.6.21-rc5/arch/alpha/boot/misc.c
===================================================================
--- linux-2.6.21-rc5.orig/arch/alpha/boot/misc.c
+++ linux-2.6.21-rc5/arch/alpha/boot/misc.c
@@ -201,7 +201,7 @@ decompress_kernel(void *output_start,
 
 	makecrc();
 /*	puts("Uncompressing Linux..."); */
-	gunzip();
+	gunzip(NULL);
 /*	puts(" done, booting the kernel.\n"); */
 	return output_ptr;
 }
Index: linux-2.6.21-rc5/arch/arm/boot/compressed/misc.c
===================================================================
--- linux-2.6.21-rc5.orig/arch/arm/boot/compressed/misc.c
+++ linux-2.6.21-rc5/arch/arm/boot/compressed/misc.c
@@ -355,7 +355,7 @@ decompress_kernel(ulg output_start, ulg 
 
 	makecrc();
 	putstr("Uncompressing Linux...");
-	gunzip();
+	gunzip(putstr);
 	putstr(" done, booting the kernel.\n");
 	return output_ptr;
 }
@@ -369,7 +369,7 @@ int main()
 
 	makecrc();
 	putstr("Uncompressing Linux...");
-	gunzip();
+	gunzip(putstr);
 	putstr("done.\n");
 	return 0;
 }
Index: linux-2.6.21-rc5/arch/arm26/boot/compressed/misc.c
===================================================================
--- linux-2.6.21-rc5.orig/arch/arm26/boot/compressed/misc.c
+++ linux-2.6.21-rc5/arch/arm26/boot/compressed/misc.c
@@ -294,7 +294,7 @@ decompress_kernel(ulg output_start, ulg 
 
 	makecrc();
 	puts("Uncompressing Linux...");
-	gunzip();
+	gunzip(puts);
 	puts(" done, booting the kernel.\n");
 	return output_ptr;
 }
@@ -308,7 +308,7 @@ int main()
 
 	makecrc();
 	puts("Uncompressing Linux...");
-	gunzip();
+	gunzip(puts);
 	puts("done.\n");
 	return 0;
 }
Index: linux-2.6.21-rc5/arch/cris/arch-v10/boot/compressed/misc.c
===================================================================
--- linux-2.6.21-rc5.orig/arch/cris/arch-v10/boot/compressed/misc.c
+++ linux-2.6.21-rc5/arch/cris/arch-v10/boot/compressed/misc.c
@@ -267,6 +267,6 @@ decompress_kernel()
 	}
 
 	puts("Uncompressing Linux...\n");
-	gunzip();
+	gunzip(puts);
 	puts("Done. Now booting the kernel.\n");
 }
Index: linux-2.6.21-rc5/arch/cris/arch-v32/boot/compressed/misc.c
===================================================================
--- linux-2.6.21-rc5.orig/arch/cris/arch-v32/boot/compressed/misc.c
+++ linux-2.6.21-rc5/arch/cris/arch-v32/boot/compressed/misc.c
@@ -312,6 +312,6 @@ decompress_kernel()
 	}
 
 	puts("Uncompressing Linux...\n");
-	gunzip();
+	gunzip(puts);
 	puts("Done. Now booting the kernel.\n");
 }
Index: linux-2.6.21-rc5/arch/i386/boot/compressed/misc.c
===================================================================
--- linux-2.6.21-rc5.orig/arch/i386/boot/compressed/misc.c
+++ linux-2.6.21-rc5/arch/i386/boot/compressed/misc.c
@@ -373,7 +373,7 @@ asmlinkage void decompress_kernel(void *
 
 	makecrc();
 	putstr("Uncompressing Linux... ");
-	gunzip();
+	gunzip(putstr);
 	putstr("Ok, booting the kernel.\n");
 	return;
 }
Index: linux-2.6.21-rc5/arch/m32r/boot/compressed/misc.c
===================================================================
--- linux-2.6.21-rc5.orig/arch/m32r/boot/compressed/misc.c
+++ linux-2.6.21-rc5/arch/m32r/boot/compressed/misc.c
@@ -204,6 +204,6 @@ decompress_kernel(int mmu_on, unsigned c
 
 	makecrc();
 	puts("Uncompressing Linux... ");
-	gunzip();
+	gunzip(puts);
 	puts("Ok, booting the kernel.\n");
 }
Index: linux-2.6.21-rc5/arch/sh/boot/compressed/misc.c
===================================================================
--- linux-2.6.21-rc5.orig/arch/sh/boot/compressed/misc.c
+++ linux-2.6.21-rc5/arch/sh/boot/compressed/misc.c
@@ -236,6 +236,6 @@ void decompress_kernel(void)
 
 	makecrc();
 	puts("Uncompressing Linux... ");
-	gunzip();
+	gunzip(puts);
 	puts("Ok, booting the kernel.\n");
 }
Index: linux-2.6.21-rc5/arch/sh64/boot/compressed/misc.c
===================================================================
--- linux-2.6.21-rc5.orig/arch/sh64/boot/compressed/misc.c
+++ linux-2.6.21-rc5/arch/sh64/boot/compressed/misc.c
@@ -218,7 +218,7 @@ void decompress_kernel(void)
 	makecrc();
 	puts("Uncompressing Linux... ");
 	cache_control(CACHE_ENABLE);
-	gunzip();
+	gunzip(puts);
 	puts("\n");
 
 #if 0
Index: linux-2.6.21-rc5/arch/x86_64/boot/compressed/misc.c
===================================================================
--- linux-2.6.21-rc5.orig/arch/x86_64/boot/compressed/misc.c
+++ linux-2.6.21-rc5/arch/x86_64/boot/compressed/misc.c
@@ -351,7 +351,7 @@ int decompress_kernel(struct moveparams 
 
 	makecrc();
 	putstr(".\nDecompressing Linux...");
-	gunzip();
+	gunzip(putstr);
 	putstr("done.\nBooting the kernel.\n");
 	if (high_loaded) close_output_buffer_if_we_run_high(mv);
 	return high_loaded;
Index: linux-2.6.21-rc5/init/do_mounts_rd.c
===================================================================
--- linux-2.6.21-rc5.orig/init/do_mounts_rd.c
+++ linux-2.6.21-rc5/init/do_mounts_rd.c
@@ -393,6 +393,11 @@ static void __init error(char *x)
 	unzip_error = 1;
 }
 
+static inline void putstr(const char *s) {
+    printk("%s", s);
+    return;
+}
+
 static int __init crd_load(int in_fd, int out_fd)
 {
 	int result;
@@ -418,7 +423,7 @@ static int __init crd_load(int in_fd, in
 		return -1;
 	}
 	makecrc();
-	result = gunzip();
+	result = gunzip(putstr);
 	if (unzip_error)
 		result = 1;
 	kfree(inbuf);
Index: linux-2.6.21-rc5/init/initramfs.c
===================================================================
--- linux-2.6.21-rc5.orig/init/initramfs.c
+++ linux-2.6.21-rc5/init/initramfs.c
@@ -441,6 +441,11 @@ static void __init flush_window(void)
 	outcnt = 0;
 }
 
+static inline void putstr(const char *s) {
+    printk("%s", s);
+    return;
+}
+
 static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only)
 {
 	int written;
@@ -477,7 +482,7 @@ static char * __init unpack_to_rootfs(ch
 		bytes_out = 0;
 		crc = (ulg)0xffffffffL; /* shift register contents */
 		makecrc();
-		gunzip();
+		gunzip(putstr);
 		if (state != Reset)
 			error("junk in gzipped archive");
 		this_header = saved_offset + inptr;
Index: linux-2.6.21-rc5/lib/inflate.c
===================================================================
--- linux-2.6.21-rc5.orig/lib/inflate.c
+++ linux-2.6.21-rc5/lib/inflate.c
@@ -151,7 +151,7 @@ STATIC int INIT inflate_stored OF((void)
 STATIC int INIT inflate_fixed OF((void));
 STATIC int INIT inflate_dynamic OF((void));
 STATIC int INIT inflate_block OF((int *));
-STATIC int INIT inflate OF((void));
+STATIC int INIT inflate OF((void (*)(const char *)));
 
 
 /* The inflate algorithm uses a sliding 32 K byte window on the uncompressed
@@ -983,7 +983,7 @@ STATIC int INIT inflate_block(
 
 
 
-STATIC int INIT inflate(void)
+STATIC int INIT inflate(void (*putstr)(const char *))
 /* decompress an inflated entry */
 {
   int e;                /* last block flag */
@@ -1000,6 +1000,7 @@ STATIC int INIT inflate(void)
   /* decompress until the last block */
   h = 0;
   do {
+    if(putstr != NULL) putstr("*");
     hufts = 0;
     gzip_mark(&ptr);
     if ((r = inflate_block(&e)) != 0) {
@@ -1093,7 +1094,7 @@ makecrc(void)
 /*
  * Do the uncompression!
  */
-static int INIT gunzip(void)
+static int INIT gunzip(void (*putstr)(const char *))
 {
     uch flags;
     unsigned char magic[2]; /* magic header */
@@ -1157,7 +1158,7 @@ static int INIT gunzip(void)
     }
 
     /* Decompress */
-    if ((res = inflate())) {
+    if ((res = inflate(putstr))) {
 	    switch (res) {
 	    case 0:
 		    break;
#<EOF>
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/16] Assorted patches, Jan Engelhardt, (Sun Apr 1, 2:13 pm)
[PATCH 16/16] warn-on-kthread-name-truncation.diff, Jan Engelhardt, (Sun Apr 1, 2:18 pm)
Re: [PATCH 16/16] warn-on-kthread-name-truncation.diff, Andrew Morton, (Mon Apr 2, 2:00 am)
Re: [PATCH 16/16] warn-on-kthread-name-truncation.diff, Jan Engelhardt, (Mon Apr 2, 2:51 am)
[PATCH 15/16] use-regular-eth-suffix.diff, Jan Engelhardt, (Sun Apr 1, 2:18 pm)
Re: [PATCH 15/16] use-regular-eth-suffix.diff, Kyle Moffett, (Sun Apr 1, 2:42 pm)
Re: [PATCH 15/16] use-regular-eth-suffix.diff, Jouni Malinen, (Sun Apr 1, 9:40 pm)
[PATCH 14/16] kconfig-allow-override.diff, Jan Engelhardt, (Sun Apr 1, 2:17 pm)
Re: [PATCH 14/16] kconfig-allow-override.diff, Sam Ravnborg, (Sun Apr 1, 2:44 pm)
Re: [PATCH 14/16] kconfig-allow-override.diff, Randy Dunlap, (Sun Apr 1, 3:09 pm)
[PATCH 13/16] show-pipesize-in-stat.diff, Jan Engelhardt, (Sun Apr 1, 2:17 pm)
Re: [PATCH 13/16] show-pipesize-in-stat.diff, Eric Dumazet, (Mon Apr 2, 6:41 am)
Re: [PATCH 13/16] show-pipesize-in-stat.diff, Jan Engelhardt, (Tue Apr 3, 8:48 pm)
Re: [PATCH 13/16] show-pipesize-in-stat.diff, Eric Dumazet, (Wed Apr 4, 1:03 am)
Re: [PATCH 13/16] show-pipesize-in-stat.diff, Jan Engelhardt, (Tue Apr 17, 4:05 am)
Re: [PATCH 13/16] show-pipesize-in-stat.diff, Andrew Morton, (Mon Apr 2, 1:58 am)
Re: [PATCH 13/16] show-pipesize-in-stat.diff, Jan Engelhardt, (Mon Apr 2, 2:48 am)
[PATCH 12/16] cifs-use-mutex.diff, Jan Engelhardt, (Sun Apr 1, 2:16 pm)
Re: [PATCH 12/16] cifs-use-mutex.diff, Roland Dreier, (Mon Apr 2, 1:36 am)
[PATCH 11/16] samba-eintr-fix.diff, Jan Engelhardt, (Sun Apr 1, 2:16 pm)
Re: [PATCH 11/16] samba-eintr-fix.diff, Andrew Morton, (Mon Apr 2, 1:53 am)
Re: [PATCH 11/16] samba-eintr-fix.diff, Dave Jones, (Sun Apr 1, 3:09 pm)
Re: [PATCH 11/16] samba-eintr-fix.diff, Jan Engelhardt, (Sun Apr 1, 3:28 pm)
Re: [PATCH 11/16] samba-eintr-fix.diff, Dave Jones, (Sun Apr 1, 3:42 pm)
[PATCH 10/16] show-partitions-on-mount-error.diff, Jan Engelhardt, (Sun Apr 1, 2:15 pm)
Re: [PATCH 10/16] show-partitions-on-mount-error.diff, Pavel Machek, (Mon Apr 2, 2:59 pm)
Re: [PATCH 10/16] show-partitions-on-mount-error.diff, Jan Engelhardt, (Tue Apr 3, 8:42 pm)
Re: [PATCH 10/16] show-partitions-on-mount-error.diff, Andrew Morton, (Mon Apr 2, 1:48 am)
Re: [PATCH 10/16] show partitions on mount error, Jan Engelhardt, (Mon Apr 2, 3:01 am)
Re: [PATCH 10/16] show-partitions-on-mount-error.diff, Andrew Morton, (Mon Apr 2, 1:47 am)
[PATCH 09/16] zlib-decompression-status.diff, Jan Engelhardt, (Sun Apr 1, 2:15 pm)
Re: [PATCH 09/16] zlib-decompression-status.diff, Jan Engelhardt, (Mon Apr 2, 2:50 pm)
[PATCH 08/16] console-printk-level.diff, Jan Engelhardt, (Sun Apr 1, 2:15 pm)
Re: [PATCH 08/16] console-printk-level.diff, Randy Dunlap, (Sun Apr 1, 3:07 pm)
[PATCH 07/16] kconfig-dynamic-frequency.diff, Jan Engelhardt, (Sun Apr 1, 2:15 pm)
Re: [PATCH 07/16] kconfig-dynamic-frequency.diff, Kyle Moffett, (Sun Apr 1, 2:39 pm)
Re: [PATCH 07/16] kconfig-dynamic-frequency.diff, Jan Engelhardt, (Sun Apr 1, 2:42 pm)
Re: [PATCH 07/16] kconfig-dynamic-frequency.diff, Kyle Moffett, (Sun Apr 1, 2:52 pm)
Re: [PATCH 07/16] kconfig-dynamic-frequency.diff, Robert P. J. Day, (Sun Apr 1, 4:22 pm)
Re: [PATCH 07/16] kconfig-dynamic-frequency.diff, Jan Engelhardt, (Sun Apr 1, 3:01 pm)
[PATCH], Kyle Moffett, (Sun Apr 1, 3:42 pm)
Re: [PATCH], Jan Engelhardt, (Sun Apr 1, 3:47 pm)
Re: [PATCH], Kyle Moffett, (Sun Apr 1, 4:07 pm)
Re: [PATCH], Andi Kleen, (Sun Apr 1, 7:03 pm)
[PATCH 06/16] isofs-add-write-bit.diff, Jan Engelhardt, (Sun Apr 1, 2:15 pm)
[PATCH 5/16] fix-kthread-niceness.diff, Jan Engelhardt, (Sun Apr 1, 2:14 pm)
Re: [PATCH 5/16] fix-kthread-niceness.diff, Andrew Morton, (Mon Apr 2, 1:39 am)
[PATCH 4/16] vt-printk-color.diff, Jan Engelhardt, (Sun Apr 1, 2:14 pm)
[PATCH 3/16] vt-underline-color.diff, Jan Engelhardt, (Sun Apr 1, 2:14 pm)
Re: [PATCH 3/16] vt-underline-color.diff, Andrew Morton, (Mon Apr 2, 1:37 am)
Re: [PATCH 3/16] vt-underline-color.diff, Antonino A. Daplas, (Mon Apr 2, 2:57 am)
[PATCH 2/16] vt-pure-colors.diff, Jan Engelhardt, (Sun Apr 1, 2:14 pm)
Re: [PATCH 2/16] vt-pure-colors.diff, James Bruce, (Sun Apr 1, 2:39 pm)
Re: [PATCH 2/16] vt-pure-colors.diff, Antonino A. Daplas, (Mon Apr 2, 2:49 am)
Re: [PATCH 2/16] vt-pure-colors.diff, Jan Engelhardt, (Mon Apr 2, 3:04 am)
Re: [PATCH 2/16] vt-pure-colors.diff, Antonino A. Daplas, (Mon Apr 2, 3:50 am)
Re: [PATCH 2/16] vt-pure-colors.diff, Jan Engelhardt, (Mon Apr 2, 4:01 am)
[PATCH 1/16] vt-sysfs-for-colors.diff, Jan Engelhardt, (Sun Apr 1, 2:13 pm)
Re: [PATCH 1/16] vt-sysfs-for-colors.diff, Antonino A. Daplas, (Mon Apr 2, 2:49 am)
[PATCH 17/16] Do not reset UTF8 on terminal reset, Jan Engelhardt, (Mon Apr 2, 3:31 am)
Re: [PATCH 17/16] Do not reset UTF8 on terminal reset, Pavel Machek, (Mon Apr 2, 2:50 pm)
Re: [PATCH 17/16] Do not reset UTF8 on terminal reset, Paul LeoNerd Evans, (Mon Apr 2, 7:26 am)
Re: [PATCH 17/16] Do not reset UTF8 on terminal reset, Antonino A. Daplas, (Mon Apr 2, 7:44 am)
Re: [PATCH 17/16] Do not reset UTF8 on terminal reset, Paul LeoNerd Evans, (Mon Apr 2, 7:54 am)
Re: [PATCH 17/16] Do not reset UTF8 on terminal reset, Antonino A. Daplas, (Mon Apr 2, 8:47 am)
Re: [PATCH 17/16] Do not reset UTF8 on terminal reset, Jan Engelhardt, (Mon Apr 2, 9:34 am)
Re: [PATCH 17/16] Do not reset UTF8 on terminal reset, Paul LeoNerd Evans, (Mon Apr 2, 9:20 am)
Re: [PATCH 17/16] Do not reset UTF8 on terminal reset, Antonino A. Daplas, (Mon Apr 2, 5:30 am)