【问题标题】:crosstool-ng cant fetch linux tarballcrosstool-ng 无法获取 linux tarball
【发布时间】:2017-01-26 22:32:05
【问题描述】:

我正在尝试使用crosstool-ng 构建工具链,我已经全部设置好,按照http://crosstool-ng.org/#download_and_usage 中的说明选择了我的 cpu,我正处于可以构建工具链的阶段。但是,当我输入 ct-ng build 时,它会取消并出现以下错误:

$ 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/linux.sh@741]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@590]
[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/linux.sh@741]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@590]
[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~origand 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 (使用我的包装器脚本)现​​在工作得很好...... .

【问题讨论】:

    标签: linux wget crosstool-ng


    【解决方案1】:

    你可以配置ct-ng来阻止它下载源:

    ct-ng menuconfig
    
    • 转到Path and misc options
    • *** Downloading *** 中,选择[*] Forbid downloads
    • 退出...

    当您尝试构建工具链 (ct-ng build) 时,构建过程会要求您将手动下载的压缩包放入 ~/src

    只需检查 build.log 即可知道需要什么 tarball。

    【讨论】:

      【解决方案2】:

      好的,

      由于 wget 被多个 (9) 参数调用,我将包装脚本(/usr/bin/wget)修复为如下所示:

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

      这似乎可以成功下载ct-ng所需的源压缩包

      【讨论】:

        【解决方案3】:

        您可以配置ct-ng 以将额外的参数传递给wget: ct-ng 菜单配置

        • 转到Path and misc options
        • *** Downloading *** 中,在Connection timeout 选项下
        • 选择(--passive-ftp --tries=3 -nc --progress=dot:binary...
        • 添加--no-check-certificate
        • 退出

        这是不安全的,但是它允许您放弃为其他答案中提到的 wget 创建包装脚本

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2019-12-24
          • 1970-01-01
          • 2015-05-03
          • 2020-08-18
          • 1970-01-01
          • 1970-01-01
          • 2021-08-08
          • 1970-01-01
          相关资源
          最近更新 更多