久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

VMware中打造最小Linux系統(tǒng)(一)——構(gòu)建內(nèi)核&文件系統(tǒng)

 quasiceo 2012-12-05

VMware中打造最小Linux系統(tǒng)(一)——構(gòu)建內(nèi)核&文件系統(tǒng)

779人閱讀 評(píng)論(0) 收藏 舉報(bào)

 

. 最小系統(tǒng)要求

1. 接受鍵盤輸入,能顯示字符信息

2. 能處理普通linux發(fā)行版中的大部分基本命令,如:ls, mv...

3. 具有網(wǎng)絡(luò)功能

4. 不使用ramdisk, 所需驅(qū)動(dòng)全部編譯進(jìn)內(nèi)核

 

. 主機(jī)環(huán)境

1. VMware 7.0 / windows 7

2. 主機(jī)系統(tǒng)Ubuntu 10.04 x86 (kernel version 2.6.32)

3. 最小系統(tǒng)內(nèi)核版本 linux-2.6.38

 

. 詳細(xì)構(gòu)建過(guò)程

1. 下載linux-2.6.38內(nèi)核

  1. #cd /usr/src  
  2. #wget http:///pub/linux/kernel/v2.6/linux-2.6.38.tar.gz  
  3. #tar xvf linux-2.6.38.tar.gz  
  4. #cd linux-2.6.38   
  

 

2.編譯內(nèi)核

這一步主要就是內(nèi)核的配置,,如果配置錯(cuò)了可能導(dǎo)致系統(tǒng)無(wú)法啟動(dòng),,因此需要非常仔細(xì)。

  1. #make mrproper               
  2. #make allnoconfig  
  3. #make menuconfig   
  

首先利用lspci查看硬件信息:

  1. #lspci    

00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)

00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)

00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)

00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)

00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)

00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)

00:0f.0 VGA compatible controller: VMware SVGA II Adapter

00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)

00:11.0 PCI bridge: VMware PCI bridge (rev 02)

00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)

................... ......................... .......................

00:18.6 PCI bridge: VMware PCI Express Root Port (rev 01)

00:18.7 PCI bridge: VMware PCI Express Root Port (rev 01)

02:00.0 USB Controller: Intel Corporation 82371AB/EB/MB PIIX4 USB

02:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)

02:02.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 02)

02:03.0 USB Controller: VMware USB2 EHCI Controller

 

根據(jù)查到的硬件型號(hào)配置.config文件

 

以下詳細(xì)介紹內(nèi)核的配置(除以下選項(xiàng)外其它都可以不選)

General setup --->

[*] System V IPC

[*] Enable loadable module support --->

Processor type and features --->

Processor family (Pentium Pro) --->

[*] Generuc x86 support

Bus options (PCI etc.) --->

[*] PCI support

PCI access mode (Any) --->

Executable file formats / Emulations --->

[*] Kernel support for ELF binaries

[*] Write ELF core dumps with partial segments

[*] Networking support  --->

Networking options --->

<*> Packet socket

<*> Unix domain sockets (NEW)

[*] TCP/IP networking

<*>   IP: IPsec transport mode (NEW)

<*>   IP: IPsec tunnel mode (NEW)

<*>   IP: IPsec BEET mode (NEW)

<*>   Large Receive Offload (ipv4/tcp) (NEW)

<*>   INET: socket monitoring interface (NEW)

Device Drivers  --->

[*] Block devices --->

<*> Loopback device support

SCSI device support --->

<*> SCSI device support

[*] legacy /proc/scsi/ support (NEW)

<*> SCSI disk support

[*] SCSI low-level drivers (NEW) --->

<*> BusLogic SCSI support

[*] Fusion MPT device support --->

<*> Fusion MPT ScsiHost drivers for SPI

<*> Fusion MPT ScsiHost drivers for FC

<*> Fusion MPT ScsiHost drivers for SAS

<*> Fusion MPT misc device (ioctl) driver

[*] Network device support --->

[*] Ethernet (10 or 100Mbit) --->

[*] EISA, VLB, PCI and on board controllers

<*> AMD PCnet32 PCI support

Graphics support  --->

<*> Support for frame buffer devices --->

File systems  --->

<*> Second extended fs support

[*]   Ext2 extended attributes

[*]     Ext2 POSIX Access Control Lists 

[*]     Ext2 Security Labels

[*] Ext2 execute in place support

<*> Ext3 journalling file system support

[*]   Default to 'data=ordered' in ext3 (NEW)

[*]   Ext3 extended attributes (NEW) 

[*]     Ext3 POSIX Access Control Lists  

[*]     Ext3 Security Labels  

CD-ROM/DVD Filesystems --->

<*> ISO 9660 CDROM file system support

<*> Native language support --->

<*> Codepage 437 (United States, Canada)

<*> Simplified Chinese charset (CP936, GB2312)

 

配置完成后就可以開(kāi)始編譯了:

  1. #make bzImage    

注意:在make menuconfig的時(shí)候一定要選對(duì)磁盤驅(qū)動(dòng),,否則會(huì)出現(xiàn)

kernel panic -- VFS error: unable to mount …

這里我用的是SCSI的磁盤,,IDE的要做相應(yīng)修改。

 

 

3. 制作根文件系統(tǒng)

為簡(jiǎn)單起見(jiàn),,我們利用busybox制用根文件系統(tǒng),。

  1. #wget http:///downloads/busybox-1.18.4.tar.bz2  
  2. #tar xvf busybox-1.18.4.tar.bz2  
  3. #cd busybox-1.18.4  
  4. #make menuconfig  
   

下面是需要編譯進(jìn)busybox的功能選項(xiàng)。

  General Configuration應(yīng)該選的選項(xiàng)

   Don't use /usr

      這個(gè)選項(xiàng)一定要選,否則make install busybox將安裝在原系統(tǒng)的/usr下,,這將覆蓋掉系統(tǒng)原有的命令,。

  Build Options

   Build BusyBox as a static binary (no shared libs)

  這個(gè)選項(xiàng)也是一定要選擇的,這樣才能把busybox編譯成靜態(tài)鏈接的可執(zhí)行文件,,運(yùn)行時(shí)才獨(dú)立于其他函數(shù)庫(kù).否則必需要其他庫(kù)文件才能運(yùn)行,,在單一個(gè)linux內(nèi)核不能使它正常工作。

其它選項(xiàng)都是一些linux基本命令選項(xiàng),,自己需要哪些命令就編譯進(jìn)去,,一般用默認(rèn)的就可以了,配置好后退出并保存,。

編譯并安裝busybox

  1. #make  
  2. #make install   
  

make install后會(huì)在busybox目錄下生成一個(gè)叫_install的目錄,,里面有busybox和指向它的鏈接。

接下來(lái)給虛擬機(jī)添加一塊SCSI磁盤并分區(qū),,假設(shè)根分區(qū)為sdb1

  1. #mount /dev/sdb1 /mnt       將根分區(qū)掛載到/mnt    
  2. #cp _install/* /mnt/            將_install下的文件全復(fù)制到sdb1    
  3. #rm -f linuxrc    
  4. #cp -r ./examples/bootfloppy/etc /mnt       將etc下的配置文件拷到sdb1下    
  5. #cd /mnt/    
  6. #mkdir proc mnt usr var tmp dev sys         創(chuàng)建目錄    
  7. #cp -a /dev/{console,tty,tty2} dev/  
  

 

 

4. 更新grub

這步既可以在ubuntugrub中引導(dǎo)也可以在sdb上裝上grub,,從sdb1進(jìn)行引導(dǎo)。

為簡(jiǎn)單起見(jiàn)我們就用ubuntu中的grub來(lái)引導(dǎo),。

修改/boot/grub/grub.cfg

  1. #gedit /boot/grub/grub.cfg  
  

新添加

menuentry "My Linux-2.6.38" {

insmod ext2

set root='(hd1,1)'

linux /bzImage ro root=/dev/sdb1

}

 

 

5. 最后重啟一下(啟動(dòng)時(shí)按住shift,,否則不進(jìn)入grub2引導(dǎo)菜單)

  1. #reboot    

選擇My Linux-2.6.38

如果一切順利,就會(huì)出現(xiàn)下圖的信息,, ----- 啟動(dòng)成功,。

 

 

 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn),。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,,謹(jǐn)防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào),。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多