Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1719478
  • 博文数量: 1493
  • 博客积分: 38
  • 博客等级: 民兵
  • 技术积分: 5834
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-19 17:28
文章分类

全部博文(1493)

文章存档

2016年(11)

2015年(38)

2014年(137)

2013年(253)

2012年(1054)

2011年(1)

分类:

2012-07-10 08:43:44

1.查看当前系统原码版本

$ apt-cache search linux-source
linux-source - Linux kernel source with Ubuntu patches
linux-source-2.6.35 - Linux kernel source for version 2.6.35 with Ubuntu patches

2.下载源码
$ sudo apt-get install linux-source-2.6.35


下载完成后,在/usr/src目录中,可以看到压缩包
$ ls
linux-headers-2.6.35-22 linux-source-2.6.35
linux-headers-2.6.35-22-generic linux-source-2.6.35.tar.bz2

3.编译
$ sudo tar -xjvf linux-source-2.6.35.tar.bz2
$ sudo make menuconfig


HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
HOSTCC scripts/kconfig/conf.o
scripts/kconfig/conf.c: In function ‘conf_askvalue’:
scripts/kconfig/conf.c:105: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
scripts/kconfig/conf.c: In function ‘conf_choice’:
scripts/kconfig/conf.c:307: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
HOSTCC scripts/kconfig/kxgettext.o
*** Unable to find the ncurses libraries or the
*** required header files.
*** 'make menuconfig' requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
***
make[1]: *** [scripts/kconfig/dochecklxdialog] 错误 1
make: *** [menuconfig] 错误 2


缺少ncurses库,安装
$ sudo apt-get install libncurses5-dev


重新编译成功。也可以使用系统原来的配置来编译,oldconfig

$ sudo make oldconfig #编译内核

阅读(301) | 评论(0) | 转发(0) |
0

上一篇:vim

下一篇:find命令应用详解

给主人留下些什么吧!~~