歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Gentoo內核編譯選項說明

Gentoo內核編譯選項說明

日期:2017/2/28 15:58:55   编辑:Linux教程

一、編譯
現在的內核編譯步驟真是簡單極了
# make menuconfig
# make
# make modules_install
# make install
就這麼兩下,把以前繁雜的操作都包括了
# make modules
# make modules_install
# make install
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.14.3
# cp System.map /boot/System.map-2.6.14.3
# mkinitrd ……
# ln -s /boot/vmlinuz-2.6.14.3 /boot/vmlinuz
# ln -s /boot/System.map-2.6.14.3 /boot/System.map
#vim /boot/grub/menu.lst
上面這些都不用做了,真省事啊

主要就是make menuconfig這步了,這步說難也難,說不難也不難,總之呢就是按需配置
呵呵,按需配置,這下可沒人能幫你了,得自己看著辦了

二、可能出現的問題:

1、如果出現這樣的錯誤進不去:Enforcing mode requested but no policy loaded
那是因為你原來系統啟用了selinux的enforcing模式,你需要回到原來的系統關閉selinux就可以了,如果不需要selinux,那干脆編內核的時候就去掉。

2、啟動錯誤提示:VFS:Unable to mount root fs on unknown-block(0,0)
請確保以下兩項被編進內核
Device Drivers ---> Block devices --->
<*> RAM disk support
[*] Initial RAM disk (initrd) support
3、啟動錯誤提示:
mkrootdev:lable /1 not found
mount:error 2 mounting ext3
mount:error 2 mounting none
switchroot:mount failed:22
Umount /initrd/dev failed:2
需要以下驅動支持:
Device Drivers ---> ATA/ATAPI/MFM/RLL support ---> [*] PCI IDE chipset support

……有問題的話再加

三、關於一些編譯選項

1、如果是自己用的桌面系統,別忘了打開內核搶占
Processor type and features ---> Preemption Model (Preemptible Kernel (Low-Latency Desktop)) --->
說明:搶占模式:
No Forced Preemption (Server),這種模式等同於沒有使能搶占選項的標准內核,主要適用於科學計算等服務器環境。

Voluntary Kernel Preemption (Desktop),這種模式使能了自願搶占,但仍然失效搶占內核選項,它通過增加搶占點縮減了搶占延遲,因此適用於一些需要較好的響應性的環境,如桌面環境,當然這種好的響應性是以犧牲一些吞吐率為代價的。

Preemptible Kernel (Low-Latency Desktop),這種模式既包含了自願搶占,又使能了可搶占內核選項,因此有很好的響應延遲,實際上在一定程度上已經達到了軟實時性。它主要適用於桌面和一些嵌入式系統,但是吞吐率比模式2更低。

Complete Preemption (Real-Time),這種模式使能了所有實時功能,因此完全能夠滿足軟實時需求,它適用於延遲要求為100微秒或稍低的實時系統。

實現實時是以犧牲系統的吞吐率為代價的,因此實時性越好,系統吞吐率就越低。
2、支持4G內存,我的沒有這麼多,你的呢
Processor type and features ---> High Memory Support (off)

四、下面是部分選項說明,可以參考下 < > ACPI0004,PNP0A05 and PNP0A06 Container Driver (EXPERIMENTAL)

APM (Advanced Power Management) BIOS Support --->
高級電源管理的支持,一般來說筆記本應該選上,台式機可以不選。

CPU Frequency scaling --->
這一選項允許改變CPU的主頻,使CPU在低負荷或使用電池時降低主頻,達到省電的目的。

Bus options (PCI, PCMCIA, EISA, MCA, ISA) --->

--- PCI support
PCI總線支持

PCI access mode (Any) --->
強列建議選Any,系統將優先使用MMConfig,然後使用BIOS,最後使用Direct檢測PCI設備。

[ ] PCI Express support
PCI-E總線支持

[*] Legacy /proc/pci interface

[ ] PCI Debugging

[ ] ISA support
ISA總線,沒有用就不要

[ ] MCA support

< > NatSemi SCx200 support

PCCARD (PCMCIA/CardBus) support --->
一般只有筆記本電腦上才會有PCMCIA插槽,如果你是台式機的話,可以不選這一項,然後跳過這一部份。

PCI Hotplug Support --->
一般來講只有服務器上會有熱插拔的設備,如果你使用的是台式機,你可以不選擇此項並跳過這一部份。

Executable file formats --->
可執行文件格式

[*] Kernel support for ELF binaries
ELF是開放平台下最常用的二進制文件,它支持不同的硬件平台

< > Kernel support for a.out and ECOFF binaries

<*> Kernel support for MISC binaries
此選項允許插入二進制的封裝層到內核中,當使用Java、.NET、Python、Lisp等語言編寫的程序時非常有用

Networking --->
[*] Networking support

Networking options --->
需要什麼協議、功能的自己選吧

[ ] Amateur Radio support --->
業余電台

< > IrDA (infrared) subsystem support --->
紅外接口

< > Bluetooth subsystem support --->
藍牙

< > Generic IEEE 802.11 Networking Stack

Device Drivers --->
驅動

Generic Driver Options --->
Connector - unified userspace <-> kernelspace linker --->
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
[ ] SCSI tape drive support for Smart Array 5xxx
< > 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
< > Low Performance USB Block driver
<*> RAM disk support
(16) Default number of RAM disks
(16384) Default RAM disk size (kbytes)
[*] Initial RAM disk (initrd) support
[*] Support for Large Block Devices
< > Packet writing on CD/DVD media
IO Schedulers --->
< > Anticipatory I/O scheduler
< > Deadline I/O scheduler
< > CFQ I/O scheduler
< > ATA over Ethernet support

ATA/ATAPI/MFM/RLL support --->
<*> ATA/ATAPI/MFM/RLL support
<*> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
--- Please see Documentation/ide.txt for help/info on IDE drives
[ ] Support for SATA (deprecated; conflicts with libata SATA driver)
[ ] Use old disk-only driver on primary interface
<M> Include IDE/ATA-2 DISK support
[*] Use multi-mode by default
<M> Include IDE/ATAPI CDROM support
< > Include IDE/ATAPI TAPE support (EXPERIMENTAL)
< > Include IDE/ATAPI FLOPPY support
<M> SCSI emulation support
[ ] IDE Taskfile Access
--- IDE chipset support/bugfixes
<*> generic/default IDE chipset support    //使用IDE設備的這項要打*
[ ] CMD640 chipset bugfix/support
[ ] PNP EIDE support
[*] PCI IDE chipset support
[*] Sharing PCI IDE interrupts support
[ ] Boot off-board chipsets first support
<M> Generic PCI IDE Chipset Support
< > OPTi 82C621 chipset enhanced support (EXPERIMENTAL)
< > RZ1000 chipset bugfix/support
[*] Generic PCI bus-master DMA support
[ ] Force enable legacy 2.0.X HOSTS to use DMA
[*] Use PCI DMA by default when available
[ ] Enable DMA only for disks
< > AEC62XX chipset support
< > ALI M15x3 chipset support
< > AMD and nVidia IDE support
< > ATI IXP chipset IDE support
< > CMD64{3|6|8|9} chipset support
< > Compaq Triflex IDE support
< > CY82C693 chipset support
< > Cyrix CS5510/20 MediaGX chipset support (VERY EXPERIMENTAL)
< > Cyrix/National Semiconductor CS5530 MediaGX chipset support
< > HPT34X chipset support
< > HPT36X/37X chipset support
< > National SCx200 chipset support
< > Intel PIIXn chipsets support
< > IT821X IDE support
< > NS87415 chipset support
< > PROMISE PDC202{46|62|65|67} support
< > PROMISE PDC202{68|69|70|71|75|76|77} support
< > ServerWorks OSB4/CSB5/CSB6 chipsets support
< > Silicon Image chipset support
< > SiS5513 chipset support
< > SLC90E66 chipset support
< > Tekram TRM290 chipset support
< > VIA82CXXX chipset support
[ ] IGNORE word93 Validation BITS

SCSI device support --->
Multi-device support (RAID and LVM) --->
Fusion MPT device support --->
IEEE 1394 (FireWire) support --->
I2O device support --->
Network device support --->
ISDN subsystem --->
Telephony Support --->
Input device support --->
Character devices --->
I2C support --->
Dallas's 1-wire bus --->
Hardware Monitoring support --->
Misc devices --->
Multimedia Capabilities Port drivers --->
Multimedia devices --->
Graphics support --->
Sound --->
USB support --->
MMC/SD Card support --->
InfiniBand support --->
SN Devices --->

File systems --->

Profiling support --->

Kernel hacking --->

Security options --->

Cryptographic options --->

Library routines --->

Code maturity level options (代碼成熟度選項)

[*] Prompt for development and/or incomplete code/drivers
默認情況下是選擇的,這將會在設置界面中顯示還在開發或者還沒有完成的代碼與驅動.你應該選擇它,因為有許多設備可能必需選擇這個選項才能進行配置,實際上它是安全的。

[*] Select only drivers expected to compile cleanly
選擇這個選項你將不會看到一些已知的存在問題的驅動程序選項,默認的情況下也是選擇的。如果你有設備沒有找到驅動選項,你可以將這一項去掉,或許就可以找到相關驅動了,不過它可能是有BUG的。

General setup (常規設置)

[*] Support for paging of anonymous memory
這個選項將使你的內核支持虛擬內存,也就是讓你的計算機好象擁有比實際內存更多 多的內存空間用來執行很大的程序。默認是選擇的。

[*] System V IPC
為進程提供通信機制,這將使系統中各進程間有交換信息與保持同步的能力。如果不選這項,很多程序運行不起來。

[*] POSIX Message Queues
這是POSIX的消息隊列,它同樣是一種IPC。建議你最好將它選上

[ ] BSD Process Accounting
這裡選擇Y將會讓內核為用戶層的進程建立一個帳目(進程通過一個特殊的系統調用來通知內核),當程序退出時內核會將進程的相關信息記錄到帳目文件中,主要包括進程的創建時間、 創建者,內存占用等信息。如果你需要就Y吧:)

[*] Sysctl support
這個選項能不重新編譯內核修改內核的某些參數和變量,如果你也選擇了支持/proc,將能從/proc/sys存取可以影響內核的參數或變量。建議你最好將它選上。打開這個選項將會增加內核的體積至少8KB,如果你的內核僅用制作安裝與恢復系統系統盤那麼可以不選,以減少對內存的占用。

[*] Auditing support
審記支持,用於和內核的某些子模塊同時工作,例如SELinux。只有選擇此項及它的子項,才能調用有關審記的系統調用
[*] Enable system-call auditing support

--- Support for hot-pluggable devices
支持熱插拔的,最好選擇

[*] Kernel Userspace Events
內核中分為系統區和用戶區,這裡系統區和用戶區進行通訊的一種方式,選上。

[ ] Kernel .config support
這將會把內核的配置信息與相關的文檔說明編譯進內核中,以後可以使用一些工具來提取它用來重新構建內核,一般不用選它。

() Initramfs source file(s)

[ ] Configure standard kernel features (for small systems) --->
這是為了編譯某些特殊的內核使用的,通常你可以不選擇這一選項,你也不用對它下面的子項操心了。

Copyright © Linux教程網 All Rights Reserved