Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: Zendrael on April 15, 2013, 03:42:01 PM

Title: Kernel image with LZMA compression
Post by: Zendrael on April 15, 2013, 03:42:01 PM
Hello all!

Why not use LZMA instead of tar.gz to compress the kernel image?

Doesn't it will make our Core even smaller?

Or the lzma is slower than tar.gz to decompress?

Even LZMA not being the default compress method of the kernel, can I build one with it to test?

Thanks!


Title: Re: Kernel image with LZMA compression
Post by: bmarkus on April 15, 2013, 04:00:16 PM
Will it run faster or use less RAM during operation?
Title: Re: Kernel image with LZMA compression
Post by: Zendrael on April 15, 2013, 04:02:59 PM
Will it run faster or use less RAM during operation?
That's what I want to know Bmarkus!

Or it will make no diffence at all in the Core?
Title: Re: Kernel image with LZMA compression
Post by: tinypoodle on April 15, 2013, 04:21:21 PM
http://kernel.xc.net/html/linux-3.3.1/x86/KERNEL_LZMA
Title: Re: Kernel image with LZMA compression
Post by: Zendrael on April 15, 2013, 04:30:38 PM
http://kernel.xc.net/html/linux-3.3.1/x86/KERNEL_LZMA
Thank you TinyPoodle!

Let's see if I understood it the right way: to have a LZMA kernel I have to compile the Core kernel image with this config. Maybe I should also have a lzma extension loaded within the base extensions?

Title: Re: Kernel image with LZMA compression
Post by: gerald_clark on April 15, 2013, 04:48:16 PM
You need to use a compression algorithm that is also supported by the boot loaders you want to use.
It is the boot loader that loads the kernel and initrd.
Title: Re: Kernel image with LZMA compression
Post by: Zendrael on April 15, 2013, 05:20:14 PM
You need to use a compression algorithm that is also supported by the boot loaders you want to use.
It is the boot loader that loads the kernel and initrd.

I didn't knew that! Thanks!

So, after the kernel recompilation, I hava to check if my extlinux will support it... hum... I think that the u-boot used in the ARM port already does it and the x86 GRUB does too...

Why gzip was prefered in Core than lzma?
Title: Re: Kernel image with LZMA compression
Post by: curaga on April 16, 2013, 08:56:52 AM
LZMA is too slow to decompress (and takes more RAM to do it).

@gerald_clark

IIRC the kernel decompresses the initrd, not the bootloader. I believe the kernel's own bootstrap code does the kernel image's decompression, so the bootloader only has to support the bzImage format.
Title: Re: Kernel image with LZMA compression
Post by: tinypoodle on April 16, 2013, 06:55:05 PM
Let's see if I understood it the right way: to have a LZMA kernel I have to compile the Core kernel image with this config.

Correct, but...

1. Once you're at it, you might consider to also compress the initramfs with same algorithm as kernel, that might give a more notable difference as the initramfs is bigger than the kernel and so the savings of size would be more there.

2. You might first look at xz in comparison to lzma.

Besides from that, you could experiment with recompressing the stock kernel with upx, which however seems to work with some parameters (hardware?? bootloader??  compression options??) and not with others.