虚拟机下redhat内核升级到2.6.16的成功经验

虚拟机下redhat内核升级到2.6.16的成功经验

弄了好几天,终于成功编译了Linux的新内核,相信很多人在编译内核时,也会遇到和我类似的问题,现我就将我的成功步骤和大家共享,这些内容是综合了很多关于在虚拟机下编译内核的帖子:

1、首先必须对一些相关软件进行升级。
1。1  device-mapper,在 ftp://sources.redhat.com/pub/dm下载   ÷cd /usr/src
tar -zxvf device-mapper.1.01.04.tgz
cd device-mapper.1.01.04
./configure --prefix=/usr     否则LVM2在配置时找不到libdevmapper.h
make all
make install

1。2. 安装 LVM2,在 ftp://sources.redhat.com/pub/lvm2下载  cd /usr/src
tar -zxvf LVM2.2.01.14.tgz
cd LVM2.2.01.14
./configure --prefix=/
make all
make install


1。3. 升级 mkinitrd 在 http://rpm.pbone.net/ 下查找  
rpm -Uvh mkinitrd-3.5.11-3.9.i386.rpm

1。4.update modutils 在 ftp://ftp.kernel.org/pub/linux/utils/kernel/modutils/  下载   
cd /usr/src
tar -zxvf modutils-2.4.27.tar.gz
cd modutils-2.4.27
./configure --prefix=/
make all
make install

1。5.安装module-init-tools,在 ftp://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools 下载  http://www.kernel.org/pub/linux/utils/kernel/module-init-tools
cd /usr/src
tar -zxvf module-init-tools-3.2-pre9.tar.gz
cd module-init-tools-3.2-pre9
./configure --prefix=/
make moveold
make
make install

2、下载内核
下载内核文件如:linux-2.6.16.tar.gz拷贝到/usr/src目录并解压缩。 注意一定要在Linux下解开,如果你是在Windows下解开Linux内核的话就会遇到这个问题,因为Windows不区分文件大小写,ipt_TOS.c和ipt_tos.c在Windows中是一回事,就被替换掉了,改在Linux下解开它就没有问题了。
# cd /usr/src
# tar zvxf linux-2.4.18-3.tar.gz

make mrproper
make menuconfig
make
make modules_install
make install

3、内核选项
配置2.6.16内核时如果你的主板是Intel芯片的话,你用默认配制也许就可以得到一个满意的内核哦。这里的难点是虚拟机下的SCSI选项,弄不好内核编译就必然失败。
  还有就是网卡,声卡芯片的型号了,他们的型号你都可以用lspci (非常重要的命令)查找到比如我的是。
你只要把你pci上的东西全部选择对了。 剩下就用默认的就可以了

1、Device Drivers -> Block devices ->
<*> RAM disk support
(16) Default number xxxxx
(16384) Default RAM disk size   一定要改为16384以上
  • Initial RAM disk (initrd) support

    2. 有SCSI卡(如VMware 中的BusLogic BT946C) 的要把它编译成模块(M) 不然会在make install 出错 。
    (其它关于SCSI的选项为内核内建,Buslogic可以选择为模块,只是最后需要制作initrd模块)
    Device Drivers  --->SCSI device support  ---><*>   SCSI disk support
    Device Drivers  --->SCSI device support  --->SCSI low-level drivers  ---> <*> BusLogic SCSI support

    Device Drivers  ---> Fusion MPT device support  ---><M> Fusion MPT (base + ScsiHost) drivers和<M>   Fusion MPT misc device (ioctl) driver(这个不确定)

    网卡驱动 :请务必把自己网卡对应的驱动编译进内核,常用的网卡是realtek 8139,以下就是这种网卡的配置,
    Device Drivers---> Networking support---> Ethernet (10 or 100Mbit) --->
    <M> RealTek RTL-8139 C+ PCI Fast Ethernet Adapter support (EXPERIMENTAL)
    <M> RealTek RTL-8139 PCI Fast Ethernet Adapter support
    <M> AMD PCnet32 PCI support(虚拟机)

    3、Device Drivers -> USB support ->USB HID Boot Protocol drivers ->
    [ M ]  USB HIDBP Keyboard support
    [ M ]  USB HIDBP Mouse support 必须选,否则不支持USB鼠标和USB键盘。

    Device Drivers ->  <*> ATA/ATAPI/MFM/RLL support
    <*> Intel PIIXn chipsets support  

    4、声卡驱动Sound card support ,也要选择自己声卡对应的驱动编译进内核,比较普遍的声卡是i810_audio,以下就是这种声卡的配置。
    关键是把Sound card support 以及 Advanced Linux Sound Architecture 里面的选项选成模块(M)
    Device Drivers ---> Sound --->
    <*> Sound card support
    Advanced Linux Sound Architecture --->
    <*> Advanced Linux Sound Architecture
    <*> Sequencer support
    < > Sequencer dummy client
    <*> OSS Mixer API
    <*> OSS PCM (digital audio) API
  • OSS Sequencer API
    <*> RTC Timer support
    PCI devices --->
    <*> Intel i8x0/MX440, SiS 7012; Ali 5455; NForce Audio; AMD768/8111
    Open Sound System --->
    < > Open Sound System (DEPRECATED)
    可以选上新支持的模块Advanced Linux Sound Architecture ,至于旧的Open Sound System 模块就不要再选了。

    5. 文件系统
    请务必要选中ext3文件系统,
    File systems--->
  • Ext3 journalling file system support
  • Ext3 Security Labels
  • JBD (ext3) debugging support

    File Systems --->Psedo File Systems --->
    [ * ] devfs support (OBSOLETE)
    [ * ] Automatically mount at boot


         配置内核是大多数新手编译内核时最大的难点,只要将以上选项编译进内核,成功的机会是大大的。
       以上是本人这几天来的经验总结,相信对大多数人都有指导作用,不足之处还请高手们指点。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值