liunx-2

  经过两天的不断的 反复实验,我的fc6能上网了。昨天编译了内核,但是在grbu.conf里面的配置些错了。当时已经 凌晨一点半了,就睡觉了。今天早上起早总算是全搞定了。

下面,总结一下,fc6下怎样编译内核。

                1.先到www.kernel.org去下载你想要的内核版本。
                2.把它放到/usr/src下。
                3. [root@localhost src]# tar jxvf linux-2.6.19.2.tar.bz2用这个命令解压。也可以在桌面上解压.
            然后你的src下会生成一个linux-2.6.19.2的文件夹。这个要看你具体的内核。
            [root@localhost src]# cd linux-2.6.19.2
         4.内核配置:
            
[root@localhost linux-2.6.12.3]# make mrproper
             [root@localhost linux-2.6.12.3]# make menuconfig
           将出现一个界面,择你要的相应的模块。

         
内核配置有两种方法,一种是直接置入内核 * ;另一种是编成模块 M ;两种方法各有优点;直接编入内核的,比如设备的启动,不再需要加载模块的这一过程了;而编译成模块,则需要加载设备的内核支持的模块;但直接把所有的东 西都编入内核也不是可行的,内核体积会变大,系统负载也会过重。我们编内核时最好把极为重要的编入内核;其它的如果您不明白的,最好用默认。
 
                  上面都会有help,自己看就ok.
                  配置好后先要保存

                  Save Configuration to an Alternate File

                 出来一个

                 Enter a filename to which this configuration ,should be saved as an alternate. Leave blank to abort..config

                按回车就行了,这样就保存住了;
                然后退出 Exit ,这时也会出现保存 ;

       5.编译:
        
[root@localhost linux-2.6.12.3]# make
         [root@localhost linux-2.6.12.3]# make modules_install
       6.安装内核和设置grub.conf
         
1、复制bzImage等相关文件,并创建initrd文件;

         [root@localhost linux-2.6.12.3]# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.19.2
         [root@localhost linux-2.6.12.3]# cp System.map /boot/System.map-2.6.12.3
         [root@localhost linux-2.6.12.3]# /sbin/mkinitrd initrd-2.6.12.3.img 2.6.12.3

               我们把 编译出来的bzImage,拷入到/boot目录,拷贝成 vmlinuz-2.6.12.3;

                2.配置grub
            修改前:

            [root@localhost src]# vi /etc/grub.conf

             default=0
             timeout=5
             splashimage=(hd0,6)/grub/splash.xpm.gz
             hiddenmenu
            title Fedora Core (2.6.18-1.2798.fc6xen)
             root (hd0,6)
             kernel /xen.gz-2.6.18-1.2798.fc6
             module /vmlinuz-2.6.18-1.2798.fc6xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
             module /initrd-2.6.18-1.2798.fc6xen.img
            title Fedora Core (2.6.19-2)
            root (hd0,6)
            kernel /vmlinuz-2.6.19.2 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
            initrd /initrd-2.6.19.2.img
           title Other
           rootnoverify (hd0,0)
           chainloader +1

           添加:

           title Fedora Core (2.6.19-2)
            root (hd0,6)
            kernel /vmlinuz-2.6.19.2 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
            initrd /initrd-2.6.19.2.img

            配置后

             default=0
             timeout=5
             splashimage=(hd0,6)/grub/splash.xpm.gz
             hiddenmenu
            title Fedora Core (2.6.18-1.2798.fc6xen)
             root (hd0,6)
             kernel /xen.gz-2.6.18-1.2798.fc6
             module /vmlinuz-2.6.18-1.2798.fc6xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
             module /initrd-2.6.18-1.2798.fc6xen.img
            title Fedora Core (2.6.19-2)
            root (hd0,6)
            kernel /vmlinuz-2.6.19.2 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
            initrd /initrd-2.6.19.2.img
           title Other
           rootnoverify (hd0,0)
           chainloader +1


          最后,shutdown -r now    ok

          重起后选择你的内核版本。到此全部搞定。

           又是凌晨一点半了,我要去睡觉了。

                                                                                                                                                by   liang

                                                                                                                                                2007.1.27

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值