ubuntu10.04環(huán)境下
參照http://docs.blackfin.uclinux.org/doku.php?id=toolchain:installing
toolchin、u-boot、kernel等資料最新的下載在http://blackfin.uclinux.org/gf/gf/project/uclinux-dist/forum/?action=browseRedirect
1)下載
在http://blackfin.uclinux.org/gf/project/toolchain/frs/?action=FrsReleaseBrowse&frs_package_id=74&__utma=28888175.1113242415.1292832096.1292893767.1292904669.3&__utmz=28888175.1292904888.3.5.utmcsr%3Dbaidu%7Cutmccn%3D%28organic%29%7Cutmcmd%3Dorganic%7Cutmctr%3Dblackfin+%B9%D9%CD%F8&__utmc=28888175&__utmb=28888175.11.10.1292904669&_br_pkgrls_total=100&_br_pkgrls_page=3下載下面幾項(xiàng):
blackfin-toolchain-09r1.1-2.i386.tar.bz2
blackfin-toolchain-elf-gcc-4.1-09r1.1-2.i386.tar.bz2
blackfin-toolchain-uclibc-full-09r1.1-2.i386.tar.bz2
2)安裝
a)解壓3個包到/opt下,在/opt下可以輸入find -name "bin" 查看是否安裝好,安裝好的會看到
./uClinux/bfin-elf/bfin-elf/bin
./uClinux/bfin-elf/bin
./uClinux/bfin-uclinux/bin
./uClinux/bfin-uclinux/bfin-uclinux/bin
./uClinux/bfin-linux-uclibc/bin
./uClinux/bfin-linux-uclibc/bfin-linux-uclibc/bin
b)然后設(shè)置環(huán)境變量,在用戶目錄下的.bashrc中添加,又或是在/etc/bash.bashrc中添加如下:
export PATH=$PATH:/opt/uClinux/bfin-linux-uclibc/bfin-linux-uclibc/bin:/opt/uClinux/bfin-linux-uclibc/bin:/opt/uClinux/bfin-uclinux/bin:/opt/uClinux/bfin-uclinux/bfin-uclinux/bin:/opt/uClinux/bfin-elf/bfin-elf/bin:/opt/uClinux/bfin-elf/bin
3)其他安裝
除了這三個包以外,還需要一些其他必要的包,具體參考http://docs.blackfin.uclinux.org/doku.php?id=installing_linux
4)測試
下面就試著編譯u-boot和內(nèi)核看看是否已經(jīng)安裝成功
a)編譯u-boot
在http://blackfin.uclinux.org/gf/project/u-boot/frs/?action=FrsReleaseBrowse&frs_package_id=67&__utma=28888175.1113242415.1292832096.1292904669.1292978556.4&__utmz=28888175.1292904888.3.5.utmcsr%3Dbaidu%7Cutmccn%3D%28organic%29%7Cutmcmd%3Dorganic%7Cutmctr%3Dblackfin+%B9%D9%CD%F8&__utmb=28888175.32.10.1292978556&__utmc=28888175&_br_pkgrls_total=100&_br_pkgrls_page=2中下載 u-boot-2008.10-2009R1.1-rc1.tar.bz2
解壓
cd u-boot-2008.10-2009R1.1-rc1
make bf548-ezkit
make
最后生成u-boot.bin
b)編譯內(nèi)核
在http://blackfin.uclinux.org/gf/project/uclinux-dist/frs/?action=FrsReleaseBrowse&frs_package_id=76&__utma=28888175.1113242415.1292832096.1292904669.1292978556.4&__utmz=28888175.1292904888.3.5.utmcsr%3Dbaidu%7Cutmccn%3D%28organic%29%7Cutmcmd%3Dorganic%7Cutmctr%3Dblackfin+%B9%D9%CD%F8&__utmb=28888175.39.10.1292978556&__utmc=28888175&_br_pkgrls_total=100&_br_pkgrls_page=2中下載uClinux-dist-2009R1.1-RC4.tar.bz2
解壓
make menuconfig 選擇 BF548-EZKIT 平臺
make
好吧,出現(xiàn)錯誤了,log如下:
make[4]: *** [/home/bert/hsae/uClinux-dist/user/mtd-utils/build-606f38a2221648ca5c5fa292c9f71d2ddd59fa66-host/compr_lzo.o] Error 1
make[4]: Leaving directory `/home/bert/hsae/uClinux-dist/user/mtd-utils/606f38a2221648ca5c5fa292c9f71d2ddd59fa66'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/bert/hsae/uClinux-dist/user/mtd-utils'
make[2]: *** [mtd-utils] Error 2
make[2]: Leaving directory `/home/bert/hsae/uClinux-dist/user'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/bert/hsae/uClinux-dist/user'
make: *** [subdirs] Error 1
我們重新make menuconfig,選上
[*] Customize Kernel Settings
[*] Customize Application/Library Settings
之后彈出配置選項(xiàng)框,選擇Flash Tools ---> ,把其中的[ ] mtd-utils 選項(xiàng)去掉*
make
內(nèi)核編譯成功,生成在/images中
其實(shí)也可以不去掉選項(xiàng),就是要在http://www.oberhumer.com/opensource/lzo/中,把lzo庫下回來,編譯安裝,修改環(huán)境變量,編譯內(nèi)核即可。當(dāng)然,最好的解決辦法就是下 mtd-utils-1.1.0.tar.bz2 和 zlib-1.2.3.tar.gz 這兩個包,然后都make install就可以正常編譯通過了。(在安裝mtd-utils時(shí)可能會報(bào)錯,本機(jī)上就報(bào)錯 error: sys/acl.h ,只需要apt-get install libacl1-dev 之后再次make install可以安裝成功。)
參考:http://www.cnblogs.com/rockstone/archive/2010/01/29/1659401.html