如何编译安装新内核

 

如何编译安装新内核 linux

内核的简单介绍: vim

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

1.拥有新版本的内核 ide

    [root@feng linux-2.6.28.10]# lftp 172.16.0.1 ui

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

lftp 172.16.0.1:/pub/Sources/kernel> get linux-2.6.28.10.tar.gz  操作系统

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

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

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

[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

其实在咱们从新启动计算机的时候在出现图画的时候按一下出现以下画面,也能够证实咱们的内核已经安装成功。

1、配置内核的其余方法:

    #yum groupinstall "KDE Software Development" 

    #make  xconfig

    #yum groupinstall "GNOME Software Development"

    #make gconfig

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

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

    #make clean

此方法会把.config 文件删除,因此若是还想回到之前的配置的话,要把这个文件保存到其余地方

    #make prproper  

3、在编译内核的时候,若是咱们运用远程链接的话,万一网络出现了问题,咱们所编译的内核就失败了,即便从新启动仍是要从新开始,因此咱们远程的时候能够运用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

相关文章
相关标签/搜索