如何编译安装新内核

 

如何编译安装新内核

内核的简单介绍:

   内核指的是一个提供硬件抽象层、磁盘及文件系统控制、多任务等功能的系统软件。一个内核不是一套完整的操作系统。一套基于Linux内核的完整操作系统叫作Linux操作系统,或是GNU/Linux

1.拥有新版本的内核

    [root@feng linux-2.6.28.10]# lftp 172.16.0.1

    lftp 172.16.0.1:~> cd /pub/Sources/kernel/

lftp 172.16.0.1:/pub/Sources/kernel> get linux-2.6.28.10.tar.gz 

2.配置新内核,选定要启用的功能和模块

[root@feng ~]# mv linux-2.6.28.10.tar.gz  /usr/src/

[root@feng ~]#cd /usr/src/

[root@feng src]#tar xvf linux-2.6.28.10.tar.gz 

[root@feng src]# ln -sv linux-2.6.28.10.tar.gz /usr/src/linux

[root@feng src]#yum groupinstall "Development Tools" "Development Libraries"

[root@feng src]#cd linux-2.6.28.10

    [root@feng linux-2.6.28.10]#make menuconfig

   

   ESE键两下 返回上级目录

   [ ] :不启用此项

   [*];直接编译进内核

   [M]:编译成模块

3.编译新内核

    [root@feng linux-2.6.28.10]# make

4.安装

    [root@feng linux-2.6.28.10]# make modules_install

    [root@feng linux-2.6.28.10]# make install

    [root@feng linux-2.6.28.10]#reboot

5.验证

    [root@feng ~]# uname -r

    2.6.18-164.el5

你会发现内核没有改变,其实那个内核已经安装好了

    [root@feng ~]# vim /boot/grub/grub.conf

    default=1

    timeout=5

    splashp_w_picpath=(hd0,0)/grub/splash.xpm.gz

    hiddenmenu

    title Red Hat Enterprise Linux Server (2.6.28.10-feng)

           root (hd0,0)

           kernel /vmlinuz-2.6.28.10-feng ro root=/dev/vol0/root rhgb quiet

           initrd /initrd-2.6.28.10-feng.img

    title Red Hat Enterprise Linux Server (2.6.18-164.el5)

           root (hd0,0)

           kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/vol0/root rhgb quiet

           initrd /initrd-2.6.18-164.el5.img

    title Install Red Hat Enterprise Linux 5

           root (hd0,0)

           kernel /vmlinuz-5 ks=http://172.16.0.1/workstation.cfg ksdevice=eth0 noipv6

           initrd /initrd-5

           password --md5 $1$FSUEU/$uhUUc8USBK5QAXc.BfW4

你能够看到你安装的那个内核,为了让系统重启的时候能够使用你新安装的内核,你可以将default=1中的1改为0,在重新启动计算机。

在证明一次发现内核已经改变了

     [root@feng ~]# uname -r

     2.6.28.10-feng

其实在我们重新启动计算机的时候在出现图画的时候按一下出现如下画面,也可以证明我们的内核已经安装成功。

一、配置内核的其他方法:

    #yum groupinstall "KDE Software Development" 

    #make  xconfig

    #yum groupinstall "GNOME Software Development"

    #make gconfig

    #make config 用的时候很是痛苦 要一个一个的指明是否编译

二、在已经编译过的内核源码基础上重新编译:

    #make clean

此方法会把.config 文件删除,所以如果还想回到以前的配置的话,要把这个文件保存到其他地方

    #make prproper  

三、在编译内核的时候,如果我们运用远程连接的话,万一网络出现了问题,我们所编译的内核就失败了,即使重新启动还是要重新开始,所以我们远程的时候可以运用screen

    [root@feng ~]# screen 进入另一个界面

当我们编译的时候按Ctrl+a 再按及退出

screen -ls 查看

    [root@feng ~]# screen -ls

    There is a screen on:

   4112.pts-1.feng   (Attached)

    1 Socket in /var/run/screen/S-root.

screen -r 加号(4112) 进去某个screen里 

    [root@feng ~]#screen  -r  4412

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章