Re: [update2] [PATCH] init: bzip2 or lzma -compressed kernels and initrds

Previous thread: [update] [PATCH] init: bzip2 or lzma -compressed kernels and initrds by Alain Knaff on Monday, September 8, 2008 - 3:33 pm. (2 messages)

Next thread: [PATCH] kgdb: could not write to the last of valid memory with kgdb. by Atsuo Igarashi on Monday, September 8, 2008 - 5:04 pm. (2 messages)
From: Alain Knaff
Date: Monday, September 8, 2008 - 3:50 pm

From: Alain Knaff <alain@knaff.lu>

This is an updated version of my bzip2/lzma patch

It is based on an idea by Christian Ludwig, includes support for
compressing the kernel with bzip2 or lzma rather than gzip. Both
compressors give smaller sizes than gzip.  Lzma's decompresses faster
than bzip2.

It also supports ramdisks and initramfs' compressed using these two
compressors.

The functionality has been successfully used for a couple of years by
the udpcast project

This version applies to "tip" kernel 2.6.27-rc5

Changes since last version:

- Removed #ifdef's in head_32.S and head_64.S at the cost of a 4-byte
  increase of LZMA-compressed kernels

Signed-off-by: Alain Knaff <alain@knaff.lu>

---



diff -uNrp -X linux.trees.git.udpcast/Documentation/dontdiff linux.trees.git/arch/x86/boot/compressed/head_32.S linux.trees.git.udpcast/arch/x86/boot/compressed/head_32.S
--- linux.trees.git/arch/x86/boot/compressed/head_32.S	2008-09-07 11:29:12.000000000 +0200
+++ linux.trees.git.udpcast/arch/x86/boot/compressed/head_32.S	2008-09-09 00:41:04.000000000 +0200
@@ -143,7 +143,7 @@ relocated:
 	pushl %eax	# input_len
 	leal input_data(%ebx), %eax
 	pushl %eax	# input_data
-	leal boot_heap(%ebx), %eax
+	leal _end(%ebx), %eax
 	pushl %eax	# heap area
 	pushl %esi	# real mode pointer
 	call decompress_kernel
@@ -184,8 +184,6 @@ relocated:
 .bss
 /* Stack and heap for uncompression */
 .balign 4
-boot_heap:
-	.fill BOOT_HEAP_SIZE, 1, 0
 boot_stack:
 	.fill BOOT_STACK_SIZE, 1, 0
 boot_stack_end:
diff -uNrp -X linux.trees.git.udpcast/Documentation/dontdiff linux.trees.git/arch/x86/boot/compressed/head_64.S linux.trees.git.udpcast/arch/x86/boot/compressed/head_64.S
--- linux.trees.git/arch/x86/boot/compressed/head_64.S	2008-09-07 11:29:12.000000000 +0200
+++ linux.trees.git.udpcast/arch/x86/boot/compressed/head_64.S	2008-09-09 00:41:09.000000000 +0200
@@ -287,7 +287,7 @@ relocated:
  */
 	pushq	%rsi			# Save the real mode argument
 	movq	%rsi, %rdi		# real mode ...
From: Willy Tarreau
Date: Monday, September 8, 2008 - 9:03 pm

4 bytes aren't that much, the code looks a lot cleaner and touches less
areas.

I may be wrong, but I think that some #ifdef NEW_CODE and #ifdef IN_MEMORY
can go too. Note that I have *not* analysed the dependency chain, it's just






(...)
etc...

Regards,
Willy

--

Previous thread: [update] [PATCH] init: bzip2 or lzma -compressed kernels and initrds by Alain Knaff on Monday, September 8, 2008 - 3:33 pm. (2 messages)

Next thread: [PATCH] kgdb: could not write to the last of valid memory with kgdb. by Atsuo Igarashi on Monday, September 8, 2008 - 5:04 pm. (2 messages)