CentOS RHEL 5.3 編譯核心

來源:互聯網
上載者:User

下載linux-2.6.29.4.tar.bz2到/usr/src 

# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.tar.bz2 
# tar -jxvf linux-2.6.27.tar.bz2
# cd linux-2.6.27
# make mrproper
# make menuconfig
# make clean
# make bzImage
# make modules
# make modules_install
# mkinitrd /boot/initrd_2.6.27.img 2.6.27

執行mkinitrd命令時,提示”No module dm-mem-cache found for kernel 2.6.27, aborting.”時,表明該版本的mkinitrd有bug。 
解決方案,1是當使用mkinitrd時,使用”-without-dmraid”這個參數。2是在使用mkinitrd之前,先建立一個noraid檔案。建立方法如下: 

# echo “DMRAID=no” > /etc/sysconfig/mkinitrd/noraid 
# chmod 755 /etc/sysconfig/mkinitrd/noraid

然後再運行mkinitrd命令。

 

這裡我採用了第一種辦法 

# mkinitrd /boot/initrd-2.6.27.img 2.6.27 –without-dmraid

執行完mkinitrd後,就要在啟動菜單中增加編譯好的核心資訊,以便啟動時可以選擇核心版本。 

# cp arch/x86/boot/bzImage /boot/vmlinuz-2.6.27 
# cp System.map /boot/System.map-2.6.27

開啟/etc/grub.conf檔案,增加以下內容到檔案結尾。

title CentOS (2.6.27) 
root (hd0,0)
kernel /vmlinuz-2.6.27 ro root=LABEL=/
initrd /initrd-2.6.27.img

儲存,重啟,進行grub的啟動菜單中,選擇”CentOS(2.6.27)”,即可使用編譯好的核心。 
如果你覺得make modules_install後面的步驟太麻煩的話,就直接用下面的命令讓系統幫你做好了 

# make install

下面是運行時的提示資訊: 

sh /usr/src/linux-2.6.27/arch/x86/boot/install.sh 2.6.27 arch/x86/boot/bzImage System.map “/boot” 
WARNING: No module dm-mem-cache found for kernel 2.6.27, continuing anyway
WARNING: No module dm-message found for kernel 2.6.27, continuing anyway
WARNING: No module dm-raid45 found for kernel 2.6.27, continuing anyway

這些只是提示,對系統沒有什麼影響,經本人查閱相關的資料。 
可能是核心和mkinitrd的BUG,大家可以參考一下這篇文章 
https://bugzilla.redhat.com/show_bug.cgi?id=488991 
通過給核心打dm-raid45這個補丁,可以解決掉”WARNING: No module dm-raid45 found for kernel 2.6.29.4, continuing anyway”這個提示 
http://people.redhat.com/~heinzm/sw/dm/dm-raid45/ 
至於其他的兩個沒有仍然找不到解決的辦法,希望大家知道的,給我留言!

謝謝!

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.