Chinaunix首页 | 论坛 | 博客
  • 博客访问: 256130
  • 博文数量: 52
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 625
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-03 08:39
文章分类
文章存档

2011年(4)

2010年(5)

2009年(6)

2008年(37)

我的朋友

分类: LINUX

2008-04-06 21:42:21

   感谢发表此文章的朋友,把内核编译的过程叙述的那么详细.
   今天几乎什么也没有做,在ububtu下编译2.6的内核,老是出错,然后换了redhat9,本来是2.4.20版本的,正好在网上找到一篇编译redhat内核的文章,我按照其中所述的步骤,一步一步,足足整了两个小时,#reboot后,#uname -a,终于显示了2.4.26了,但是鼠标没有反映,我又查了下,网上说鼠标驱动没有被配置,我再试试,之后再把解决方法列出来.
 
 
1.   前言
       在我写这篇文章的时候,还是一个linux的初学者,经历了n次失败后的成功当然是兴奋的,于是很想把她写下来。
       我的操作系统是Redhat9,其内核版本为2.4.20-8 ,需要升级到2.4.26,采用全新的2.4.26内核源码进行升级,主要的参考资料是《The Linux Kernel HOWTO》,另外还有一些参考资料我想就不提了,免得误导象我一样的初学者。
       接下来有三个部分,“步骤索引”、“步骤说明”和“附录”,“步骤索引”真实的记录了我成功升级内核的步骤,“步骤说明”将对“步骤索引”一些注意事项进行说明,“附录”摘录自《The Linux Kernel HOWTO》的相关部分。
2.   步骤索引
[root@localhost src]# tar vxfj linux-2.4.26.tar.bz2
[root@localhost src]# ln Cs linux2.4.26 linux
[root@localhost src]# cd /usr/src/linux
[root@localhost linux]# cp /boot/config-2.4.20-8 .config
[root@localhost linux]# make menuconfig
[root@localhost linux]# make dep
[root@localhost linux]# make clean
[root@localhost linux]# make bzImage
[root@localhost linux]# make modules
[root@localhost linux]# make modules_install
[root@localhost linux]# cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.26
[root@localhost linux]# cp .config /boot/config-2.4.26
[root@localhost linux]# cp System.map /boot/System.map-2.4.26
[root@localhost linux]# mkinitrd /boot/initrd-2.4.26.img 2.4.26
[root@localhost linux]# cd /boot
[root@localhost boot]# rm -f System.map vmlinuz
[root@localhost boot]# ln -s System.map-2.4.26 System.map
[root@localhost boot]# ln -s vmlinuz-2.4.26 vmlinuz
[root@localhost boot]# cd grub
[root@localhost grub]# vi grub.conf
[root@localhost grub]# reboot
3.   步骤说明
       源码的升级,我将其归纳为源码准备、工具准备、配置内核、编译内核、安装模块、启动设置和重启7个步骤。我是以root的身份登录的,所以省略了用户切换的过程。
3.1. 源码准备
       这个没有什么好说的,到去下载就是。我这里下载的是linux-2.4.26.tar.bz2,将其放到/usr/src目录下面,使用下面的方法解压缩:
              [root@localhost src]# cd /usr/src
[root@localhost src]# tar vxfj linux-2.4.26.tar.bz2
[root@localhost src]# ln Cs linux2.4.26 linux
       解压缩完成后得到linux-2.4.26目录。喜欢图形界面的朋友可以不用这样,我在gnome下执行鼠标右键弹出菜单命令“解压缩到这里…”也能达到同样的目的,不过经常出错。
3.2. 工具准备
       我所使用的两个内核版本跨度不大,所以没有特别安装什么工具,如果是升级到2.6.x版本会需要一些而外的工具。
3.3. 配置内核
       这是编译内核最麻烦的地方了,我们将要面临一大堆驱动模块的配置选项,对于我这样的菜鸟就头晕了,开始时傻呼呼的按照网站上的一些资料介绍,执行make menuconfig或make xconfig,结果碰得“头破血流”。
       在redhat9下执行make xconfig,会提示需要qt,在我看来make menuconfig是最好用的,不过在此之前不需要着急。  内核配置的结果是在源码的顶级目录下生成一个.config文件,其中当然是保存了各种配置项的设定值,如果不想在那么多的似懂非懂的选项中选择的话,先执行下面的操作:
[root@localhost src]# cd /usr/src/linux
[root@localhost linux]# cp /boot/config-2.4.20-8 .config
       在redhat9安装完成后,/boot/config-2.4.20-8就是我们所需要的.config文件,只要将其复制到源码目录并改名成.config就可以了,这样,在执行下面的操作就能得到当前系统的配置,如果需要增加驱动模块,只需要作少量修改就可以了。(注意,如果使用ls的话,结果中我们看不到.config文件,加上选项 ls Cal就可以了。)
[root@localhost linux]# make menuconfig
[root@localhost linux]# make dep
[root@localhost linux]# make clean
       关于.config文件的说明请参考附录.config部分。
 
3.4. 编译内核
[root@localhost linux]# make bzImage
       当你看到类似以下信息,说明编译成功了
tools/build -b bbootsect bsetup compressed/bvmlinux.out CURRENT > bzImage
Root device is (3, 8)
Boot sector 512 bytes.
Setup is 4886 bytes.
System is 917 kB
make[1]: Leaving directory `/usr/src/linux-2.4.26/arch/i386/boot'
3.5. 安装模块
[root@localhost linux]# make modules
[root@localhost linux]# make modules_install
在make modules_install执行完成后,如果成功了,你将会在/lib/modules目录下看到2.4.26。
 
3.6. 启动设置
        [root@localhost linux]# cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.26
    [root@localhost linux]# cp .config /boot/config-2.4.26
[root@localhost linux]# cp System.map /boot/System.map-2.4.26
[root@localhost linux]# mkinitrd /boot/initrd-2.4.26.img 2.4.26
       很多资料上介绍了手工生成ramdisk的过程,mkinitrd可以帮我们完成这个稍微复杂的过程,如果这个操作执行成功,mkinitrd会在/boot目录下生成initrd-2.4.26.img文件。
[root@localhost linux]# cd /boot
[root@localhost boot]# rm -f System.map vmlinuz
[root@localhost boot]# ln -s System.map-2.4.26 System.map
[root@localhost boot]# ln -s vmlinuz-2.4.26 vmlinuz
  
       关于bzImage和System.map请参考附录。
 
我安装redhat9时选择的是grub,所以需要改变grub.config中的设置。
[root@localhost boot]# cd grub
[root@localhost grub]# vi grub.conf
    用vi打开/boot/grub/grub.conf文件,找到下面的两行,将其注释,并增加下面的内容。
#       kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/
#       initrd /boot/initrd-2.4.20-8.img
       kernel /boot/vmlinuz ro root=/dev/hda8
       initrd /boot/initrd-2.4.26.img
    root指定/挂载点的位置,如果不知道,可以使用df命令查看。
       这里有一点需要注意,整个启动设置可以使用一个命令make install来完成,不过会有很多问题,对grub.conf文件的设置就是其中之一,make install修改的grub.conf文件仍然使用”LABEL”符号,而这个符号在2.4.26的内核下已经不起作用了。
 
3.7. 重启
[root@localhost grub]# reboot
    但愿你也成功!
4.   总结
       网上的资料虽然丰富,但多数不系统,也没有随着环境的升级而得到及时的更正,很多时候找下来的资料都不知道实用于那个版本的操作系统或内核。举个小例子,在官方网站上有一个readme文件,其中说明如何编译内核,其中有这么几步操作:
              cd include
              rm Crf asm linux scsi
              ln Cs asm-i386 asm
              ln Cs linux linux
              ln Cs scsi scsi
 
如果执行了这些操作,在编译2.4.26的内核时会出现错误。
在没有人指导的情况下,最好能找比较系统点的资料,或者到书店买本书。我就是这样,多亏找到了《The Linux Kernel HOWTO》才使得我成功编译内核,否则还不知道要失败多少次呢。
5.   附录
.config
Everytime you compile and install the kernel image in /boot, you should also copy the corresponding config
file to /boot area, for documentation and future reference. Do NOT touch or edit these files!!
bzImage
The bzImage is the compressed kernel image created with command 'make bzImage' during kernel compile. It
important to note that bzImage is not compressed with bzip2 !! The name bz in bzImage is misleading!! It
stands for "Big Zimage". The "b" in bzImage is "big". Both zImage and bzImage are compressed with gzip.
The kernel includes a mini−gunzip to uncompress the kernel and boot into it. The difference is that the old
zImage uncompresses the kernel into low memory (the first 640k), and bzImage uncompresses the kernel into
high memory (over 1M). The only problem is that there are a very few machines where bzImage is known to
have problems (because the machines are buggy). The bzImage actually boots faster, but other than that,
there's no difference in the way the system *runs*. The rule is that if all drivers cannot fit into the zImage,
then you need to modularize more.
If the kernel is small, it will work as both a zImage and a bzImage, and the booted system runs the same way.
A big kernel will work as a bzImage, but not as a zImage. Both bootimages are gzipped, (bzImage is not
bzipped as the name would suggest), but are put together and loaded differently, that allows the kernel to load
in higher address space, that does not limit it to lower memory in the pathetic intel architecture. So why have
both? Backward compatability. Some older lilos and loadlins don't handle the bzImage format. Note, they
*boot* differently, but *run* the same. There is a lot of misinformation given out about what a bzImage file is
(mostly about it being bzip2ed).
System.map
System.map is a "phone directory" list of function in a particular build of a kernel. It is typically a symlink to
the System.map of the currently running kernel. If you use the wrong (or no) System.map, debugging crashes
is harder, but has no other effects. Without System.map, you may face minor annoyance messages.
Do NOT touch the System.map files.
 
另一篇
升级RH9.0到2.6.5内核全过程
linux-2.6.x内核发布后,与2.6.x内核配套的系统程序并没有相应的来得及更新, 升级过程会碰到很多问题。虽然网上已有很多关于升级到2.6.x文章,但总是有些细节没有作很好的总结,因此撰写本文将我的经验与大家分享一下。我是在虚拟机上将Linux系统从Redhat9.0升级到2.6.5内核,虚拟机软件为:VMware Workstation 4.0.5 build-6030。

 
准备工作
1、做好重要数据的备份工作,这是一个好习惯。
2、下载最新的2.6.x内核源码包
所有Linux内核的官方版本可以在 找到。内核2.6.5 具体的下载地址是:。
3、升级module-init-tools软件包
要编译与正常运行新的内核你需要升级一些软件包,这些信息在源码目录下的Documentation/Changes文件中,请根据你的实际情况选择升级。
特别要说明的是,因为2.4.x下的modutils工具包已经不在适合新的2.6.x内核, 必需将其升级到module-init-tools工具包.,我下载module-init-tools-3.0.tar.gz源码包的地方是:
接下来, 按照下列步骤安装module-init-tools工具包:
tar -zxvf module-init-tools-3.0.tar.gz
在module-init-tools-3.0目录下,
# configure --prefix=/
# make moveold
# make all install
# ./generate-modprobe.conf /etc/modprobe.conf
命令"make moveold"将把系统原来的modutils工具程序改名为"*.old"(比如,lsmod.old等等). NOTE! 这是非常重要的一步, 千万不要省略. 这将使得你可以继续使用原有的linux-2.4.x系统, 因为在2.4.x系统下, 新的module-init-tools工具包实际上是倚赖原来"*.old"程序来加载内核模块. 如果忘记了这一步也不要紧张, 可以先下载并安装原来的modutils程序包, 然后按照上面的步骤重来一遍就可以了.
新的module-init-tools工具包不再使用原来的/etc/modules.conf配置文件了, 而是使用新的配置文件/etc/modprobe.conf. 因此必需用命令"./generate-modprobe.conf /etc/modprobe.conf"来生成新的配置文件/etc/modprobe.conf.
如果你使用devfs系统你还需要复制modprobe.devfs 到/etc目录下。
当你升级完相关软件包之后,准备工作就算完成了,下面我们将进入到编译阶段。
配置,编译和安装linux-2.6.x内核
2.6的build系统与2.4有很大的不同,实际上是更加简单与方便了。
? 将linux-2.6.5.tar.gz 复制到 /usr/src/ 下
? tar -zxvf linux-2.6.5.tar.gz
? cd linux-2.6.5
? 如果是新内核没有编译过,就不需要用make mrproper 把原来编译产生的垃圾删除
? make menuconfig,进入内核选项卡。选择相应的配置时,有三种选择:
  Y--将该功能编译进内核
  N--不将该功能编译进内核
M--将该功能编译成可以在需要时动态插入到内核中的模块
在编译内核的过程中,最烦杂的事情就是这步配置工作了,很多新手都不清楚到底该如何选取这些选项。实际上在配置时,大部分选项可以使用其缺省值,只有小部分需要根据用户不同的需要选择。选择的原则是将与内核其它部分关系较远且不经常使用的部分功能代码编译成为可加载模块,有利于减小内核的长度,减小内核消耗的内存,简化该功能相应的环境改变时对内核的影响;不需要的功能就不要选;与内核关心紧密而且经常使用的部分功能代码直接编译到内核中。关于这方面,有很多文章,就不作详细介绍了。
其中要注意的是:RH9.0使用的是ext3文件系统,要把ext3 fs编译进内核。如果系统是SCSI硬盘,并且root fs在SCSI硬盘上,配置内核时也要把SCSI装置支持编译进内核。总之,升级后的系统需要什么,就要把相应的内容编译进内核。
? make
? make modules
? make modules_install
? make install
该命令是最近的从2.5.69内核(按照内核发布时间算)开始才有的选项,他可以帮你完成很多东西: (1)把压缩内核映象拷贝到/boot目录下, 并创建相应的System.map符号链接; (2)修改bootloader的配置文件; (3)调用mkinitrd程序创建内核的initrd映象. 对于GRUB而言, 将在/boot/grub/grub.conf配置文件增加如下类似的配置行:
title Red Hat Linux (2.6.5)
root(hd0, 0)
kernel /boot/vmlinuz-2.6.5 ro root=LABEL=/
initrd /boot/initrd-2.6.5.img
注意:一定要先编译并安装模块,再运行make install;否则可能会出现错误,导致升级失败!
? 修改/boot/grub/grub.conf配置文件。新内核并不识别"root=LABEL=/"这个启动参数, 如果现在你就重新启动新内核的话, 将发生kernel panic错误。因此,必需把这个" LABEL=/"替换成你真实的根分区,就OK了。
如何知道你的根目录""在哪个partition上? 命令为: # df
以下是偶机器的部分输出:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 3834496 1609188 2030520 45% /
/dev/hda1 101089 15154 80716 16% /boot
none 46548 0 46548 0% /dev/shm
可见,我的根目录在/dev/hda2上,需要将启动参数改为 "root=/dev/hda2"。
? 重启便可以看见kernel-2.6.5了。
声明:本升级过程参照了网上很多相关的文章,并且得到网友们的帮助,深表感谢!
如果文中有错误,恳请请大家指正。

又一篇
 
安装必要的工具
    1.下载module-init-tools-3.1.tar.bz2
  [url][/url]
[code:1:f40f9b3e79]        ./configure --prefix=/
        make moveold
        make all install
        ./generate-modprobe.conf /etc/modprobe.conf[/code:1:f40f9b3e79]
    2.下载新的mkinitrd
   [url][/url]
它需要lvm2 device-mapper
[url]ftp://195.220.108.108/linux/6/fedora/core/3/i386/os/Fedora/RPMS/device-mapper-1.00.19-2.i386.rpm[/url]
[url][/url]
如果不更新这个包在make install时会提示以下错误:
[code:1:f40f9b3e79]        No module mptbase found for kernel 2.6.10-bk4, aborting.
        mkinitrd failed
        make[1]: *** [install] Error 1
        make: *** [install] Error 2[/code:1:f40f9b3e79]
安装lvm2-2.00.25-1.01.i386.rpm时请用rpm -ivh --nodeps package name
四、make menuconfig
    [code:1:f40f9b3e79]01.Code maturity level options  --->
        [*] Prompt for development and/or incomplete code/drivers                 
        [*]   Select only drivers expected to compile cleanly                           
    02.General setup  --->
        [*] Support for paging of anonymous memory (swap)                     
        [*] System V IPC                                                                
        [*] POSIX Message Queues                                                        
        [ ] BSD Process Accounting                                                     
        [*] Sysctl support                                                                
        [ ] Auditing support                                                               
        [ ] Support for hot-pluggable devices                                              
        [*] Kernel Userspace Events                                                       
        [ ] Kernel .config support                                                        
        [*] Configure standard kernel features (for small systems)  --->  
      [*]   Load all symbols for debugging/kksymoops                                       
              [ ]     Do an extra kallsyms pass                                                    
              [*]   Enable futex support                                                           
              [*]   Enable eventpoll support                                                       
              [ ]   Optimize for size                                                              
              [*]   Use full shmem filesystem
    03.Loadable module support  --->        
        [*] Enable loadable module support                                        
        [*]   Module unloading                                                       
        [ ]     Forced module unloading                                             
        [ ]   Module versioning support (EXPERIMENTAL)                              
        [ ]   Source checksum for all modules                                       
        [*]   Automatic kernel module loading
    04.Processor type and features  ---> 
           Subarchitecture Type (PC-compatible)  --->  
           Processor family (Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon)  --->  
       [*] Generic x86 support                                   
       [ ] HPET Timer Support                                    
       [*] Symmetric multi-processing support      多CPU              
       (8)   Maximum number of CPUs (2-255)                      
       [*]   SMT (Hyperthreading) scheduler support              
       [*] Preemptible Kernel                     抢占式内核,请选上它   
       [ ] Machine Check Exception                               
       < > Toshiba Laptop support                                
       < > Dell laptop support                                   
       < > /dev/cpu/microcode - Intel IA32 CPU microcode support 
       < > /dev/cpu/*/msr - Model-specific register support      
       < > /dev/cpu/*/cpuid - CPU information support            
           Firmware Drivers  --->                                
           High Memory Support (4GB)  --->         高内存             
       [ ] Allocate 3rd-level pagetables from highmem            
       [ ] Math emulation                                        
       [*] MTRR (Memory Type Range Register) support             
       [*] Enable kernel irq balancing                           
       [ ] Use register arguments (EXPERIMENTAL)      
    05.Power management options (ACPI, APM)  --->    电源管理 自定 (偶没选)
    06.Bus options (PCI, PCMCIA, EISA, MCA, ISA)  ---> 板卡支持  自定
        [*] PCI support                                                                  
        PCI access mode (Any)  --->                                              
        [ ] Message Signaled Interrupts (MSI and MSI-X)                               
        [*] Legacy /proc/pci interface                                                   
        [*] PCI device name database                                                     
        [ ] ISA support                                                                  
        [ ] MCA support                                                                  
        < > NatSemi SCx200 support
    07.Executable file formats  --->
        [*] Kernel support for ELF binaries                                              
        Kernel support for a.out and ECOFF binaries                                 
        Kernel support for MISC binaries      
    08.Device Drivers  --->   设备驱动及网络支持
       Generic Driver Options  --->  默认
            [*] Select only drivers that don't need compile-time external firmware                   
            [*] Prevent firmware from being built                                    
        Memory Technology Devices (MTD)  --->  不选
      Parallel port support  --->    并行端口   自定(偶没选)      
        Plug and Play support  --->    支持热插拔 自定(偶没选)
      Block devices  --->
            <*> Normal floppy disk support                                    
            < > Compaq SMART2 support                                         
            < > Compaq Smart Array 5xxx support                               
            < > Mylex DAC960/DAC1100 PCI RAID Controller support              
            < > Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL) 
            Loopback device support                                       
            < >   Cryptoloop Support                                          
            Network block device support                                  
            < > Promise SATA SX8 support                                      
            RAM disk support                                              
            (16)  Default number of RAM disks                                 
            (4096) Default RAM disk size (kbytes)                             
            ()  Source directory of cpio_list                                 
            [ ] Support for Large Block Devices                               
            < > Packet writing on CD/DVD media                                
                 IO Schedulers  --->   IO调度器,都选上吧 可以在grub.conf指定用IO调度哪种方式,后面会讲的                     
                     <*> Anticipatory I/O scheduler                            
                     <*> Deadline I/O scheduler                                
                     <*> CFQ I/O scheduler          
      ATA/ATAPI/MFM/RLL support  --->   ATA设备 自定 (偶没选)
      SCSI device support  --->       SCSI设备 自定我有scsi的设备所以有以下选项
            <*> SCSI device support                                                               
            [*]   legacy /proc/scsi/ support                                                       
            ---   SCSI support type (disk, tape, CD-ROM)                                           
            <*>   SCSI disk support                              
      因为偶式MPT的SCSI,所以以下都没选,省略之
      Multi-device support (RAID and LVM)  --->  支持RAID和LVM(逻辑卷)  自定
            [*] Multiple devices driver support (RAID and LVM)      
            <*>   RAID support                                      
            < >     Linear (append) mode                            
            <*>     RAID-0 (striping) mode                          
            < >     RAID-1 (mirroring) mode                         
            < >     RAID-10 (mirrored striping) mode (EXPERIMENTAL) 
            <*>     RAID-4/RAID-5 mode                              
            < >     RAID-6 mode (EXPERIMENTAL)                      
            <*>     Multipath I/O support                           
            < >     Faulty test module for MD                       
            <*>   Device mapper support                             
            < >     Crypt target support                            
            < >     Snapshot target (EXPERIMENTAL)                  
            < >     Mirror target (EXPERIMENTAL)                    
            < >     Zero target (EXPERIMENTAL)                
      Fusion MPT device support  --->    偶的SCSI是这个,所以选了 还是自定              
<*> Fusion MPT (base + ScsiHost) drivers                                 
            (40)  Maximum number of scatter gather entries                             
            <*>   Fusion MPT misc device (ioctl) driver  
      IEEE 1394 (FireWire) support  --->  自定  (偶没选)
      I2O device support  --->     自定  (偶没选)
      Networking support  --->     网络选项
       [*] Networking support                                                                
                 Networking options  --->                                      
    <*> Packet socket                                                                      
                     [ ]   Packet socket: mmapped IO                                                        
                     < > Netlink device emulation                                                           
                     <*> Unix domain sockets        如果你有网络就选                                                        
                     < > PF_KEY sockets                                                                     
                     [*] TCP/IP networking                                                                  
                     [ ]   IP: multicasting                                                                 
                     [ ]   IP: advanced router                                                              
                     [ ]   IP: kernel level autoconfiguration                                               
                     < >   IP: tunneling                                                                    
                     < >   IP: GRE tunnels over IP                                                          
                     [ ] IP: ARP daemon support (EXPERIMENTAL)                                              
                     [*] IP: TCP syncookie support (disabled per default)     能防DOS攻击,但会降低一点性能,总的说性价比不错                              
                     < > IP: AH transformation                                                              
                     < > IP: ESP transformation                                                             
                     < > IP: IPComp transformation                                                          
                     < > IP: tunnel transformation                                                          
                     <*> IP: TCP socket monitoring interface                                                
                      IP: Virtual Server Configuration  --->                   lvs 支持                          
                     < > The IPv6 protocol (EXPERIMENTAL)                                                   
                     [*] Network packet filtering (replaces ipchains)  --->    包过滤省略(知道的自己选,不熟悉的都选上)            
  以下都没选,省略
    [ ] Amateur Radio support  --->                                                       
            < > IrDA (infrared) subsystem support  --->                                           
            < > Bluetooth subsystem support  --->                                                 
            [*] Network device support                                                            
            < >   Dummy net driver support                这个是nis服务器的吧,不大清楚,没用过                                        
            <*>   Bonding driver support                  双网卡绑定的                                        
            < >   EQL (serial line load balancing) support                                        
            < >   Universal TUN/TAP device driver support                    
                 ARCnet devices  --->                                                            
                 Ethernet (10 or 100Mbit)  --->                                                  
                 Ethernet (1000 Mbit)  --->                       
                     < > Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support                                  
                     < > D-Link DL2000-based Gigabit Ethernet support                                            
                     < > Intel(R) PRO/1000 Gigabit Ethernet support                                              
                     < > National Semiconduct DP83820 support                                                    
                     < > Packet Engines Hamachi GNIC-II support                                                  
                     < > Packet Engines Yellowfin Gigabit-NIC support (EXPERIMENTAL)                             
                     < > Realtek 8169 gigabit ethernet support                                                   
                     < > Marvell Yukon Chipset / SysKonnect SK-98xx Support                                      
                     <*> Broadcom Tigon3 support   
                以下都没选,省略  
        ISDN subsystem  --->                                         
        Telephony Support  --->
        Input device support  --->                                         
      Character devices  --->                                              
        I2C support  --->             
        Dallas's 1-wire bus  --->     
        Misc devices  --->            
        Multimedia devices  --->      
        Graphics support  --->        
        Sound  --->                   
        USB support  --->             
        MMC/SD Card support  --->    以上都没选,需要的自己选
    09.File systems  --->        文件系统     
        < > Second extended fs support                                                              
        <*> Ext3 journalling file system support                                                  
        [ ]   Ext3 extended attributes                                                            
        [*] JBD (ext3) debugging support                                                          
        < > Reiserfs support                                                                      
        < > JFS filesystem support                                                                
        < > XFS filesystem support                                                                
        < > Minix fs support                                                                      
        < > ROM file system support                                                               
        [ ] Quota support                                                                         
        < > Kernel automounter support                                                            
        <*> Kernel automounter version 4 support (also supports v3)                               
            CD-ROM/DVD Filesystems  --->                                             
                <*> ISO 9660 CDROM file system support                                             
                [ ]   Microsoft Joliet CDROM extensions                                          
                [ ]   Transparent decompression extension                                        
                < > UDF file system support 
            DOS/FAT/NT Filesystems  --->             floppy要用到的文件格式
                <*> MSDOS fs support                                                                                                                   
                <*> VFAT (Windows-95) fs support                                                  
                (437) Default codepage for FAT (NEW)                                              
                (iso8859-1) Default iocharset for FAT (NEW)                                       
                < > NTFS file system support                                                        
            Pseudo filesystems  --->
                [*] /proc file system support                             proc文件系统支持                             
                [ ]   /proc/kcore support                                                              
                [ ] /dev file system support (OBSOLETE)                                                
                [ ] /dev/pts Extended Attributes                                                       
                [*] Virtual memory file system support (former shm fs)     虚拟内存支持                            
                [ ]   tmpfs Extended Attributes                                                        
                [ ] HugeTLB file system support                                                             
            Miscellaneous filesystems  --->                                     
            Network File Systems  --->                                                        
                <*> NFS file system support                      nfs客户端支持                                                            
                [*]   Provide NFSv3 client support                                                                           
                [ ]   Provide NFSv4 client support (EXPERIMENTAL)                                                            
                [ ]   Allow direct I/O on NFS files (EXPERIMENTAL)                                                           
                < > NFS server support                           nfs服务端支持                                                           
                < > Secure RPC: Kerberos V mechanism (EXPERIMENTAL)                                                          
                < > Secure RPC: SPKM3 mechanism (EXPERIMENTAL)                                                               
                < > SMB file system support (to mount Windows shares etc.)       samba支持                                            
                < > CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)            
                < > NCP file system support (to mount NetWare volumes)                                                       
                < > Coda file system support (advanced network fs)                                                           
                < > Andrew File System support (AFS) (Experimental)                  
            Partition Types  --->      
            Native Language Support  --->                 自己选    
    10.Profiling support  --->                             没选                                             
    11.Kernel hacking  --->                                没选                                                                                            
    12.Security options  --->                              没选
    13.Cryptographic options  --->                         没选  
    14.Library routines  --->                                       
         < > CRC-CCITT functions                               
         <*> CRC32 functions                                   
         CRC32c (Castagnoli, et al) Cyclic Redundancy-Check[/code:1:f40f9b3e79]
五、编译安装
    步骤:make -jn(n代表同时编译的进程,可以加快编译速度,n由你的配置决定,我的配置用15-25)
         make modules_install
         make install
六、grub的设置
    设置之前先介绍一下2.6的I/O调度器
        2.6包含的四个I/O调度器分别是No-op I/O scheduler、Anticipatory I/O scheduler、Deadline I/O scheduler与CFQ I/O scheduler。
    在后文中分别简称为ns、as、ds与cfq。
        ns是一个简化的调度程序它只作最基本的合并与排序。与桌面系统的关系不是很大,主要用在一些特殊的软件
    与硬件环境下,这些软件与硬件一般都拥有自己的调度机制对内核支持的要求很小,这很适合一些嵌入式系统环境。作为桌面用户我们一般不会选择它。
        as是当前内核中默认的I/O调度器。它拥有非常好的性能,在2.5中它就相当引人注意。在与2.4内核进行的对比测试中,在2.4中多项以分钟为单位
    完成的任务,它则是以秒为单位来完成的。正因为如此它成为目前2.6测试版中默认的I/O调度器。但它也存在着弱点,它本身是比较庞大与复杂的,
    在一些特殊的情况下,特别是在数据吞吐量非常大的数据库系统中它会变的比较缓慢。
        ds就是针对as的缺点进行改善而来的,还处于测试阶段,但已经很稳定了。目前表现出的性能几乎与as一样好。加之比as更加小巧,
    是相当有前途的调度器,值得一试:)
        cfq为系统内的所有任务分配相同的带宽,提供一个公平的工作环境,它比较适合桌面环境。事实上在测试中它也有不错的表现,
    mplayer xmms等多媒体播放器与它配合的相当好,回放平滑几乎没有因访问磁盘而出现的跳帧现象。对于喜欢在Linux下听音乐看电影的朋友不妨尝试一下。
   
    好了,下面说说怎么设置:参数的格式为elevator=调度器名
    修改/boot/grub/grub.conf,在kernel那行后门加入elevator=deadline
   
    例如:kernel /boot/vmlinuz-2.6.10-bk4 ro root=/dev/你的根分区 elevator=deadline
七、reboot  
阅读(2724) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~