linux内核源码升级,linux源码升级内核

linux源码升级内核

当前环境:[root@localhost ~]# uname -r

2.6.18-348.el5

配置流程:

1、准备yum库安装g++ gcc[root@localhost ~]# cat /etc/yum.repos.d/rh_5.9.repo

[rhel-server]

name=Red server

baseurl=file:///misc/cd/Server

enabled=1

gpgcheck=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[root@localhost ~]# yum -y install gcc g++

2、解压安装xz-5.0.5.tar.gz[root@localhost ~]# tar -zxf xz-5.0.5.tar.gz /usr/

[root@localhost ~]# cd /usr/

[root@localhost ~]# cd /usr/xz-5.0.5/

[root@localhost xz-5.0.5]# ./configure --prefix=/usr/local/

[root@localhost xz-5.0.5]# make

[root@localhost xz-5.0.5]# make install

2、验证安装xz-5.0.5.tar.gz是否成功[root@localhost xz-5.0.5]# which xzcat

/usr/local/bin/xzcat

3、安装linux-2.6.32.61.tar.xz[root@localhost usr]# cd /root/

[root@localhost ~]# unxz linux-2.6.32.61.tar.xz

[root@localhost ~]# tar -xf linux-2.6.32.61.tar -C /usr/

4、把/boot/config-2.6.18-348.el5 .config复制到刚才解压的位置命名

为"config"加快速度,减少出错。[root@localhost ~]# cd /usr/

[root@localhost usr]# cp  /boot/config-2.6.18-348.el5  .config

5、配置[root@localhost usr]# cd linux-2.6.32.61/

[root@localhost linux-2.6.32.61]# make menuconfig

*** 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

[root@localhost linux-2.6.32.61]# yum -y install ncurses-devel //出现如

上错误,安装这个包即可

[root@localhost linux-2.6.32.61]# make menuconfig

展开File systems ---> DOS/FAT/NT Filesystems ---> NTFS file system support,设为[M]

展开Device Drivers ---> IEEE 1394 (FireWire) supports ---> FireWire driver stack,设为[ ]

(Exit 回车,重复多次,最后选择yes确认,保存到.config 配置文件)       //编辑模块,根据自我定义增加和删除

编辑“.config”在末行添加

CONFIG_DEBUG_SECTION_MISMATCH=y             //查看更详细输出

CONFIG_SYSFS_DEPRECATED_V2=y                //启用新版sysfs路径

下面编译内核时间较长大约40分钟,你可以去冲杯offce了[root@localhost linux-2.6.32.61]# make                 //编译内核

[root@localhost linux-2.6.32.61]# make modules          //编译模块

[root@localhost linux-2.6.32.61]# make modules_install //安装内核

不要把make modules_install写成make modules install

[root@localhost lmake install

16、启用新内核,修改默认引导项

[root@localhost lvim /etc/grub.conf

fba8d5423090cc415e1ad7c6233a965b.png

调整配置文件中的default项,由1改为0,然后重启即可。[root@localhost ~]# uname -r

2.6.32.61

注意:如果内核版本差太多,可能会失败。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值