Skip to contentSkip to conversation

gzip compression of vmlinux

DISCUSSION Amol Kumar Lad 5 participants 5 messages Oct 21, 2002 – Oct 24, 2002

lore
Share & tools
lore
#0 lore raw

Hi,
Currently we use gzip to compress vmlinux ( and finally form bzImage).
I am planning to replace it with bzip2 . Should I go ahead with it ? Will it find its place in the latest kernel ?
We save some 35k of compressed bzImage using bzip2

Please cc me

Thanks
Amol

#1 lore raw
Quoted 10 lines · Amol Kumar Lad

Hi,
Currently we use gzip to compress vmlinux ( and finally form bzImage).
I am planning to replace it with bzip2 . Should I go ahead with it ? Will it find its place in the latest kernel ?
We save some 35k of compressed bzImage using bzip2

Please cc me

Thanks
Amol

Is it allowed? I think Phil Katz had some claim to this since he created the compression method by combining several published algorithms. Don't hit me with fire, I was involved in the PK/ARC Lawsuit. I am distinctly aware of his work.

The RedHat bzip2 Web Page seems to say that it's all "Free Software". I suppose, upon the death of an author, everything's up for grabs.

At the very least, if you use this method, I suggest you name the output file pkImage.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips). The US military has given us many words, FUBAR, SNAFU, now ENRON. Yes, top management were graduates of West Point and Annapolis.

#2 lore raw
In reply to Amol Kumar Lad
Quoted 5 lines · Amol Kumar Lad

Hi,
Currently we use gzip to compress vmlinux ( and finally form bzImage).
I am planning to replace it with bzip2 . Should I go ahead with it ? Will it find its place in the latest kernel ?
We save some 35k of compressed bzImage using bzip2

If you replace the gzip kernel compression with bzip2, will it be easy to also bzip2 initrd images?

If so, does the kernel then no longer need a gzip decompression routine? Does the current implementation use the same gunzipper for the kernel and initrd (possibly not? Is the kernel gunzipper real mode?)

If so then this is a good feature for some embedded systems which can trade a few seconds of boot time for smaller images, particularly if it removes the routine from the kernel.

How much slower is bunzip2?

On my system, bunzip2 decompresses a kernel image nearly 10x slower than gzip

[mark@athlon linux-2.4.19]$ time gunzip blah
0.08user 0.01system 0:00.09elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k

[mark@athlon linux-2.4.19]$ time bunzip2 blah.bz2
0.83user 0.04system 0:00.87elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k

and it only gets 6% smaller

but this is a highly unscientific test.

Mark

#4 lore raw
In reply to Amol Kumar Lad
Quoted 5 lines · Amol Kumar Lad

Hi,
Currently we use gzip to compress vmlinux ( and finally form bzImage).
I am planning to replace it with bzip2 . Should I go ahead with it ? Will it find its place in the latest kernel ?
We save some 35k of compressed bzImage using bzip2

You might also want to take a look at upx. It's compressor is roughly of the same quality as gzip, but it's decompresser is only a couple of hundred bytes. I don't know which will buy you more in practice. I smaller decompresser, or a larger decompresser with that compresses a little smaller. Or possibly you just want to pass -9 to gzip?

Eric