2017-01-26 44 views
3

我想建立一個工具鏈使用crosstool-ng,我已經把它設置好了,選擇我的CPU,如http://crosstool-ng.org/#download_and_usage所述,我在我可以建立我的工具鏈的步驟。當我進入ct-ng build但是,它取消,出現以下錯誤:crosstool-ng無法取得linux tarball

$ ct-ng build 
[INFO ] Performing some trivial sanity checks 
[INFO ] Build started 20170126.135517 
[INFO ] Building environment variables 
[EXTRA] Preparing working directories 
[EXTRA] Installing user-supplied crosstool-NG configuration 
[EXTRA] ================================================================= 
[EXTRA] Dumping internal crosstool-NG configuration 
[EXTRA] Building a toolchain for: 
[EXTRA]  build = x86_64-pc-linux-gnu 
[EXTRA]  host = x86_64-pc-linux-gnu 
[EXTRA]  target = powerpc-e500v2-linux-gnuspe 
[EXTRA] Dumping internal crosstool-NG configuration: done in 0.09s (at 00:02) 
[INFO ] ================================================================= 
[INFO ] Retrieving needed toolchain components' tarballs 
[EXTRA] Retrieving 'linux-4.3' 
[ERROR] 
[ERROR] >> 
[ERROR] >> Build failed in step 'Retrieving needed toolchain components' tarballs' 
[ERROR] >>  called in step '(top-level)' 
[ERROR] >> 
[ERROR] >> Error happened in: do_kernel_get[scripts/build/kernel/[email protected]] 
[ERROR] >>  called from: main[scripts/[email protected]] 
[ERROR] >> 
[ERROR] >> For more info on this error, look at the file: 'build.log' 
[ERROR] >> There is a list of known issues, some with workarounds, in: 
[ERROR] >>  '/usr/local/share/doc/crosstool-ng/crosstool-ng-1.22.0/B - Known issues.txt' 
[ERROR] 
[ERROR] (elapsed: 0:31.10) 
[00:31]/make: *** [build] Error 1 

build.log我得到如下:

[EXTRA] Retrieving 'linux-4.3' 
... 
... 
... 
[DEBUG] Not at this location: "http://www.kernel.org/pub/linux/kernel/v4.x/longterm/v4.3/linux-4.3.zip" 
[DEBUG] Trying 'http://www.kernel.org/pub/linux/kernel/v4.x/longterm/linux-4.3.zip' 
[DEBUG] ==> Executing: 'wget' '--passive-ftp' '--tries=3' '-nc' '--... 
[DEBUG] Not at this location: "http://www.kernel.org/pub/linux/kernel/v4.x/longterm/linux-4.3" 
[ERROR] 
[ERROR] >> 
[ERROR] >> Build failed in step 'Retrieving needed toolchain components' tarballs' 
[ERROR] >>  called in step '(top-level)' 
[ERROR] >> 
[ERROR] >> Error happened in: do_kernel_get[scripts/build/kernel/[email protected]] 
[ERROR] >>  called from: main[scripts/[email protected]] 
[ERROR] >> 
[ERROR] >> For more info on this error, look at the file: 'build.log' 
[ERROR] >> There is a list of known issues, some with workarounds, in: 
[ERROR] >>  '/usr/local/share/doc/crosstool-ng/crosstool-ng-1.22.0/B - Known issues.txt' 
[ERROR] 
[ERROR] (elapsed: 0:31.10) 

我明白,這不是能夠檢索內核,是有辦法,我可以手動下載並告訴腳本tarball的位置?

好的,我意識到 wget http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.3.tar.gz會失敗,但wget --no-check-certificate http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.3.tar.gz將工作通過代理下載tarball。 所以我複製/usr/bin/wget到/ usr/binwget〜原稿and wrote a wrapper在/ usr/bin中/ wget`,看起來像:

#!/bin/bash 

/usr/bin/wget~orig --no-check-certificate $1 

但似乎沒有任何工作,我現在得到build.log如下:

[DEBUG] ==> Executing: 'wget' '--passive-ftp' '--tries=3' '-nc' '--progress=dot:binary' '-T' '10' '-O' '/home/ron/src/toolchain/work/.build/tarballs/linux-4.3.tar.xz.tmp-dl' 'http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.3.tar.xz' 
[ALL ] wget~orig: missing URL 
[ALL ] Usage: wget~orig [OPTION]... [URL]... 
[ALL ] 
[ALL ] Try `wget~orig --help' for more options. 
[DEBUG] Not at this location: "http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.3.tar.xz" 
[DEBUG] Trying 'http://www.kernel.org/pub/linux/kernel/v4.x/longterm/v4.3/linux-4.3.tar.xz' 
[DEBUG] ==> Executing: 'wget' '--passive-ftp' '--tries=3' '-nc' '--progress=dot:binary' '-T' '10' '-O' '/home/ron/src/toolchain/work/.build/tarballs/linux-4.3.tar.xz.tmp-dl' 'http://www.kernel.org/pub/linux/kernel/v4.x/longterm/v4.3/linux-4.3.tar.xz' 
[ALL ] wget~orig: missing URL 
[ALL ] Usage: wget~orig [OPTION]... [URL]... 

它是如何自動知道我原來的wget二進制文件現在叫做wget~orig ??? Andit試圖使用它來代替我現在位於/usr/bin/wget的包裝器(是的,我已經添加了x權限並嘗試了它,從shell中使用wget http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.3.tar.gz(利用我的包裝腳本)現在工作得很好...

回答

1

好吧,

由於wget被稱爲與muliple(9)的論點,我定我的包裝腳本(在/usr/bin/wget)的樣子:

#!/bin/bash 

/usr/bin/wget~orig --no-check-certificate $1 $2 $3 $4 $5 $6 $7 $8 $9 

,這似乎是成功地工作,下載所需的源碼包,通過ct-ng

0

您可以配置ct-ng以防止其下載來源:

ct-ng menuconfig 
  • 轉到Path and misc options
  • *** Downloading ***,選擇[*] Forbid downloads
  • 退出...

當你嘗試構建您的工具鏈(ct-ng build)構建過程將期望您將手動下載的tarball放入~/src

只是檢查build.log知道什麼樣的tarballs通緝。