liunx 内核升级

查看当前的内核版本

[root@localhost ~]# uname -r
3.10.0-693.el7.x86_64

下载内核

根据图片操作即可

上传软件包,解压软件包

[root@localhost ~]# ls
anaconda-ks.cfg awk linux-3.16.61.tar.xz

解压成tar包

[root@localhost ~]# xz -d linux-3.16.61.tar.xz
[root@localhost ~]# ls
anaconda-ks.cfg awk linux-3.16.61.tar

如果没有 xz 是需要安装的,yum -y install xz 解压过程需要等待几分钟

解压tar包

[root@localhost ~]# tar -xvf linux-3.16.61.tar ^C
[root@localhost ~]# ls
anaconda-ks.cfg awk linux-3.16.61 linux-3.16.61.tar

真正的操作来了

  1. 进入核心目录里
    [root@localhost ~]# cd linux-3.16.61/
    [root@localhost linux-3.16.61]#
  2. 图形化界面
    [root@localhost linux-3.16.61]# make menuconfig
    (图形化页面是为了生成一个.config 的隐藏文件)

编译安装的时候出现了报错信息(图形化工具)

[root@localhost linux-3.16.61]# make menuconfig
HOSTCC scripts/basic/fixdep
/bin/sh: gcc: 未找到命令
make[1]: *** [scripts/basic/fixdep] 错误 127
make: *** [scripts_basic] 错误 2

这些命令都可以用yum 安装,(之前我安装的是阿里云的yum,可以很好的解决这个问题)

[root@localhost linux-3.16.61]# make oldconfig //使用当前版本内核的设置

 HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#

[root@localhost linux-3.16.61]# sh -c ‘yes “” | make oldconfig’ //使用当前内核的配置,新配置,使用默认

scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#

上述步骤执行完成后会生成一个.config文件,即编译内核所需要的配置文件。编辑生成的 .config 文件,将CONFIG_SYSFS_DEPRECATED_V2 改成CONFIG_SYSFS_DEPRECATED_V2=y,否则会出现“Kernel panic – not syncing: Attempted to kill init!”的错误。

2 编译并安装内核

2.1 make // 编译过程大约需一个小时(这 个取决于i的机器)

(这个环节我出了一个小小的错误,说没有bc命令,这个通过yum安装报错命令就可以了)

liunx 的内核是用C语言编写的,所以要需要有支持C语言的环境

2.2 make modules_install install

https://blog.csdn.net/guoxiaojie_415/article/details/50573829

http://blog.51cto.com/it168/1141702
https://www.cnblogs.com/niyeshiyoumo/p/6762193.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

运维螺丝钉

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值