buildroot配置過程

來源:互聯網
上載者:User

$ tar jxvf buildroot-snapshot.tar.bz2

$ cd buildroot

$ make menuconfig

配置項如下:Target Architecture (arm)---à

            Target Architecture variant (arm926t) --à

            Target ABI (OABI) ---à

            Build option --à  此項中只作如下修改 (arm-linux-gnu) GNU build hostname suffix   其餘都是預設的選項

            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 未配置該選項

              ---------Common Toolchain Options  未配置該選項

              (-Os –pipe) Target Optimizations

              [*] Include target utils in cross toolchain

Package Selection for the target --à busybox另外編譯,這裡未配置

Target Options -à [*] ext2 root filesystem 其他為預設配置

Board Support Options ---à [*] Atmel Target 其他未配置

 

$ make all

 

編譯結束後即可在staging_dir目錄下看到如下檔案:arm-linux arm-linux-uclibc bin include info lib libexec man usr  其中bin中即為相應的交叉編譯工具,arm-linux目錄下的lib中即為相應的庫。

 

為了驗證該交叉編譯工具是否可以正常工作,修改 .bash_profile檔案中的內容,注釋掉 export PATH=$PATH:/usr/local/arm/3.4.1/bin 添加上:

export PATH=$PATH:/home/yyl/project1/buildroot/build_arm/staging_dir/bin

 

重起系統,通過arm-linux-gcc –version命令可檢測到當前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命令配置選項時,只需要修改 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核心移植到AT91RM9200-EK

製作ramdisk的方法逐步進行,僅有如下步驟需要修改(用紅色標記),其他都不用修改:

a.       c.準備lib庫檔案
# cd /mnt
# mkdir lib
# cd  /home/yyl/project1/buildroot/build_arm/staging_dir /arm-linux/lib 
# for file in libc libcrypt libdl libm libpthread libresolv libutil
> do
> cp $file-*.so /mnt/lib
> cp -d $file.so.[*0-9] /mnt/lib
> done
# cp -d ld*.so* /mnt/lib

 

最後將uImage和ramdisk.gz 通過tftp下載到AT91SAM9261EK板子,啟動系統,系統正常運行,可通過這裡Linux version 2.6.21 (yyl@localhost.localdomain)(gcc version 3.4.6)看到gcc為3.4.6, 同時在lib目錄下可以看到uClibc為0.9.29.

 

從而可以驗證該交叉編譯工具可以正常工作。到此交叉編譯工具製作完成。

若想詳細地瞭解buildroot可參考該文檔http://buildroot.uclibc.org/buildroot.html

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.