现在的位置: 首页 > 综合 > 正文

虚拟机内x86平台linux内核配置、编译与安装 RHEL5

2013年10月11日 ⁄ 综合 ⁄ 共 1615字 ⁄ 字号 评论关闭

原文地址:http://blog.sina.com.cn/s/blog_5e29f64301019b3g.html

在网站www.kernel.org 下载内核文件

拷贝到合适目录下

进入内核目录

将虚拟机安装的RHEL5的内核配置文件直接拷贝过来使用

[root@localhost linux-2.6.29]# cp /boot/config-2.6.18-53.el5  .config

[root@localhost linux-2.6.29]# ls -a  .config  (显示隐藏文件.config)

.config

[root@localhost linux-2.6.29]# make menuconfig

  HOSTCC  scripts/kconfig/conf.o

  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] Error 1

make: *** [menuconfig] Error 2

 

[root@localhost gy]# rpm -qa | grep ncurses

ncurses-5.5-24.20060715

正如提示所说,缺少了:ncurses-devel

到安装光盘server文件夹下找到ncurses-devel-5.5-24.20060715.i386.rpm

拷贝到tmp文件夹下

安装

[root@localhost tmp]# rpm -ivh ncurses-devel-5.5-24.20060715.i386.rpm

warning: ncurses-devel-5.5-24.20060715.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:ncurses-devel          ########################################### [100%]

 

重新输入命令

[root@localhost linux-2.6.29]# make menuconfig

错误提示Your display is too small to run Menuconfig!终端窗口太小,最大化即可。

配置选项不必修改

直接保存退出

然后编译内核

#make bzImage

这个过程时间比较长

编译完成显示

Kernel: arch/x86/boot/bzImage is ready  (#1)

进入arch/x86/boot/查看

[root@localhost boot]# ls bzImage
bzImage

编译内核模块:# make modules

[root@localhost boot]# make modules
make: *** No rule to make target `modules'.  Stop.
退出到linux-2.6.29目录下

[root@localhost linux-2.6.29]# make modules
时间也比较长。

安装内核模块

#make modules_install

制作init ramdisk 

#mkinitrd initrd-2.6.19 2.6.29

安装内核

将内核和init ramdisk拷贝至/boot目录。

修改grub的配置文件

重启虚拟机 按f2进入系统选项

选择自己制作的内核启动即可。

完。

抱歉!评论已关闭.