WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Kernel image with LZMA compression  (Read 11645 times)

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Kernel image with LZMA compression
« 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!



Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Kernel image with LZMA compression
« Reply #1 on: April 15, 2013, 04:00:16 PM »
Will it run faster or use less RAM during operation?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Re: Kernel image with LZMA compression
« Reply #2 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?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Re: Kernel image with LZMA compression
« Reply #4 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?


Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Kernel image with LZMA compression
« Reply #5 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.

Offline Zendrael

  • Sr. Member
  • ****
  • Posts: 363
    • Zendrael's home of projects
Re: Kernel image with LZMA compression
« Reply #6 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?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Kernel image with LZMA compression
« Reply #7 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.
« Last Edit: April 16, 2013, 09:00:44 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Kernel image with LZMA compression
« Reply #8 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.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)