如何編譯安裝新核心
如何編譯安裝新核心
核心的簡單介紹:
“核心”指的是一個提供硬體抽象層、磁碟及檔案系統控制、多工等功能的系統軟體。一個核心不是一套完整的作業系統。一套基於Linux核心的完整作業系統叫作Linux作業系統,或是GNU/Linux。
1.擁有新版本的核心
[[email protected]linux-2.6.28.10]#lftp172.16.0.1
lftp172.16.0.1:~>cd/pub/Sources/kernel/
lftp172.16.0.1:/pub/Sources/kernel>getlinux-2.6.28.10.tar.gz
2.配置新核心,選定要啟用的功能和模組
[[email protected]
[[email protected]~]#cd/usr/src/
[[email protected]src]#tarxvflinux-2.6.28.10.tar.gz
[[email protected]src]#ln-svlinux-2.6.28.10.tar.gz/usr/src/linux
[[email protected]src]#yumgroupinstall"DevelopmentTools""DevelopmentLibraries"
[[email protected]
[[email protected]linux-2.6.28.10]#makemenuconfig
ESE鍵兩下返回上級目錄
[]:不啟用此項
[*];直接編譯進核心
[M]:編譯成模組
3.編譯新核心
[[email protected]linux-2.6.28.10]#make
4.安裝
[[email protected]linux-2.6.28.10]#makemodules_install
[[email protected]linux-2.6.28.10]#makeinstall
[[email protected]
5.驗證
[[email protected]~]#uname-r
2.6.18-164.el5
你會發現核心沒有改變,其實那個核心已經安裝好了
[[email protected]~]#vim/boot/grub/grub.conf
default=1
timeout=5
splashp_w_picpath=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
titleRedHatEnterpriseLinuxServer(2.6.28.10-feng)
root(hd0,0)
kernel/vmlinuz-2.6.28.10-fengroroot=/dev/vol0/rootrhgbquiet
initrd/initrd-2.6.28.10-feng.img
titleRedHatEnterpriseLinuxServer(2.6.18-164.el5)
root(hd0,0)
kernel/vmlinuz-2.6.18-164.el5roroot=/dev/vol0/rootrhgbquiet
initrd/initrd-2.6.18-164.el5.img
titleInstallRedHatEnterpriseLinux5
root(hd0,0)
kernel/vmlinuz-5ks=http://172.16.0.1/workstation.cfgksdevice=eth0noipv6
initrd/initrd-5
password--md5$1$FSUEU/$uhUUc8USBK5QAXc.BfW4
你能夠看到你安裝的那個核心,為了讓系統重啟的時候能夠使用你新安裝的核心,你可以將default=1中的1改為0,在重新啟動計算機。
在證明一次發現核心已經改變了
[[email protected]~]#uname-r
2.6.28.10-feng
其實在我們重新啟動計算機的時候在出現圖畫的時候按一下e出現如下畫面,也可以證明我們的核心已經安裝成功。
一、配置核心的其他方法:
#yumgroupinstall"KDESoftwareDevelopment"
#makexconfig
#yumgroupinstall"GNOMESoftwareDevelopment"
#makegconfig
#makeconfig用的時候很是痛苦要一個一個的指明是否編譯
二、在已經編譯過的核心原始碼基礎上重新編譯:
#makeclean
此方法會把.config檔案刪除,所以如果還想回到以前的配置的話,要把這個檔案儲存到其他地方
#makeprproper
三、在編譯核心的時候,如果我們運用遠端連線的話,萬一網路出現了問題,我們所編譯的核心就失敗了,即使重新啟動還是要重新開始,所以我們遠端的時候可以運用screen
[[email protected]~]#screen進入另一個介面
當我們編譯的時候按Ctrl+a再按d及退出
screen-ls檢視
[[email protected]~]#screen-ls
Thereisascreenon:
4112.pts-1.feng (Attached)
1Socketin/var/run/screen/S-root.
screen-r加號(4112)進去某個screen裡
[[email protected]~]#screen-r4412
轉載於:https://blog.51cto.com/fengjunfei/790436