Kernel build script
Posted: Tue 10 May 2011, 17:10
I wrote a script which builds the kernel automatically. It has three input fields:
- A kernel version
- A kernel sources mirror
- An Aufs major version
... and a valid configuration file for the kernel version specified.
This is beta-quality software, so don't get too excited. At the moment, you can use it to build linux_kernel-2.6.32-40-lts.pet, a very very very very very, but VERY good kernel. It's very solid and the building kit also patches it with BFS, which makes it fly on weak hardware. Power consumption is very low.
The main idea behind this kit is allowing Puppy developers to compile a kernel (let's say it's 2.6.32) and once later kernels of the same series come out, compile them the same way the first one was built to maintain compatibility and reduce the risk of breaking something. In other words - the ability to update the kernel safely and transparently to the user.
If you wonder why it's so good - here's my story with kernel updates - my 2010 netbook's sound card was unsupported on Linux because two pins were not handled in the HDA driver. The required fix came in 2.6.35.7, which was the most recent kernel version back then, but it was also backported to 2.6.32.29. I couldn't use any Puppy, because no puplet had a kernel with that fix. Those kernel updates add more than just bug fixes - they also add security, hardware support and features. That's why they're so important.
The kit provides compatibility by automatically patching the kernel to appear as its major version - for example, 2.6.32.40 is patched to appear as 2.6.32, so if you build nvidia or ATI drivers against 2.6.32.39 and the kernel gets updated, you won't get any X startup failure, BSOD, CPU melting or whatever. Everything will work just fine. It is particularly useful for Wary or any puplets that stick with one kernel for some time. The Lupu guys could do occasional updates to the 2.6.33.2 kernel ... but it's too late
Also, it patches the kernel to be quiet (that's the way Puppy kernels are, traditionally) and reduces the number of available consoles (TTYs) from 8 to 5, because 3 are unused and waste precious memory.
The kit consists of four components:
- build.sh - the script which does the real magic
- DOTconfig - a kernel .config file
- patches - a directory with kernel patches to apply
- aufs-allow-sfs.patch - Barry's traditional, must-have patch to allow Squashfs to be used with Aufs.
Just run build.sh to make your own linux_kernel-2.6.32-40-lts. It's very easy - takes 1-2 hours. The result packages can be used with Woof.
As a PoC, I built a kernel (the result was a 20 MB PET, without any stripping) and used it with EZ-Woof to produce a conservative Lupu 5.2.5, it used 57 MB of RAM with nothing running. Pretty good.
EDIT: you can find my kernel here; the script used to build it is in the parent directory. It has one small fix on top of the attached script.
- A kernel version
- A kernel sources mirror
- An Aufs major version
... and a valid configuration file for the kernel version specified.
This is beta-quality software, so don't get too excited. At the moment, you can use it to build linux_kernel-2.6.32-40-lts.pet, a very very very very very, but VERY good kernel. It's very solid and the building kit also patches it with BFS, which makes it fly on weak hardware. Power consumption is very low.
The main idea behind this kit is allowing Puppy developers to compile a kernel (let's say it's 2.6.32) and once later kernels of the same series come out, compile them the same way the first one was built to maintain compatibility and reduce the risk of breaking something. In other words - the ability to update the kernel safely and transparently to the user.
If you wonder why it's so good - here's my story with kernel updates - my 2010 netbook's sound card was unsupported on Linux because two pins were not handled in the HDA driver. The required fix came in 2.6.35.7, which was the most recent kernel version back then, but it was also backported to 2.6.32.29. I couldn't use any Puppy, because no puplet had a kernel with that fix. Those kernel updates add more than just bug fixes - they also add security, hardware support and features. That's why they're so important.
The kit provides compatibility by automatically patching the kernel to appear as its major version - for example, 2.6.32.40 is patched to appear as 2.6.32, so if you build nvidia or ATI drivers against 2.6.32.39 and the kernel gets updated, you won't get any X startup failure, BSOD, CPU melting or whatever. Everything will work just fine. It is particularly useful for Wary or any puplets that stick with one kernel for some time. The Lupu guys could do occasional updates to the 2.6.33.2 kernel ... but it's too late
Also, it patches the kernel to be quiet (that's the way Puppy kernels are, traditionally) and reduces the number of available consoles (TTYs) from 8 to 5, because 3 are unused and waste precious memory.
The kit consists of four components:
- build.sh - the script which does the real magic
- DOTconfig - a kernel .config file
- patches - a directory with kernel patches to apply
- aufs-allow-sfs.patch - Barry's traditional, must-have patch to allow Squashfs to be used with Aufs.
Just run build.sh to make your own linux_kernel-2.6.32-40-lts. It's very easy - takes 1-2 hours. The result packages can be used with Woof.
As a PoC, I built a kernel (the result was a 20 MB PET, without any stripping) and used it with EZ-Woof to produce a conservative Lupu 5.2.5, it used 57 MB of RAM with nothing running. Pretty good.
EDIT: you can find my kernel here; the script used to build it is in the parent directory. It has one small fix on top of the attached script.