1. 程式人生 > >linux6.4核心由2.6升級成3.6

linux6.4核心由2.6升級成3.6

安裝CentOS 6.4之後,核心預設是2.6.32。
由於docker需要3.0以上的核心,所以需要對核心進行升級。

1. 安裝必要元件
# yum -y install ncurses-devel # 後續的make menuconfig依賴於該元件

2. 下載合適的原始碼包並解壓
# wget -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.6.6.tar.xz
# tar -Jxvf linux-3.6.6.tar.xz
# mv linux-3.6.6 /usr/src/linux-3.6.6
# cd /usr/src/linux-3.6.6

3. 編譯配置
# make mrproper # 清除環境變數,即清除配置檔案
# make menuconfig # 在選單模式下選擇需要編譯的核心模組
進入Networking support —> Networking options —> Network packet filtering framework (Netfilter)
(1) Core Netfilter Configuration
A 勾選“Netfilter connection tracking support”。
B 將“NetBIOS name service protocal support”編譯成模組。
C 勾選“Netfilter Xtables support (required for ip_tables)”。
(2) IP: Netfilter Configuration
A 勾選“IPv4 connection tracking support (require for NAT)”。
B 勾選“IP tables support (required for filtering/masq/NAT)”。
C 將“Full NAT”下的“MASQUERADE target support”和“REDIRECT target support”編譯成模組。
(3) 其它模組可以根據自己的需要進行選擇(例如我需要勾選Ceph相關項),具體可以參考核心配置手冊。

4. 編譯和安裝
# make clean # 確保所有東西均保持最新狀態
# make bzImage # 生成核心檔案
# make modules # 編譯核心模組
# make modules_install # 編譯安裝模組
# make install # 安裝,如果出現了ERROR: modinfo: could not find module xxx,數量少的話,可以忽略。

5. 修改Grub引導順序
# vim /etc/grub.conf
default=0

6. 重啟並驗證
# reboot
# uname -r
---------------------

原文:https://blog.csdn.net/i_chips/article/details/28422503