[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Shrinking the kernel with an axe

Shrinking the kernel with an axe

Posted Feb 9, 2018 16:58 UTC (Fri) by rbrito (guest, #66188)
Parent article: Shrinking the kernel with an axe

Super thanks for this amazing series! Please, keep up with it!

I have a small NAS here (a KuroBox HD, that is a powerpc machine) that only has 64MB of memory and not only the kernel is getting bigger all the time (even with equivalent configurations), but the userspace is getting larger each time.

I think that it is time to drop distributions like Debian for such machines and switch to something like Arch or Gentoo (even though I know nothing about them), since the lots of dependencies that they pull in I will never use.

This kernel work that you're showing is also likely to make booting speedier, if I understand things right.

Thanks once again!


to post comments

Shrinking the kernel with an axe

Posted Feb 9, 2018 20:21 UTC (Fri) by oldnpastit (subscriber, #95303) [Link] (1 responses)

To keep userland size under control you might want to look at buildroot.

Great article by the way, thanks!

Shrinking the kernel with an axe

Posted Feb 9, 2018 22:59 UTC (Fri) by rbrito (guest, #66188) [Link]

I just skimmed the front page of https://buildroot.org/ and it looks very interesting indeed.

Even some smaller/older desktops may benefit from this (and I have some).

Shrinking the kernel with an axe

Posted Feb 9, 2018 22:00 UTC (Fri) by vadim (subscriber, #35271) [Link] (2 responses)

Gentoo is likely unsuitable for such a purpose. Gentoo builds from source, and needs large amounts of processing power and memory to work usably. Gentoo's main selling point is eking out the last 5% of performance by optimizing for your specific configuration, but the way it works fits high end hardware best. With a 64MB RAM box chances are gcc or g++ will try allocating far more than that when building something big, and the entire machine will die from a lack of memory.

That wouldn't really solve the problem anyway. To be secure in modern times you need to run modern software and not the swiss cheese from a decade ago. Modern software expects to be built in a modern, powerful desktop oriented environments, recent versions of gcc, etc. Something like Gentoo might be able to trim the fat somewhat, but current software is just fatter than the early versions were.

Shrinking the kernel with an axe

Posted Feb 9, 2018 22:56 UTC (Fri) by rbrito (guest, #66188) [Link] (1 responses)

Thanks for the reply.

The idea here would be to build on a machine that has more RAM and, then, use the packages on that NAS...

I don't know how easy Gentoo makes building and then transferring the packages/programs to another machine, though (or, perhaps, cross-compiling).

I would appreciate any comments on that.

Shrinking the kernel with an axe

Posted Feb 10, 2018 8:17 UTC (Sat) by dirtyepic (guest, #30178) [Link]

Gentoo has built-in support for cross compiling using crossdev. It's all integrated into the package manager so building binaries for another architecture is no different than building for the native system. There are also profiles for things like uClibc/musl if you want to go that direction.

https://wiki.gentoo.org/wiki/Embedded_Handbook
https://wiki.gentoo.org/wiki/Cross_build_environment

If you're just looking to offload compiling to a machine of the same architecture that has more resources, then Portage can be set up to use distcc as easily as setting a couple config options.

I have to disagree with the parent comment. Gentoo's main selling point is its flexibility. It lets you build a system that has exactly what you need and nothing more. In other words, it's shrinking the distro with an axe. If anything performance is just a side effect of the method it uses to accomplish this.

Of course, Gentoo's main downfall is also its flexibility. It turns out that building a system that has exactly what you need requires you to know exactly what you need first.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds