cd /usr/src wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.35.9.tar.bz2 tar -xvjf linux-2.6.35.9.tar.bz2 cp /boot/config-`uname -r` /usr/src/linux-2.6.35.9/.config Then we must configure the new kernel: cd linux-2.6.35.9 make menuconfig
裁剪不需要的东西
我们在内核配置里面至少有几个地方要修改。如下所示:
1 2 3 4 5 6 7 8 9 10 11
>File systems -> Btrfs filesystem (EXPERIMENTAL) Unstable disk format 在"Btrfs filesystem"之前标上<*> Processor type and features -> Processor Family -> "our processor" 删除Dell laptop support、Toshiba Laptop support。 裁减sound card support。 裁减Bluetooth subsystem support。 裁减Wireless。 裁减Kernel hacking 。 多次点击“ESC”退出,保存 make-kpkg linux-image linux-headers --initrd 编译成功后执行
1 2 3
cd .. dpkg -i linux-image-2.6.29_2.6.35.9-10.00.Custom_i386.deb dpkg -i linux-headers-2.6.29_2.6.35.9-10.00.Custom_i386.deb
在编译完成内核后开机可能出现 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)的错误 在/boot/grub/menu.lst中可以发现新加的内核可能是没有 initrd /initrd.img-2.6.37.6 未生成的原因不明 可以手动生成 执行命令