LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 4421|回复: 32

kernel-2.6.34-rc5 编译详细过程(2010/04/20)

[复制链接]
发表于 2010-4-20 12:26:03 | 显示全部楼层 |阅读模式
先装好ncurses-dev这个包,也就是编译kernel的基础
下载linux-2.6.34-rc5,解压,tar xjvf...,如果提示没有bzip2或者gzip,先装下

make defconfig -->省去大半工作,对你的机器作默认配置
make mrproper --->清除你编译过的东东,包括.config
make menuconfig --->在.config基础上自定义配置,如果没有.config,会到/boot下面自己找.config-XX

由于是新包,编译的是自己的内核,所以不要debian的默认内核

开始:
make defconfig  等一下,马上就会创建一个.config
make menuconfig 基于上面创建的内核开始配置
[]这个代表要么是内核,要么不要,不能成为模块,
<> 这个代表要么是内核,要么是模块,要么也可以不要
()要填一个字符串,
还有一些要多选一的,一切都可以用空格来切换得到,多看几下,肯定明白的
 楼主| 发表于 2010-4-20 12:38:29 | 显示全部楼层

第1单元,全局配置General setup ---&gt;

  • Prompt for development and/or incomplete code/drivers 不成熟的代码,不用选

    ()  Local version - append to kernel release

    -------自定义版本,也就是uname -r可以看到的版本,你可加,可不加,例如-n1

    [ ] Automatically append version information to the version string  不选

    Kernel compression mode (Gzip)  --->

    -------有四个选项,这个选项是说内核镜像要用的压缩模式,回车一下,

           可以看到gzip,bzip2,lzma,lxo,一般可以按默认的gzip,如果要用bzip2,lzma,lxo
           要先装上支持

  • Support for paging of anonymous memory (swap)

  • System V IPC

  • POSIX Message Queues

  • BSD Process Accounting

    [ ]   BSD Process Accounting version 3 file format

  • Export task/process statistics through netlink (EXPERIMENTAL)

    -------这个不选,体验选项,下面的一些选项会随之去掉

  •    Enable per-task delay accounting (EXPERIMENTAL)

  •    Enable extended accounting over taskstats (EXPERIMENTAL)

  •      Enable per-task storage I/O accounting (EXPERIMENTA)

  • Auditing support

    ------不选,安全之类的东西下面的一个选项会随之空掉

  •    Enable system-call auditing support

        RCU Subsystem  --->

    < > Kernel .config support

    (18) Kernel log buffer size (16 => 64KB, 17 => 128KB)

  • Control Group support  --->

    [ ] enable deprecated sysfs features to support old userspace tools

    -*- Kernel->user space relay support (formerly relayfs)

    -*- Namespaces support

  •    UTS namespace

  •    IPC namespace

  •    User namespace (EXPERIMENTAL)

  •    PID Namespaces (EXPERIMENTAL)

  •    Network namespace

  • Initial RAM filesystem and RAM disk (initramfs/initrd) support

    -------我们要直接从内核启动,不用initrd.img,不选

    ()    Initramfs source file(s)

  • Optimize for size

    [ ] Configure standard kernel features (for small systems)  --->

       Kernel Performance Events And Counters  --->

    [ ] Disable heap randomization

        Choose SLAB allocator (SLUB (Unqueued Allocator))  -->

  • Profiling support

    ------内核开发相关,不选

    < > OProfile system profiling

  • Kprobes

    --内核开发相关,不选,下面的那个选项会随之去掉

  •    Kprobes jump optimization support (EXPERIMENTAL)

        GCOV-based kernel profiling  --->
  • 回复 支持 反对

    使用道具 举报

     楼主| 发表于 2010-4-20 12:40:09 | 显示全部楼层

    第二单元,[*] Enable loadable module support ---&gt;

    默认,这个不用选什么,
    回复 支持 反对

    使用道具 举报

     楼主| 发表于 2010-4-20 12:41:24 | 显示全部楼层

    第三单元 -*- Enable the block layer ---&gt;

  •    Support for large (2TB+) block devices and files

  •    Block layer SG support v4

    ------不选,一般你也不用不到

    下面两个选项默认,
  • 回复 支持 反对

    使用道具 举报

     楼主| 发表于 2010-4-20 13:01:24 | 显示全部楼层

    第四单元, Processor type and features ---&gt; 处理器选项,关键

  • Tickless System (Dynamic Ticks)

  • High Resolution Timer Support

  • Symmetric multi-processing support

    ----多核cpu,选上

  • Support sparse irq numbering
    -----多个cpu,不选,一般你也只有一个

  • Enable MPS table

    [ ] Support for big SMP systems with more than 8 CPUs

  • Support for extended (non-PC) x86 platforms
    ------不选,我们一般是x86
    [ ] AMD Elan
    [ ] Moorestown MID platform
    [ ] RDC R-321x SoC

    [ ] Support non-standard 32-bit SMP architectures

  • Single-depth WCHAN output

    [ ] Paravirtualized guest support  --->

  • Disable Bootmem code

    [ ] Memtest
        Processor family (Pentium-Pro)  --->

    ------进去里面按上下键,选择一个你机子相关的cpu,要是不知道,选686,一般会
           有的,

  • Generic x86 support
    --如果上面有你的cpu选项,这个去掉
    [ ] PentiumPro memory ordering errata workaround

  • HPET Timer Support

    (8) Maximum number of CPUs
    --这个你自己看着,,一般也不用改

  • SMT (Hyperthreading) scheduler support

  • Multi-core scheduler support
       Preemption Model (Voluntary Kernel Preemption (Desktop))  --->
    ----不用考虑,回车,选第三个low...

  • Reroute for broken boot IRQs

  • Machine Check / overheating reporting

  •    Intel MCE features

  •    AMD MCE features

    -----intel的,amd的勾掉,反之

    [ ]   Support for old Pentium 5 / WinChip machine checks
    < > Machine check injector support
    < > Toshiba Laptop support
    < > Dell laptop support
    ----东芝,戴尔,自己年一下,一般用户不用选


  • Enable X86 board specific fixups for reboot
    --- 不用选,这类的主板肯定没有了,


    <*> /dev/cpu/microcode - microcode support

  •    Intel microcode patch loading support

  •    AMD microcode patch loading support

    ------intel,amd,反之
    <*> /dev/cpu/*/msr - Model-specific register support

    <*> /dev/cpu/*/cpuid - CPU information support

        High Memory Support (4GB)  --->
    ------小于4gb的默认,大于4gb的内存选64


        Memory model (Flat Memory)  --->

    [ ] Enable KSM for page merging

    (4096) Low address space to protect from user allocation

    [ ] Enable recovery from hardware memory errors

  • Allocate 3rd-level pagetables from highmem

    [*] Check for low memory corruption

  •    Set the default setting of memory_corruption_check

  • Reserve low 64K of RAM on AMI/Phoenix BIOSen

    --ami/ph的bios选上,反之


    [ ] Math emulation

    -*- MTRR (Memory Type Range Register) support

    [ ]   MTRR cleanup support

  • EFI runtime service support

    -----intel主板的可以选上,这里的intel主板是指intel牌的主板,不是芯片组

  • Enable seccomp to safely compute untrusted bytecode

    [ ] Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)

        Timer frequency (1000 HZ)  --->

    --------默认


  • kexec system call
    ---运行时替换内核,不选,如果你要,选上

  • kernel crash dumps
    ---内核崩溃时,给你一团信息,要的话选上,一般不用,一般选择得当,不会
    崩溃的
    [ ] kexec jump (EXPERIMENTAL)

    (0x1000000) Physical address where the kernel is loaded

  • Build a relocatable kernel

    (0x1000000) Alignment value to which kernel should be aligned

    -*- Support for hot-pluggable CPU

    [ ] Compat VDSO support

    [ ] Built-in kernel command line
  • 回复 支持 反对

    使用道具 举报

     楼主| 发表于 2010-4-20 13:43:51 | 显示全部楼层

    第五单元-- Power management and ACPI options ---&gt; 电源管理

  • Power Management support
  •    Power Management Debug Support

    ----这个你现在可以勾掉,不勾也没事,稍侯会在kernel-hacking这一节勾掉调试,这里也就没了

    [ ]     Extra PM attributes in sysfs for low-level debugging/testing

    [ ]     Verbose Power Management debugging
  • Suspend/resume event tracing
  • Suspend to RAM and standby
      休眠, 睡到内存,一般两个都选上,你自己决定


    [ ]   Test suspend/resume and wakealarm during bootup
  • Hibernation (aka 'suspend to disk')

    ()    Default resume partition

    [ ] Run-time PM core functionality
  • ACPI (Advanced Configuration and Power Interface) Support  --->

    --见附1
    [ ] SFI (Simple Firmware Interface) Support  --->

    < > APM (Advanced Power Management) BIOS support  --->

    选acpi就不用apm,一般你也只用acpi&

        CPU Frequency scaling  --->

    --见附2


    -*- CPU idle PM support



    附1:
  • ACPI (Advanced Configuration and Power Interface) Support  --->
    --- ACPI (Advanced Configuration and Power Interface) Support
  •    Deprecated /proc/acpi files

    [*]   Deprecated power /proc/acpi directorie
    < >   ACPI 4.0 power meter
  •    Future power /sys interfac
  •    Deprecated /proc/acpi/event support

    <*>   AC Adapter

    --一般是笔记本,交流电,电池切换,如果你是,默认,不是,勾掉

    <*>   Battery

    ---电池,有,选上,没有,不要

    -*-   Button
    -*-   Video
    <*>   Fan
  •    Dock
    <*>   Processor
    < >     Processor Aggregator
      <*>     Thermal Zone
    (0)   Disable ACPI for systems before Jan 1st this year
    [ ]   Debug Statements
    < >   PCI slot detection drive
    -*-   Container and Module Devices (EXPERIMENTAL)
    < >   Smart Battery System


    附2:   CPU Frequency scaling  --->
    默认就行,
  • 回复 支持 反对

    使用道具 举报

     楼主| 发表于 2010-4-20 13:49:06 | 显示全部楼层

    第六单元,Bus options (PCI etc.) ---&gt; pci pci-e之类的总线

    只要看一下,倒数两个选项

    <*> PCCard (PCMCIA/CardBus) support  --->

    --这个一般笔记本的东西,比较现代的笔记本也一般没有了,一般不选


    <*> Support for PCI Hotplug  --->

    --热插pci的东西,删掉就是

    这里的选择虽然只有几个选项,但是会影响到相关总线的驱动选项,
    比如你没有选pcmcia,那驱动选项是不会出现相关的驱动
    回复 支持 反对

    使用道具 举报

     楼主| 发表于 2010-4-20 13:50:07 | 显示全部楼层

    第七 Executable file formats / Emulations ---&gt; 默认

    默认,不用修改
    回复 支持 反对

    使用道具 举报

     楼主| 发表于 2010-4-20 13:54:12 | 显示全部楼层

    第八单元, --- Networking support 网络的东西

    这里的网络是指全局意义上的网络,不是设备的驱动。但是驱动却要依赖这里

          Networking options  --->


    --不用修改,

  •    Amateur Radio support  --->

    --这个东西不用选,
    < >   CAN bus subsystem support  --->
    < >   IrDA (infrared) subsystem support  --->
    --红外线
    < >   Bluetooth subsystem support  --->
    --蓝牙,你自己看着办
    < >   RxRPC session sockets
    -*-   Wireless  --->
    --如果你有无线网卡,默认就行,反之,进去里面,取消第一个选项

    < >   WiMAX Wireless Broadband support  --->

    <*>   RF switch subsystem support  --->
    --不要

    < >   Plan 9 Resource Sharing Support (9P2000) (Experimental)  --->
  • 回复 支持 反对

    使用道具 举报

     楼主| 发表于 2010-4-20 14:10:27 | 显示全部楼层

    第九单元,设备驱动。。一堆堆。。。 Device Drivers ---&gt;

    Generic Driver Options  --->
    --全局选项,默认

    <*> Connector - unified userspace <-> kernelspace linker  --->

    < > Memory Technology Device (MTD) support  --->

    < > Parallel port support  --->

    -*- Plug and Play support  --->
  • Block devices  --->

    --块设备,要的,你也可以进去看下,一般,默认
  • Misc devices  --->

    --非主流设备,不用选

    < > ATA/ATAPI/MFM/RLL support (DEPRECATED)  --->

    --老的磁盘驱动,一般不需要。

    SCSI device support  --->
    scs相关,你可以进去看下


    <*> Serial ATA and Parallel ATA drivers  --->

    --现代磁盘驱动,很重要,关系到你启动的问题,选择不当,直接崩溃

    进去仔细看下,intel的选intel,amd的选amd,via选。。。总之你一般不要选错
  • Multiple devices driver support (RAID and LVM)  --->

    --lvm..如果你要,选上,一般你不用


    [ ] Fusion MPT device support  --->

        IEEE 1394 (FireWire) support  --->

    --1394,进去看下,没有不用进去

    < > I2O device support  --->
  • Macintosh device drivers  --->

    --水果设备,一般没有,去掉
  • Network device support  --->

    --网卡相关,见附1

    [ ] ISDN support  --->

    --isdn,2000年的主流,现在的不入流,去掉

    < > Telephony support  --->

        Input device support  --->

    --输入设备,一堆堆,进去看下,如果你是台式机,默认,如果你是触摸板,
    进去仔细看下,

       Character devices  --->
    --主板接口设备,进去看下,如果你是inte,adm,via相关的,进去选上,勾掉


    -*- I2C support  --->

    [ ] SPI support  --->

       PPS support  --->

    [ ] GPIO Support  --->

    < > Dallas's 1-wire support  --->

    -*- Power supply class support  --->

    -*- Hardware Monitoring support  --->

    -*- Generic Thermal sysfs driver  --->
  • Watchdog Timer Support  --->

       Sonics Silicon Backplane  --->

         Multifunction device drivers  --->

    [ ] Voltage and Current Regulator Support  --->

    < > Multimedia support  --->

        Graphics support  --->

    显卡选项,见附2

    <*> Sound card support  --->

    --声卡选项,见附三
  • HID Devices  --->

    --看看
  • USB support  --->

    < > Ultra Wideband devices (EXPERIMENTAL)  --->

    < > MMC/SD/SDIO card support  --->

    --读卡器,你看看

    < > Sony MemoryStick card support (EXPERIMENTAL)  --->

    -*- LED Support  --->


    [ ] Accessibility support  --->

    < > InfiniBand support  --->
  • EDAC (Error Detection And Correction) reporting  ---

    <*> Real Time Clock  --->
  • DMA Engine support  --->

    [ ] Auxiliary Display support  --->

    < > Userspace I/O drivers  --->

        TI VLYNQ  --->

    [ ] Staging drivers  --->

    --将要进入正式版的设备驱动,例如你的nvidia驱动

  • X86 Platform Specific Device Drivers  --->

    --关于笔记本的一些,你进去看下
  • 回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    快速回复 返回顶部 返回列表