利用busybox, extlinux 在工控機CompactFlash(CF卡)上構建Linux系統(下)

< 工控機 (AMD LX處理器平臺, 非ARM) Linux kernel & Busybox 編譯選項配置 >

 

(一) 配置並編譯Busybox:

 

說明, 此次編譯的目標機不是arm板, 而是工控機(研華3355), CPU是AMD low power LX800/500 MHz and LX600/366 MHz Processor,

so~, 注意與傳統的移植arm平臺的不同~


 修改Makefile,
       164行改成CROSS_COMPILE ?= 空
       189行改成ARCH ?= i386
       #如果是arm平臺,CROSS_COMPILE ?= arm-linux-, ARCH ?= arm,

這裏暫用默認設置, 不修改Makefile, 執行make menuconfig,進入配置界面,

 

General Configuration---> 
 [*] Show verbose applet usage messages 
 [*] Store applet usage messages in compressed form 
 [*] Support –install [-s] to install applet links at runtime 
 [*] Enable locale support(system needs locale for this to work) 
 [*] Support for –long-options 
 [*] Use the devpts filesystem for unix98 PTYs 
 [*] Support writing pidfiles 
 [*] Runtime SUID/SGID configuration via /etc/busybox.config 
 [*]  Suppress warning message if /etc/busybox.conf is not readable 
 
Build Options---> 
 [*] Build BusyBox as a static binary(no shared libs) 
 [*] Build with Large File Support(for accessing files>2GB) 
 
Installation Options-> 
 []Don’t use /usr 
   Applets links (as soft-links) ---> 
 (./_install) BusyBox installation prefix 

 

Busybox Library Tuning ---> 
 (6)Minimum password legth 
 (2)MD5:Trade Bytes for Speed 
 [*]Fsater /proc scanning code(+100bytes) 
 [*]Command line editing 
 (1024)Maximum length of input 
 [*] vi-style line editing commands 
 (15) History size 
 [*] History saving 
 [*] Tab completion 
 [*]Fancy shell prompts 
 (4) Copy buffer size ,in kilobytes 
 [*]Use ioctl names rather than hex values in error mess
 [*]Support infiniband HW 
 
(2)、Linux Module Utilities---> 
  (/lib/modules)Default directory containing modules 
(modules.dep)Default name of modules.dep
[ ] Simplified modutils  
[*] insmod 
[*] rmmod 
[*] lsmod 
[*] modprobe 
-----options common to multiple modutils 
[ ] support version 2.2/2.4 Linux kernels 
[*]Support tainted module checking with new kernels 
[*]Support for module .aliases file 
[*] support for modules.symbols file 

 

退出make menuconfig的界面, 執行:
make
make install

生成busybox/_install文件夾;

 

 

(二)配置並編譯Kernel:

 

  解壓內核源碼: tar xvzf linux-2.6.32.2.tar.gz
 修改Makefile: vi Makefile
在Vi中輸入/,進入搜索,再輸入CROSS_COMPILE,找到
  export KBUILD_BUILDHOST := $(SUBARCH)
  ARCH            ?= $(SUBARCH)
  CROSS_COMPILE   ?=
 
修改爲:
  export KBUILD_BUILDHOST := $(SUBARCH)
  ARCH  ?= x86
  CROSS_COMPILE ?=

如果目標機是arm平臺,並且編譯器前綴是arm-linux-,則:
  export KBUILD_BUILDHOST := $(SUBARCH)
  ARCH  ?= arm
  CROSS_COMPILE ?= arm-linux-

然後執行make menuconfig
配置選項參考:
http://blog.csdn.net/hello_wyq/archive/2006/09/30/1312066.aspx
http://www.chinaunix.net/jh/4/16106.html
http://lamp.linux.gov.cn/Linux/kernel_options.html
http://blog.csdn.net/bekars/archive/2007/01/24/1492067.aspx
http://blog.chinaunix.net/u3/116495/showart_2333717.html

 

其中需要關閉的選項:

 

 

 

 

General setup

   []Initial RAM filesystem and RAM disk (initramfs/initrd) support

 

Enable the block layer

   [ ]Support for large (2TB+) block devices and files

   [ ]Block layer data integrity support

      IO Schedulers-->以下全刪

 

Power management and ACPI options

   [ ]Power Management support

   [ ]CPU idle PM support 

       CPU Frequency scaling  --->

   [ ] CPU Frequency scaling

 

Bus options

    [ ] Message Signaled Interrupts (MSI and MSI-X)

    [ ] ISA support

    [ ] MCA support

    < > PCCard (PCMCIA/CardBus) support

 

Networking support

    [ ]Amateur Radio support  --->

    < >CAN bus subsystem support  --->

    < >IrDA (infrared) subsystem support  --->

    < >Bluetooth subsystem support  --->

    [ ]  RxRPC dynamic debugging

    < >  RxRPC Kerberos security

    < >WiMAX Wireless Broadband support  --->

    < >RF switch subsystem support  --->

    < >Plan 9 Resource Sharing Support (9P2000) (Experimental)  --->

    Networking options  --->

        < > Packet socket

       < > Transformation user configuration interface

       < > PF_KEY sockets

       [ ] Security Marking

       [ ] Network packet filtering framework (Netfilter)  --->

       < > The DCCP Protocol (EXPERIMENTAL)  --->

       < > The RDS Protocol (EXPERIMENTAL)

       < > The TIPC Protocol (EXPERIMENTAL)  --->

       < > Asynchronous Transfer Mode (ATM)

       < > 802.1d Ethernet Bridging

       [ ] Distributed Switch Architecture support  --->

       < > 802.1Q VLAN Support

       < > DECnet Support

       < > ANSI/IEEE 802.2 LLC type 2 Support

       <M> The IPX protocol

       [ ]   IPX: Full internal IPX network

       < > Appletalk protocol support

       < > CCITT X.25 Packet Layer (EXPERIMENTAL)

       < > LAPB Data Link Driver (EXPERIMENTAL)

       < > Acorn Econet/AUN protocols (EXPERIMENTAL)

       < > WAN router

       < > Phonet protocols family

       < > IEEE Std 802.15.4 Low-Rate Wireless

       [ ] QoS and/or fair queueing  --->

       [ ] Data Center Bridging support

       Network testing  --->以下全刪

 

Device Drivers

       <*> Memory Technology Device (MTD) support  --->

       < > Parallel port support  --->

 

File systems//視情況刪除

 

Kernel hacking//全刪

 

Security options//全不選

 

Cryptographic API//加密算法,視情況刪除

 

 

 

參考:友善手冊, 以及http://blog.csdn.net/cgq081616/archive/2010/03/13/5376102.aspx

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章