編譯安裝內(nèi)核
- 先下載https://www.kernel.org/ 下載內(nèi)核文件,tar xf linux-版本tar.xz
- 復(fù)制/boot/下的config-版本號
- cp /boot/config-2.6.32-696.el6.x86_64 linux-3.16.45/config
- 安裝開發(fā)包組
- yum groupinstall "Development Tools"
- tar 解壓 tar xf linux-3.18.56.tar.xz 壓縮包
- cd 切換至解壓目錄
- cp拷貝/boot/下的 cp /boot/config-2.6.32-696.el6.x86_64 至安裝目錄并改名叫.cinfig文件(拷貝模板文件)
- 使用圖形化工具
[root@centos6 linux-3.16.45]# make menuconfig
鲤遥、 HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.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
使用yum源安裝工具
[root@centos6 linux-3.16.45]# yum -y install ncurses-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package ncurses-devel.x86_64 0:5.7-4.20090207.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================
Installing:
ncurses-devel x86_64 5.7-4.20090207.el6 base 641 k
Transaction Summary
=====================================================================================================================================
Install 1 Package(s)
Total download size: 641 k
Installed size: 1.7 M
Downloading Packages:
ncurses-devel-5.7-4.20090207.el6.x86_64.rpm | 641 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : ncurses-devel-5.7-4.20090207.el6.x86_64 1/1
Verifying : ncurses-devel-5.7-4.20090207.el6.x86_64 1/1
Installed:
ncurses-devel.x86_64 0:5.7-4.20090207.el6
Complete!
- 打開圖形化工具[root@centos6 linux-3.16.45]# make menuconfig
General setup ---> : 通用設(shè)置箭頭表示子菜單
-
回車進(jìn)入通用設(shè)置子菜單;定義內(nèi)核的小版本設(shè)置好后使用tab鍵后按回車回到上級菜單
-
網(wǎng)絡(luò)設(shè)置的子菜單
-
設(shè)置文件系統(tǒng)類型
設(shè)置編譯時是否支持NTFS功能
進(jìn)入后選中敲空格鍵
- 編譯內(nèi)核
make [-j #] - 安裝內(nèi)核模塊
make modules_install -
拷貝內(nèi)核文件
make install
- 單獨(dú)編譯嗎某個模塊
- 刪除編譯生成的文件
- 卸載時刪除安裝時生成的目錄
- 刪除boot跟安裝內(nèi)核版本有關(guān)的所有文件低滩,以及修改grub文件
- 刪除/lib/modules/ 目錄下不需要的內(nèi)核庫文件
- 刪除解壓目錄下不需要的內(nèi)核源碼
- 刪除/boot 目錄下啟動的內(nèi)核和內(nèi)核映像文件
- 更改grub的配置文件假丧,刪除不需要的內(nèi)核啟動列表