$ tar jxvf buildroot-snapshot.tar.bz2 $ cd buildroot $ make menuconfig 配置項(xiàng)如下:Target Architecture (arm)---à Target Architecture variant (arm926t) --à Target ABI (OABI) ---à Build option --à 此項(xiàng)中只作如下修改 (arm-linux-gnu) GNU build hostname suffix 其余都是默認(rèn)的選項(xiàng) Toolchain type (buildroot toolchain) --à Toolchain Options ---à ---Kernel Header Options Kernel Headers (Linux 2.6.21.x kernel headers) -à ----uClibc Options uClibc C library version (uClinbc0.9.29) -à (toolchain/uClibc/uClibc-0.9.29.config) uClibc configuration files to [ ] Enable locale/gettext/i8n support? Thread library implementation (linux threads (stable/old))--à [ ] Thread library debugging -----Binutils options Binutils version (binutils 2.17) --à () Additional binutils options -----Gcc options GCC compiler version (gcc 3.4.6) -à [ ] Enable setjmp /longjmp exceptions? () Additional gcc options [ ]Build/install c++ compiler and libstdc++? [ ]Build/install Objective –C compiler and runtime? [ ]Build/install Fortran compiler and runtime? [*]Build/install a shared libgcc? -------Ccache Options [ ]Enable ccache support? --------Gdb Options [ ]Build gdb debugger for the Target [ ]Build gdb server for the Target [ ]Build gdb for the Host ---------elf2flt 未配置該選項(xiàng) ---------Common Toolchain Options 未配置該選項(xiàng) (-Os –pipe) Target Optimizations [*] Include target utils in cross toolchain Package Selection for the target --à busybox另外編譯,這里未配置 Target Options -à [*] ext2 root filesystem 其他為默認(rèn)配置 Board Support Options ---à [*] Atmel Target 其他未配置
$ make all
編譯結(jié)束后即可在staging_dir目錄下看到如下文件:arm-linux arm-linux-uclibc bin include info lib libexec man usr 其中bin中即為相應(yīng)的交叉編譯工具,arm-linux目錄下的lib中即為相應(yīng)的庫。
為了驗(yàn)證該交叉編譯工具是否可以正常工作,修改 .bash_profile文件中的內(nèi)容,注釋掉 export PATH=$PATH:/usr/local/arm/3.4.1/bin 添加上: export PATH=$PATH:/home/yyl/project1/buildroot/build_arm/staging_dir/bin
重起系統(tǒng),通過arm-linux-gcc –version命令可檢測到當(dāng)前arm-linux-gcc版本為3.4.6
修改linux-2.6.21目錄下的Makefile文件: 將 CROSS_COMPILE =/usr/local/arm/3.4.1/bin/arm-linux- 改為:CROSS_COMPILE =/home/yyl/project1/buildroot/build_arm/staging_dir/bin/arm-linux-
由于我使用的是AT91SAM9261EK板子,其他的編譯步驟都可參考 文檔linux2.6.21 kernel移植到AT91SAM9261EK 通過給文檔的編譯步驟可以得到uImage文件
最后使用新生成的交叉編譯工具,編譯busybox-1.00,在使用make menuconfig命令配置選項(xiàng)時,只需要修改 Build Options à[*] Do you want tobuild Busybox with a Cross Compiler? (/home/yyl/project1/buildroot/build_arm/staging_dir/bin/arm-linux-) 其他都采用該檔Linux-2.6.20內(nèi)核移植到AT91RM9200-EK 制作ramdisk的方法逐步進(jìn)行,僅有如下步驟需要修改(用紅色標(biāo)記),其他都不用修改: a. c.準(zhǔn)備lib庫文件
最后將uImage和ramdisk.gz 通過tftp下載到AT91SAM9261EK板子,啟動系統(tǒng),系統(tǒng)正常運(yùn)行,可通過這里L(fēng)inux version 2.6.21 (yyl@localhost.localdomain)(gcc version 3.4.6)看到gcc為3.4.6, 同時在lib目錄下可以看到uClibc為0.9.29. 從而可以驗(yàn)證該交叉編譯工具可以正常工作。到此交叉編譯工具制作完成。 若想詳細(xì)地了解buildroot可參考該文檔http://buildroot./buildroot.html
|
|