Chinaunix首页 | 论坛 | 博客
  • 博客访问: 376266
  • 博文数量: 80
  • 博客积分: 1750
  • 博客等级: 上尉
  • 技术积分: 1380
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-13 11:35
文章分类
文章存档

2014年(3)

2013年(1)

2012年(54)

2011年(22)

分类:

2012-10-23 18:44:59

原文地址:how to compile a kernel 作者:zhe_wang

 1,Download your tarball from ,or other websites.

  1. cp linux-2.6.0.tar.bz2 /usr/src
  2. tar xivf linux-2.6.0.tar.bz2
  3. (tar xzvf linux-2.6.0.tar.gz)
将下好的内核放在/usr/src目录下,解压。
---------------------------------------------------------------------------
2,cd into the linux directory. You'll now need to configure the kernel to 

select the features you want. and There are several ways to do this.

     2.1,make menuconfig

  我常用该方式配置要编译的内核。选择默认配置,就是进入配置的图形界
面后直接退出。 有时出现依赖库 ncurses   安装方式:
sudo apt-get install libncurses5-dev
---------------------------------------------------------------------------
3.now we can build the kernel

       make

  Wait. When its finished, it will have built both the kernel (bzImage) and the modules
-----------------------------------------------------------------------------

4,make modules_install

------------------------------------------------------------------------------

5,make install

 有些内核makefile把第六七步集成在第五步中了,那么就不需要执行6,7
没有集成在其中则需要执行6,7.

6,update-initramfs -c -k `cat include/config/kernel.release`

   该命令用来制作initramfs 
---------------------------------------------------------
7, update-grub 

 该命令用来更新grub
-------------------------------------------------------------------------------
安装好内核后reboot,然后查看新的内核uname -a

参考资料:
---------------------------------------------------------
阅读(561) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~