- apt-get install bzip2 libncurses5-dev kernel-package zlib1g-dev gcc make kernel-package wget module-init-tools procps libncurses5-dev
- 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
咱们在内核配置里面至少有两个地方要修改。以下所示:linux
- File systems -> Btrfs filesystem (EXPERIMENTAL) Unstable disk format
在"Btrfs filesystem"以前标上<*>less
- Processor type and features -> Processor Family -> "our processor"
- 删除Dell laptop support、Toshiba Laptop support。
- 裁减sound card support。
- 裁减Bluetooth subsystem support。
- 裁减Wireless。
- 裁减Kernel hacking 。
- 屡次点击“ESC”退出,保存
- 在include/linux/version.h 中添加宏定义:
#define UTS_RELEASE 2.6.35.9es5
- make-kpkg linux-image linux-headers --initrd
- 编译成功后执行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
- 重启,用uname-a 查看内核版本
错误处理spa
编译完成后生成linux deb 包,先dpkg -i装image,再装headers orm
安装完成之后再update-grub 进入/boot/grub/menu.lst 中选择启动的内核项 默认的第一项为0ip
ps:在编译完成内核后开机可能出现 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 未生成的缘由不明 能够手动生成 ci
执行命令 rem
mkinitramfs -o /boot/initrd.img-2.6.34.10 2.6.34.10(/boot/initrd.img-2.6.34.10是这个启动加载文件的生成路径 2.6.34.10是 /lib/modules/2.6.34.10)而后update-grub 再启动新内核就没有问题了get
卸载一个已经安装的内核包it
debian卸载旧内核要先看看有哪些旧的内核,用命令:
dpkg --get-selections |grep linux
若是你的内核是以kernel开头的就把上面的linux改为kernel,以后再用
dpkg --purge --force-remove-essential linux-image-XXX