编译自己功能定制的Fedora7内核



编译自己功能定制的Fedora7内核
 
第一步:
从 http://www.kernel.org/pub/ 下载需要的内核版本 
我照旧先下载一个和系统版本一样的内核源码下来
然后  www.2cto.com  
#cp  ~/Downlocd/linux-2.6.21.tar.gz  /usr/src
#cd /usr/src
#tar -xzf  linux-2.6.21.tar.gz
第二步:
#cp /boot/config-2.6.21-1.3194.fc7  ./.config
然后运行make oldconfig,
make oldconfig会提示新内核中出现的新配置选
项,旧的配置选项使用原有的.config中的配置。
 
再运行make menuconfig查看都选中了什么配置选项,根据自己的需要勾选或者去掉某些选项。
第三步:  www.2cto.com  
运行make
第四步:
安装编译模块
#make modules_install
第五步:
# cp    /usr/src/linux-2.6.21/arch/i386/boot/bzImage     /boot/vmlinuz-2.6.21
 
# cp   /usr/src/linux-2.6.21/System.map     /boot/System.map-2.6.21
 
第六步:
制作initrd-2.6.21.img
#cd /boot
#mkinitrd  /boot/initrd-2.6.21.img  2.6.21
(备注:Ubuntu/Debian下是用mkintramfs.
用法如下所示:
           mkintramfs 2.6.21  -o  /boot/initrd-2.6.21.img
其中2.6.21为/lib/modules下的相应内核目录名称.)
第七步:
修改文件/boot/grub/grub.conf添加新内核的启动项,
title Fedora (2.6.21-1.3194.fc7)
    root (hd0,7)  www.2cto.com  
    kernel /boot/vmlinuz-2.6.21-1.3194.fc7 ro root=LABEL=/ rhgb quiet vga=792
    initrd /boot/initrd-2.6.21-1.3194.fc7.img
title Fedora (2.6.21)
    root (hd0,7)
    kernel /boot/vmlinuz-2.6.21 ro root=LABEL=/ rhgb quiet
    initrd /boot/initrd-2.6.21.img
 
备注:笔者使用的台式机的有线网卡是marvell的型号marvell-88E8057,所以去marvell官网下载驱动,不确定在内核里面是否能支持,能用了就不管了。

相关内容

    暂无相关文章