Wednesday, February 23, 2022

[SOLVED] Most Lightweight Linux Kernel OS

Issue

I am working on Linux Mint 17 (with somewhat minimized kernel of size 4.6MB created by me), and I was developing new additions to the scheduler of Linux Kernel.

The problem is that I have to compile and load it every time, which is obviously quite a long process and takes about 3 minutes to build alone.

Is there any Linux OS with such a small base kernel configuration that I can do my work much more quickly? All I need is a terminal and some basic OS support. It must be on 3.14 version or later, as the deadline scheduler was added just recently.


Solution

You could try TinyCore Linux: http://distro.ibiblio.org/tinycorelinux/

The rest of answer assuming that what you want to do is speed up kernel builds; it is possible the OP may already know this but other readers may not

If you are building on a multi core machine you can use parallel make. Essentially, you need to call make something like:

make -j4

Where 4 is the number of C files that end up getting compiled in parallel. Depending on what you are doing you may want to set this to the same or just below the number of cores on your build machine. This makes a significant speedup when I build on my machine.

Note that depending on how you build your kernel this might not be the correct method: for example on Ubuntu you need instead to set DEB_BUILD_OPTIONS=parallel=4 if building via dpkg although I suspect this is not your case.

The other thing you can do if you have the horsepower is use a virtual machine, e.g. kvm or VirtualBox to test your kernel. This will allow you to avoid continually rebooting your build machine.



Answered By - 6EQUJ5
Answer Checked By - David Marino (WPSolving Volunteer)