歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux入門之定制Linux系統---Kernel+Busybox

Linux入門之定制Linux系統---Kernel+Busybox

日期:2017/2/28 14:34:08   编辑:Linux教程

定制Linux系統

簡單回顧下系統啟動的相關內容

編譯過程:編譯內核、busybox

為系統上的新硬盤建立分區,這裡根據需要先建立一個大小為200M的主分區作為新建系統的boot分區和一個512M的分區作為目標系統(即正在構建的新系統,後面將沿用此名稱)的根分區;200M的分區格式化後將其掛載至/mnt/boot目錄下;512M的分區格式化後將掛載至/mnt/sysroot目錄;兩個分區的文件系統均為ext4。

此處還可以添加第三個分區用於swap,大小為256MB或其它你喜歡的空間額度。記得使用mkswap將其創建為swap分區。

一、編譯Linux內核

1.獲取內核源碼,解壓至/usr/src

# tar xflinux-3.13.6.tar.xz -C /usr/src/

2.創建軟鏈接

[root@station75 src]#ln -sv linux-3.13.6/ linux

3.生成配置文件

[root@station75linux]# make allnoconfig

4.配置

[root@station75linux]# make menuconfig

主要的配置選項

64位系統支持

[*] 64-bit kernel

設置版本信息

General setup --->() Local version - append to kernel release

選擇cpu類型

Processor type and features --->Processor family (Generic-x86-64) --->(X) Core 2/newer Xeon

支持多核心

Processor type and features --->[*] Symmetric multi-processing support

支持動態模塊加載

[*] Enable loadable module support --->

PCI總線支持(cpu需要總線與其他模塊溝通)

Bus options (PCI etc.) --->[*] PCI support

scsi硬盤驅動

(lspci查看硬盤類型)

Device Drivers ---> SCSI device support ---> <*> SCSI device supportà<*> SCSI disk support

另:Device Drivers ---> [*] Fusion MPT device support ---> <*> Fusion MPT ScsiHost drivers for SPI

<*> Fusion MPT misc device (ioctl) driver

文件系統

File systems ---> <*> The Extended 4 (ext4) filesystem

支持ELF(可執行文件)

Executable file formats / Emulations à [*] Kernel support for ELF binaries

<*> Kernel support for scripts starting with #!

I/O驅動

Device Drivers ---> Input device support ---> [*] Keyboards --->

[*] Mice --->

支持USB驅動Device Drivers ---> [*] USB support ---> <*> Support for Host-side USB à <*> EHCI HCD (USB 2.0) support

<*> UHCI HCD (most Intel and VIA) support

<*> OHCI HCD (USB 1.1) support

實時時鐘

Device Drivers ---> [*] Real Time Clock --->

devtmfs

Device Drivers ---> Generic Driver Options --> [*] Maintain a devtmpfs filesystem to mount at /dev

網卡

協議[*] Networking support ---> Networking options ---> [*] TCP/IP networking

<*> Unix domain sockets

驅動Device Drivers ---> [*] Network device support ---> [*] Ethernet driver support (NEW) ---> <*> Intel(R) PRO/1000 Gigabit Ethernet support/ <*> Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support

Copyright © Linux教程網 All Rights Reserved