Think before you speak, read before you think.

Debian操作系统编译内核

转自:

想用上最新的内核,就需要我们自己去编译新内核了

安装需求软件包

apt-get install kernel-package libncurses5-dev fakeroot wget build-essential

下载新内核

你可以在这里查看可用的内核 目前最新的为2.6.x

linux kernel 官方网站:http://www.kernel.org

cd /usr/src
wget http://www.eu.kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.tar.gz

解压 创建软链接,切换到软链接中操作

tar zxvf linux-2.6.26.tar.gz
ln -s linux-2.6.26 linux
cd /usr/src/linux

生成内核文件,首先要复制旧内核的配置文件

make clean && make mrproper
cp /boot/config-`uname -r` ./.config
make menuconfig

使用下面的步骤来载入旧的内核配置
1. Load an Alternate Configuration File
2. Type .config if not already in the textbox
3. Ok
4. Do any changes to the kernel modules
5. Click Exit
6. Click Yes when asked if you want to save

编译内核

make-kpkg clean
fakeroot make-kpkg –initrd –append-to-version=-custom kernel_image kernel_headers

这个过程需要很长时间

安装新内核

ls -l /usr/src

到这里,还没有安装内核,
dpkg -i linux-headers-2.6.26-custom_2.6.26-custom-10.00.Custom_i386.deb
dpkg -i linux-image-2.6.26-custom_2.6.26-custom-10.00.Custom_i386.deb

最后重新启动服务器即可

reboot


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *