Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel7-yum | 4.1 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package ncurses-devel.x86_64 0:5.9-13.20130511.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================
Package Arch Version Repository Size
=================================================
Installing:
ncurses-devel x86_64 5.9-13.20130511.el7 rhel7-yum 713 k
Transaction Summary
Total download size: 713 k
Installed size: 2.1 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ncurses-devel-5.9-13.20130511.el7.x86_64 1/1
Verifying : ncurses-devel-5.9-13.20130511.el7.x86_64 1/1
Installed:
ncurses-devel.x86_64 0:5.9-13.20130511.el7
Complete!
[root@xiaolyu ~]#
3.解压内核源码包
xz -d 解压 .xz的压缩包
tar xf 解压.tar的压缩包
[root@xiaolyu sdb1]# ls
linux-4.7.2.tar.xz
[root@xiaolyu sdb1]# xz -d linux-4.7.2.tar.xz
[root@xiaolyu sdb1]# ls
linux-4.7.2.tar
[root@xiaolyu sdb1]# tar xf linux-4.7.2.tar
[root@xiaolyu sdb1]# ls
linux-4.7.2 linux-4.7.2.tar
[root@xiaolyu sdb1]#
[root@xiaolyu sdb1]# ls
linux-4.7.2 linux-4.7.2.tar
[root@xiaolyu sdb1]# cd linux-4.7.2
[root@xiaolyu linux-4.7.2]# ls
arch CREDITS firmware ipc lib net scripts usr
block crypto fs Kbuild MAINTAINERS README security virt
certs Documentation include Kconfig Makefile REPORTING-BUGS sound
COPYING drivers init kernel mm samples tools
[root@xiaolyu linux-4.7.2]# more README
#说明:这个地方可以查看README文件,每个源码包都有,里面给出了详细的安装编译配置信息。
4. 清理系统缓存。
尽可能给内核编译留出最大的内存空间。
查看系统缓存 free -m :
[root@xiaolyu linux-4.7.2]# free -m
total used free shared buff/cache available
Mem: 7969 611 5341 10 2015 7040
Swap: 2047 0 2047
[root@xiaolyu linux-4.7.2]#
查看默认缓存设置:cat /proc/sys/vm/drop_caches
[root@xiaolyu linux-4.7.2]# free -m
total used free shared buff/cache available
Mem: 7969 611 5341 10 2015 7040
Swap: 2047 0 2047
[root@xiaolyu linux-4.7.2]# cat /proc/sys/vm/drop_caches
0
[root@xiaolyu linux-4.7.2]# sync
[root@xiaolyu linux-4.7.2]# echo 3 > /proc/sys/vm/drop_caches #buff和cache都清空
[root@xiaolyu linux-4.7.2]# free -m
total used free shared buff/cache available
Mem: 7969 571 7214 10 183 7194
Swap: 2047 0 2047
[root@xiaolyu linux-4.7.2]#
#说明:/proc/sys/vm/drop_cashes的值有三个:
0:buff/cache都不要清理。
1:只清理buff。
2:只清理cache。
3:buff和cache都清理。
说明:重启(reboot和init 6)一样能清空缓存.
5. 通过图形界面配置内核编译参数,生成内核参数配置文件。
make menuconfig 生成内核参数配置文件。