Using the 2.6.33-rt kernel series on Ubuntu Lucid

本文提供了一步一步的指南来帮助您在Ubuntu上从源代码编译带有实时补丁的Linux内核。该过程包括下载源码、应用实时补丁、配置内核选项、构建内核以及安装最终的软件包。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://ubuntuforums.org/showthread.php?t=1470264

 

1. Download the source. Find it here:
mainline kernel source: http://www.kernel.org/pub/linux/kernel/v2.6/
rt patch: http://www.kernel.org/pub/linux/kernel/projects/rt/
Make sure the version numbers of the kernel source and the rt patch are the same!!
(I create a /home/<username>/Downloads/kernel directory and put everything in there.)
Extract the kernel source and the rt patch. Rename the extracted kernel source directory from linux-2.6.33.4 to linux-2.6.33.4-rt20.
Open a terminal and go to that directory - we'll run our commands from there.

Code:
cd /home/<username>/Downloads/kernel/linux-2.6.33.4-rt20
2. Apply the rt patch:
Code:
cat /home/<username>/Downloads/kernel/patch-2.6.33.4-rt20 |patch -p1
3. Configure the kernel:
Code:
make oldconfig
(copies the configuration of the currently running kernel, asking questions about any new items. The default selection will be capitalized - it's usually safest to select the default unless you know what you are doing. Be sure to select 'Complete Preemption (Real Time)')
Note: If you install 2.6.33-rt from one of the ppa's above and build your new kernel from there, 'make oldconfig' should complete with no questions asked.

Code:
make menuconfig
(lets you further tweak kernel configuration)
Essential changes: (kernel build will fail unless these changes are made)
Under device drivers/staging drivers, de-select Data acquisition support (comedi).
Under device drivers/staging drivers, de-select POHMELFS filesystem support.

Suggested tweaks:
Under Processor Type and Features, set Timer frequency to 1000 Hz. This will improve real time performance.
Under Processor Type and Features, make sure you have Preemption Mode set to Complete Preemption (Real Time).
Under kernel hacking, de-select 'compile kernel with debug info'. Not doing so results in an unnecessarily large kernel.
Under kernel hacking, de-select tracers. This eliminates a warning message on bootup and may help to keep latencies down.
Code:
make-kpkg clean
(Removes allergy-causing dust mites from the package? I don't know. Some places suggest running this command, and it doesn't take long.)

3. Build the kernel: (And be prepared to wait a while)
Code:
time fakeroot make-kpkg --initrd kernel-image kernel-headers
4. Fix the kernel postinstall scripts: (Only needs to be done the first time you build your kernel)
Code:
sudo cp /usr/share/doc/kernel-package/examples/etc/kernel/postinst.d/initramfs /etc/kernel/postinst.d/
(If this is not done, no initrd image will be generated and booting will fail.)
Code:
sudo mv /etc/kernel/postinst.d/nvidia-common /etc/kernel/postinst.d/nvidia-common.bak
(The nvidia-common script will cause installation to fail.)

5. Install the packages! (kernel-image first, then kernel-headers.)
They will be in the same directory as your kernel source directory. I usually double-click them in Nautilus and let gdebi do the installation.

With any luck, you should be able to reboot into a working system on the new kernel.

Last edited by trulan; July 29th, 2010 at 07:40 AM..
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值