Welcome 微信登录

首页 / 操作系统 / Linux / VMware中打造自己的最小Linux系统

一. 最小系统要求1. 接受键盘输入,能显示字符信息2. 能处理普通linux发行版中的大部分基本命令,如:ls, mv...3. 具有网络功能4. 不使用ramdisk, 所需驱动全部编译进内核
二. 主机环境1. VMware 7.0 / windows 72. 主机系统Ubuntu 10.04 x863. 最小系统内核版本 linux-2.6.38
三. 详细构建过程1. 下载linux-2.6.38内核
  1. #cd /usr/src  
  2. #wget http://kernel.org/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.编译内核这一步主要就是内核的配置,如果配置错了可能导致系统无法启动,因此需要非常仔细。
  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 Adapter00: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 USB02: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根据查到的硬件型号配置.config文件以下详细介绍内核的配置General setup --->[*] System V IPC [*] Enable loadable module support --->Processor type and features --->Processor family (Pentium Pro) --->[*] Generuc x86 supportBus options (PCI etc.) --->[*] PCI supportPCI 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 supportSCSI 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 supportGraphics 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) 配置完成后就可以开始编译了:
  1. #make bzImage  
注意:在make menuconfig的时候一定要选对磁盘驱动,否则会出现kernel panic -- VFS error:这里我用的是SCSI的磁盘,IDE的要做相应修改。
  • 1
  • 2
  • 3
  • 下一页
【内容导航】
第1页:构建内核第2页:文件系统
第3页:配置网络
Fedora 14以USB调试方式连接手机(HTC G1)VMware RedHat 9.0 下Mplayer 安装相关资讯      VMWARE 
  • VMware在DockerCon EU宣布开源“  (12/03/2015 13:13:26)
  • 使用VMware克隆功能的一个网络配置  (08/13/2015 20:51:48)
  • VMware推出容器友好的Linux系统  (04/21/2015 11:51:51)
  • VMware Workstation 12 Pro 发布下  (08/26/2015 19:21:49)
  • VMware推出自家Linux版本 Photon  (04/22/2015 17:27:21)
  • VMware如何在中国取得成功?  (04/20/2015 17:18:00)
本文评论 查看全部评论 (0)
表情: 姓名: 字数