Realtime kernel build quickie + bootsplash (or not)

Share your own howto's etc. Not for support questions!

Realtime kernel build quickie + bootsplash (or not)

Postby mzilikazi » 2007-07-13 03:43

Edit 09.11.08 Updated for latest 2.6.26.5-rt8 - see last thread on page 5.
Edit 05.27.08 Updated for latest kernel 2.6.25.4
Edit 02.29.08 Added some tips, small revision.
Edit 01.28.08 Updated for latest kernel 2.6.24
Edit 10.12.07 Updated for latest 2.6.23-rt1 patch.
Added bootsplash patch.
Added downloadable pre-patched kernel source.
A big THANKS to hotlinkfiles.com for free file uploads and direct links.
linux-2.6.25.4-rt3.bz2
linux-2.6.25.4-rt3.md5sum

Execpt for the last step, (dpkg -i) there is no need to do any of this as root.
I prefer to create a simple build directory for all kernels something like KERNEL No need to do it in /usr/src since $USER cannot write there.

Code: Select all
mkdir KERNEL
cd KERNEL
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.25.4.tar.bz2
wget http://www.kernel.org/pub/linux/kernel/projects/rt/patch-2.6.25.4-rt3.bz2
wget http://fatcat.ftj.agh.edu.pl/~przyboro/other/bootsplash/bootsplash-3.1.6a-2.6.25.diff
unp linux-2.6.25.4.tar.bz2
mv linux-2.6.25.4 linux-2.6.25.4-rt3
cd linux-2.6.25.4-rt3
bzcat ../patch-2.6.25.4-rt3.bz2 |patch -p1
patch -p1<../bootsplash-3.1.6a-2.6.25.diff

Note the Makefile in your kernel source. It will automatically update the EXTRAVERSION string for you. In this case:
Code: Select all
EXTRAVERSION = .4-rt3

This will be appended to your kernel name.

Code: Select all
make menuconfig

OR if you wish to start with the same .config of your current kernel:
Code: Select all
make oldconfig

Then run
Code: Select all
make menuconfig

Enable Real-time preemption.
Code: Select all
Processor type and features> Preemption Mode (Complete Preemption (Real-Time))

Set kernel timer frequency to 1000 HZ
Code: Select all
Processor type and features>Timer frequency (1000 HZ)


Build a kernel the Debian way:
Code: Select all
make-kpkg clean
time fakeroot make-kpkg --initrd -rev mz1 kernel_image kernel_headers

Your new kernel & headers now live in ../KERNEL Use dpkg -i to install.
Code: Select all
$ dpkg -i ../linux-headers-*.deb ../linux-image-*.deb


*TIPS*
Dual core CPU?
Use paralell make processes:
Code: Select all
export CONCURRENCY_LEVEL=2


Skip the patches.

You can just skip the realtime patch and/or the bootsplash patch(es) all together for a basic kernel build. No need to apply either patch.

Nvidia graphics driver:
You might want to disable Paravirtualization in make menuconfig. The Nvidia driver does not build against kernels with this enabled.

You can build the nvidia-kernel driver (or any other drivers like ndiswrapper or rfswitch) before you even boot into your new kernel if you prefer but it must be done as root. If you use sudo it might work w/ fakeroot. You must be in the same dir as your kernel source.
Code: Select all
root@finn:/home/glenn/KERNEL#
m-a -t -k linux-2.6.25.4-rt3/ -l linux-2.6.25.4-rt3 a-b nvidia
m-a -t -k linux-2.6.25.4-rt3/ -l linux-2.6.25.4-rt3 a-b ndiswrapper
m-a -t -k linux-2.6.25.4-rt3/ -l linux-2.6.25.4-rt3 a-b rfswitch

OR just build them all at once:
Code: Select all
m-a -t -k linux-2.6.25.4-rt3/ -l linux-2.6.25.4-rt3 a-b nvidia ndiswrapper rfswitch


Build nvidia driver after booting into your new kernel.
After booting your new kernel, log in as root on a VT and build Nvidia the Debian way via module assistant:
Code: Select all
m-a a-i nvidia

Restart your login manager:
Code: Select all
/etc/init.d/gdm restart


You don't need a link to /usr/src/linux.
When you build modules against this kernel your source will automatically be found. No need to link anything to /some/dir/linux. An exceprt from nvidia-kernel-source.buildlog.2.6.23-rt1
Code: Select all
NVIDIA: calling KBUILD...
make CC=gcc-4.2 -C /lib/modules/2.6.23-rt1/source SUBDIRS=/usr/src/modules/nvidia-kernel/nv modules
make[3]: Entering directory `/home/glenn/Storage/KERNEL/linux-2.6.23-rt1'

Additionally, any debs you build against this kernel using module assistant will live in the same place as your kernel & header debs.
Code: Select all
KERNEL# ls|grep .deb
linux-headers-2.6.25.4-rt3_mz1_amd64.deb
linux-image-2.6.25.4-rt3_mz1_amd64.deb
nvidia-kernel-2.6.25.4-rt3_169.12-3+mz1_amd64.deb
rfswitch-modules-2.6.25.4-rt3_1.3-1+mz1_amd64.deb


Remove a patch. For example, the bootsplash patch:
Code: Select all
patch -p1 -R <../bootsplash-3.1.6a-2.6.25.diff


Run make menuconfig after make oldconfig to fine tune, confirm and/or remove items you do not need. If you really want to slim down your kernel be careful w/ what you change. Make small changes and be prepared to build more than 1 kernel. Patience is a virtue! ;) When you get a build error you can *usually* figure it out from the error message. Sometimes disabling something in one place will break something elsewhere.

Make an optional tarball of your patched linux source:
Code: Select all
tar cjvf linux-2.6.25.4-rt3.bz2 linux-2.6.25.4-rt3

OR
You can make a .deb of your kernel source for easy portability
Code: Select all
fakeroot make-kpkg -rev mz1 kernel_source

Alternatively, the make-kpkg target kernel_source can be added to the initial make-kpkg command.
Code: Select all
fakeroot make-kpkg --initrd -rev mz1 kernel_image kernel_headers kernel_source


All done
Code: Select all
$ uname -r
Linux hestviken 2.6.25.4-rt3
Last edited by mzilikazi on 2008-09-12 02:18, edited 43 times in total.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby Chris Cornell » 2007-07-13 08:23

tiny question: Isn't the realtime-preempt patch-2.6.22.1-rt2 supposed to work on version 2.6.22.1 of the linux kernel?
etch || 2.6.24-rt1 || NVIDIA 169.09 || fvwm cvs patched || pekwm

Licence: by-nc-sa
User avatar
Chris Cornell
 
Posts: 18
Joined: 2007-07-10 09:12

Postby Telemachus » 2007-07-13 10:52

Two things worth knowing about 2.6.22 that could be "gotchas" for some people - both were for me when I built on earlier this week. First, if you have SATA/PATA drives look through the section on your drives very carefully since things have moved around a bit again. Second, if you have SATA/PATA drives, you may experience an error at shutdown about your disc not spinning down properly. It's not exactly the kernel, but it's also not going away super soon, as far as I can tell. Here's a link: SATA shutdown info
User avatar
Telemachus
 
Posts: 4677
Joined: 2006-12-25 15:53

Postby mzilikazi » 2007-07-13 11:52

Chris Cornell wrote:tiny question: Isn't the realtime-preempt patch-2.6.22.1-rt2 supposed to work on version 2.6.22.1 of the linux kernel?

Yep. The rt patch got updated just as I was building and I forgot to make the change to the next kernel verion. ;/ Good catch!
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby Chris Cornell » 2007-07-13 19:45

mzilikazi wrote:
Chris Cornell wrote:tiny question: Isn't the realtime-preempt patch-2.6.22.1-rt2 supposed to work on version 2.6.22.1 of the linux kernel?

Yep. The rt patch got updated just as I was building and I forgot to make the change to the next kernel verion. ;/ Good catch!


anyway..thx for your hint! ^-^
etch || 2.6.24-rt1 || NVIDIA 169.09 || fvwm cvs patched || pekwm

Licence: by-nc-sa
User avatar
Chris Cornell
 
Posts: 18
Joined: 2007-07-10 09:12

Postby ea66 » 2007-07-14 00:46

A silly question maybe but is this patch suitable for laptops? I mean, won't this real time kernel force a higher power consumption and as a result shorten the battery life?
ea66
 
Posts: 7
Joined: 2007-06-13 15:21
Location: Poland

Postby Telemachus » 2007-07-14 01:59

It's a good question. As I understand it, the real time patches and other "alternative" scheduling patches have to do with how the kernel handles scheduling of different jobs and preemption. I'm not sure that it has to mean a full-throttle cpu. So, for example, I think you could have a notebook with a rt kernel, but still set the cpu-governor to "on demand" or "conservative" to preserve battery life. But I'll admit, I'm guessing here. Anybody else?
User avatar
Telemachus
 
Posts: 4677
Joined: 2006-12-25 15:53

Real-time Linux Kernel Debian Etch

Postby rdegraaf » 2007-07-18 21:34

I noticed that many people use the kernel from kernel.org while the kernel-source is in the package repository.

Here a how-to for real-time Linux Kernel for Debian Etch.
http://www.rdegraaf.nl/DEBIAN_Etch-realtime

Have fun and keep the latency below few ms :)
rdegraaf
 
Posts: 4
Joined: 2007-07-18 21:29

Re: Real-time Linux Kernel Debian Etch

Postby mzilikazi » 2007-07-19 01:48

rdegraaf wrote:Here a how-to for real-time Linux Kernel for Debian Etch.
http://www.rdegraaf.nl/DEBIAN_Etch-realtime

While realtime-lsm might still be available in the Debian repos it is deprecated. This is not the same thing as the realtime patch from Ingo Molnar.

You can use source from anywhere you please but what version of Debian you build the kernel for (Etch, Sid) is irrelevant. If you choose to use Debian repos for kernel source you are (obviously) limited to "what's in stock" at the time. If you go to kernel.org you have it all.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

thank you

Postby rdegraaf » 2007-07-19 09:13

@mzilikazi: thank you for the information, I did not know there was another (new) patch. I also updated the info in the link above.

Best Regards,

Rob
rdegraaf
 
Posts: 4
Joined: 2007-07-18 21:29

Postby jongi » 2007-07-29 15:27

As a matter of interest, do you have any particular reason for using make oldconfig instead of say menuconfig?
jongi
 
Posts: 477
Joined: 2007-04-15 02:41

oldconfig vs menuconfig

Postby rdegraaf » 2007-07-29 16:20

make oldconfig copies the current settings and asks you for new settings which are introduced in the new config.
rdegraaf
 
Posts: 4
Joined: 2007-07-18 21:29

Postby Telemachus » 2007-07-29 16:47

Think of it this way, with "make oldconfig" you don't have to search out the new options and you don't have to mess with the old (and presumably functioning) options. Sometimes, though, it can be a bit more complex because a new option can affect an old one. I usually start with "make oldconfig" and then check over key things (filesystems, disc support, wireless, etc.) more fully with "make menuconfig".
User avatar
Telemachus
 
Posts: 4677
Joined: 2006-12-25 15:53

Postby mzilikazi » 2007-10-07 23:19

Updated and added bootsplash patch. Bootsplash needs to be applied first against 2.6.22 source then -rt and/or 2.6.23-rc9 patch. Any other patches after that should apply fine.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby garrincha » 2007-10-09 20:35

I made my own bootsplash art, here's a screenshot of the fb console:
Image

Bootsplash and silent bootsplash images:
http://xs220.xs.to/xs220/07412/bootsplash-1024x768.jpg
http://xs320.xs.to/xs320/07412/silent-1024x768.jpg
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Next

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable