Deepin15.8系統下安裝QorIQ Linux SDK v2.0 yocto成功完美運行的隨筆


2019.2.17日:最終安裝成功,完美解決!

2019.2.16日:最終安裝未成功,但是過程中排除 了幾個bug,前進了幾步,僅供參考。

寫在最前面,yocto安裝是有系統要求的,Deepin 15.8不在此Freescale SDK安裝的官方適配范圍內,樓主只是一時興起,強行安裝。

 

 

首先在VMware分配QorIQ Linux SDK v2.0 SOURCE.iso光盤鏡像給虛擬機,會自動掛載在 /media/eric/yocto目錄下。

打開terminal  執行:

-> /media/eric/yocto/install

-> cd /home/eric/QorIQ-SDK-V2.0-20160527-yocto

-> ./sources/meta-freescale/scripts/host-prepare.sh

->. ./fsl-setup-env -m t4240qds

 期間會遇到如下庫找不到的情況,執行下面的命令。

sudo apt-get install build-essential sudo apt-get install diffstat sudo apt-get install texinfo sudo apt-get install git sudo apt-get install chrpath sudo apt-get install libsdl1.2-dev

-> bitbake fsl-toolchain

編譯到這里,一般會提示:

ERROR: Function failed: Fetcher failure: Fetch command failed with exit code 128, output: fatal: the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead. ERROR: Logfile of failure stored in: /home/eric/QorIQ-SDK-V2.0-20160527-yocto/build_t4240qds/tmp/work/x86_64-linux/gnu-config-native/20150728+gitAUTOINC+b576fa87c1-r0/temp/log.do_unpack.102114 Log data follows: | DEBUG: Executing python function do_unpack | DEBUG: Executing python function base_do_unpack

這樣的錯誤提示,解決方法是:

修改/home/eric/QorIQ-SDK-V2.0-20160527-yocto/sources/poky/bitbake/lib/bb/fetch2/git.py  

runfetchcmd("%s branch --set-upstream %s origin/%s" % (ud.basecmd, branchname, \ branchname), d)

改成 

runfetchcmd("%s branch --set-upstream-to origin/%s" % (ud.basecmd, \ branchname), d

修改之后,使用下面指令清除上次編譯。

-> bitbake -c cleansstate fsl-toolchain

之后再執行

-> bitbake fsl-toolchain

 還會繼續遇到如下錯誤提示:

| help2man: can't get `--help' info from automake-1.15
| Try `--no-discard-stderr' if option outputs to stderr
| make: *** [Makefile:3687: doc/automake-1.15.1] Error 255
| make: *** Waiting for unfinished jobs....
| WARNING: exit code 1 from a shell command.
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (log file is located at /home/eric/QorIQ-SDK-V2.0-20160527-yocto/build_t4240qds/tmp/work/x86_64-linux/automake-native/1.15-r0/temp/log.do_compile.123911)

解決方法是:修改 /home/eric/QorIQ-SDK-V2.0-20160527-yocto/build_t4240qds/tmp/work/x86_64-linux/automake-native/1.15-r0/build/makefile文件:

doc/aclocal-$(APIVERSION).1: $(aclocal_script) lib/Automake/Config.pm $(update_mans) aclocal-$(APIVERSION) doc/automake-$(APIVERSION).1: $(automake_script) lib/Automake/Config.pm $(update_mans) automake-$(APIVERSION)

修改成

doc/aclocal-$(APIVERSION).1: $(aclocal_script) lib/Automake/Config.pm $(update_mans) aclocal-$(APIVERSION) doc/automake-$(APIVERSION).1: $(automake_script) lib/Automake/Config.pm $(update_mans) automake-$(APIVERSION) --no-discard-stderr

之后再清理編譯,再次執行

-> bitbake -c cleansstate fsl-toolchain

-> bitbake fsl-toolchain

又會遇到  如下報錯

| Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at /home/eric/QorIQ-SDK-V2.0-20160527-yocto/build_t4240qds/tmp/sysroots/x86_64-linux/usr/bin/automake line 3936.
| Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at /home/eric/QorIQ-SDK-V2.0-20160527-yocto/build_t4240qds/tmp/sysroots/x86_64-linux/usr/bin/automake line 3936.
| WARNING: exit code 255 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/eric/QorIQ-SDK-V2.0-20160527-yocto/build_t4240qds/tmp/work/x86_64-linux/libtool-native/2.4.6-r0/temp/log.do_configure.2454)

原因是 Deepin的 perl版本較新,老的正則表達式格式不識別 ,

解決方法是:修改/home/eric/QorIQ-SDK-V2.0-20160527-yocto/build_t4240qds/tmp/sysroots/x86_64-linux/usr/bin/automake文件的:

sub substitute_ac_subst_variables
{
my ($text) = @_;
$text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
return $text;
}

改成:

sub substitute_ac_subst_variables { my ($text) = @_; # $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge; $text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge; return $text; }

 

之后,再次執行

-> bitbake -c cleansstate fsl-toolchain

-> bitbake fsl-toolchain

出現報錯 :

     tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm); ^~~~~~ 

之類的。

這個錯誤的原因應該是Deepin系統的編譯器版本與yocto要求的編譯器版本差別太大導致的, Deepin的GCC版本試試7.6,而freescale 官方要求的經過驗證的ubuntu14.04中的gcc版本才4.8,所以懷疑GCC版本過高搗的鬼。

於是降低gcc版本。

執行

-> sudo apt-get install gcc-4.8

-> sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100

同樣降低g++版本

-> sudo apt-get install g++-4.8

-> sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 100

 

重新執行

-> bitbake fsl-toolchain 

又出現以下報錯 

| Can't locate find.pl in @INC (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.2 /usr/local/share/perl/5.26.2 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at perlpath.pl line 7.
| WARNING: exit code 2 from a shell command. | ERROR: Function failed: do_configure (log file is located at /home/eric/QorIQ-SDK-V2.0-20160527-yocto/build_t4240qds/tmp/work/x86_64-linux/openssl-native/1.0.2d-r0/temp/log.do_configure.65569) ERROR: Task 402 (virtual:native:/home/eric/QorIQ-SDK-V2.0-20160527-yocto/sources/poky/meta/recipes-connectivity/openssl/openssl_1.0.2d.bb, do_configure) failed with exit code '1'

 估計又是perl版本搞的鬼,解決方法是拷貝一個find.pl過來

-> sudo cp /home/eric/QorIQ-SDK-V2.0-20160527-yocto/sources/poky/meta/recipes-connectivity/openssl/openssl/find.pl /etc/perl/

重新執行

-> bitbake fsl-toolchain 

之后再無報錯 ,直到 編譯完成 。

 

完美解決!

 

最后再插一嘴,Deepin系統用着正不錯,最最符合中國人的Linux版本了,受夠了ubuntu上慢騰騰的 firefox, 開着 360安全瀏覽器,微信,流暢的,我已經仿佛忘了我是在用VMware+Linux了。

 

 

參考了以下文章:

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

https://www.cnblogs.com/zengjfgit/p/9178523.html

https://blog.csdn.net/bird_fly1024/article/details/81451662

http://www.cnblogs.com/zengjfgit/p/9178571.html

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

安裝多個 perl :

https://www.cnblogs.com/aaron2015/p/5132308.html   -試了,不好用

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

備    忘 :

ubuntu 14.04中各組件版本 :

perl :  This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux-gnu-thread-multi  

gcc :    gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4

g++:    gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4)

make:  GNU Make 3.81

python :   Python 2.7.6 (default, Mar 22 2014, 22:59:56)    [GCC 4.8.2] on linux2

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM