歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Gentoo環境下裁剪、安裝內核

Gentoo環境下裁剪、安裝內核

日期:2017/2/28 15:51:41   编辑:Linux教程

硬件平台:TOSHIBA M600-02S

軟件平台 :主機 Fedora 16 x86_64 虛擬機 VMware WorkStation 8.0.3

主機Lspci結果:

  1. 00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 02)
  2. 00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 02)
  3. 00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)
  4. 00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
  5. 00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)
  6. 00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 05)
  7. 00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 05)
  8. 00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 05)
  9. 00:1c.2 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 3 (rev 05)
  10. 00:1c.3 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 (rev 05)
  11. 00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 05)
  12. 00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)
  13. 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a5)
  14. 00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 05)
  15. 00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA AHCI Controller (rev 05)
  16. 00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 05)
  17. 00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 05)
  18. 01:00.0 VGA compatible controller: nVidia Corporation GT216 [GeForce GT 330M] (rev a2)
  19. 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
  20. 07:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)
  21. 16:00.0 System peripheral: JMicron Technology Corp. SD/MMC Host Controller (rev 20)
  22. 16:00.2 SD Host controller: JMicron Technology Corp. Standard SD Host Controller (rev 20)
  23. 16:00.3 System peripheral: JMicron Technology Corp. MS Host Controller (rev 20)
  24. 16:00.4 System peripheral: JMicron Technology Corp. xD Host Controller (rev 20)
  25. ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 02)
  26. ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 02)
  27. ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02)
  28. ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 02)
  29. ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 02)
  30. ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 02)
VMware下lspic結果:
  1. 00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
  2. 00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
  3. 00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
  4. 00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
  5. 00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
  6. 00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
  7. 00:0f.0 VGA compatible controller: VMware SVGA II Adapter
  8. 00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
  9. 00:11.0 PCI bridge: VMware PCI bridge (rev 02)
  10. 00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
  11. 00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
  12. 00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)
  13. 00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)
  14. 00:15.4 PCI bridge: VMware PCI Express Root Port (rev 01)
  15. 00:15.5 PCI bridge: VMware PCI Express Root Port (rev 01)
  16. 00:15.6 PCI bridge: VMware PCI Express Root Port (rev 01)
  17. 00:15.7 PCI bridge: VMware PCI Express Root Port (rev 01)
  18. 00:16.0 PCI bridge: VMware PCI Express Root Port (rev 01)
  19. 00:16.1 PCI bridge: VMware PCI Express Root Port (rev 01)
  20. 00:16.2 PCI bridge: VMware PCI Express Root Port (rev 01)
  21. 00:16.3 PCI bridge: VMware PCI Express Root Port (rev 01)
  22. 00:16.4 PCI bridge: VMware PCI Express Root Port (rev 01)
  23. 00:16.5 PCI bridge: VMware PCI Express Root Port (rev 01)
  24. 00:16.6 PCI bridge: VMware PCI Express Root Port (rev 01)
  25. 00:16.7 PCI bridge: VMware PCI Express Root Port (rev 01)
  26. 00:17.0 PCI bridge: VMware PCI Express Root Port (rev 01)
  27. 00:17.1 PCI bridge: VMware PCI Express Root Port (rev 01)
  28. 00:17.2 PCI bridge: VMware PCI Express Root Port (rev 01)
  29. 00:17.3 PCI bridge: VMware PCI Express Root Port (rev 01)
  30. 00:17.4 PCI bridge: VMware PCI Express Root Port (rev 01)
  31. 00:17.5 PCI bridge: VMware PCI Express Root Port (rev 01)
  32. 00:17.6 PCI bridge: VMware PCI Express Root Port (rev 01)
  33. 00:17.7 PCI bridge: VMware PCI Express Root Port (rev 01)
  34. 00:18.0 PCI bridge: VMware PCI Express Root Port (rev 01)
  35. 00:18.1 PCI bridge: VMware PCI Express Root Port (rev 01)
  36. 00:18.2 PCI bridge: VMware PCI Express Root Port (rev 01)
  37. 00:18.3 PCI bridge: VMware PCI Express Root Port (rev 01)
  38. 00:18.4 PCI bridge: VMware PCI Express Root Port (rev 01)
  39. 00:18.5 PCI bridge: VMware PCI Express Root Port (rev 01)
  40. 00:18.6 PCI bridge: VMware PCI Express Root Port (rev 01)
  41. 00:18.7 PCI bridge: VMware PCI Express Root Port (rev 01)
  42. 02:00.0 USB controller: VMware USB1.1 UHCI Controller
  43. 02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
  44. 02:02.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 02)
  45. 02:03.0 USB controller: VMware USB2 EHCI Controller

下面進入正題:

1、參照http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml一步步執行,執行到

  1. make menuconfig
2、內核功能:
  能夠完成系統的基本功能,上網,收發郵件等,支持xwindows圖形界面。
  在menuconfig中配置:
  詳細介紹內核配置選項及刪改情況

第一部分:Genral setup——> 除以下選項,其他全部刪除 其中: System V IPC (IPC:Inter Process Communication)是組系統調用及函數庫,它能讓程序彼此間同步進行交換信息。某些程序以及DOS模擬環境都需要它。為進程提供通信機制,這將使系統中各進程間有交換信息與保持同步的能力。有些程序只有在選Y的情況下才能運行,所以不用考慮,這裡一定要選。 Support for paging of anonymous memory (swap),如果不編譯進內核,系統啟動時會出現錯誤
  1. Active /dev/sda[0-9] swap
  2. swapon fails function not implemented
因此將其編入內核。

  第二部分 : [*] Enable loadable module support ——> 除以下選項,其它全部刪除 這個選項可以讓內核動態加載或卸載模塊,所以選上。
第三部分:-*- Enable the block layer ——> 全部刪除
塊設備
  
第四部分:Processor type and features ——> 它會對每種CPU做最佳化,讓它跑的好又快,一般來說,你是什麼型號的就選什麼型號的就好。我的處理器是i5 520M,所以選擇這個選項。
  
第五部分:Power management and ACPI options ——> 除以下選項,其它全部刪除
    ACPI Support ---〉高級電源接口配置支持,如果BIOS支持,建議選上這項
  []Button 這個選項用於注冊基於電源按鈕的事件,比如power, sleep等,當你按下按鈕時事件將發生,一個守護程序將讀取/proc/acpi/event,並執行用戶在這些事件上定義的動作比如讓系統關機。可以不選擇,根據自己的需求。
  
第六部分:Bus options (PCI etc.) ——> 除以下選項,其它全部刪除
  
  
第七部分:Executable file formats / Emulations ——> 除以下選項,其它全部刪除
  
Kernel support for ELF binaries ELF是開放平台下最常用的二進制文件,它支持不同的硬件平台。一定要選。
   第八部分:-*- Networking support ——> 除以下選項,其它全部刪除
Copyright © Linux教程網 All Rights Reserved