[分享]看到一篇E文的编译内核的好文, 编辑后分享给大家
发表于 : 2007-07-13 11:11
1. 安装必须的包
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2
2. 下载内核源码包
www.kernel.org
e.g. linux-2.6.18.1.tar.bz2
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/ ... .1.tar.bz2
tar xjf linux-2.6.18.1.tar.bz2
ln –s linux-2.6.18.1 linux
cd /usr/src/linux
3. 配置内核
建议用老的配置文件/boot/config-xxxxx
cp /boot/config-`uname –r` ./.config
make menuconfig
导入现有配置文件后, 修改你所需要的参数, 保存退出
4. 编译内核
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers
5. 安装内核
成功编译后, 在/usr/src下会有两个.deb 的安装包
dpkg -i linux-image-2.6.18.1-custom_2.6.18.1-custom-10.00.Custom_i386.deb
dpkg -i linux-headers-2.6.18.1-custom_2.6.18.1-custom-10.00.Custom_i386.deb
检查/boot/grub/menu.list
重启检测
完
谢谢
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2
2. 下载内核源码包
www.kernel.org
e.g. linux-2.6.18.1.tar.bz2
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/ ... .1.tar.bz2
tar xjf linux-2.6.18.1.tar.bz2
ln –s linux-2.6.18.1 linux
cd /usr/src/linux
3. 配置内核
建议用老的配置文件/boot/config-xxxxx
cp /boot/config-`uname –r` ./.config
make menuconfig
导入现有配置文件后, 修改你所需要的参数, 保存退出
4. 编译内核
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers
5. 安装内核
成功编译后, 在/usr/src下会有两个.deb 的安装包
dpkg -i linux-image-2.6.18.1-custom_2.6.18.1-custom-10.00.Custom_i386.deb
dpkg -i linux-headers-2.6.18.1-custom_2.6.18.1-custom-10.00.Custom_i386.deb
检查/boot/grub/menu.list
重启检测
完
谢谢