Yocto通过SOCK5下载源码

本文详细介绍了如何通过SSH创建SOCKS5服务器,并使用socksify工具将其集成到Bitbake中,从而实现通过SOCKS5代理下载文件的技术过程。
First you need a SOCKS5 server, use ssh to create your own...

export SOCKS_SERVER=xxx.xxx.xxx.xxx:xxx
socksify bitbake .......


http://unix.stackexchange.com/questions/38755/how-to-download-a-file-through-an-ssh-server
ERROR: device-tree-xilinx-v2023.1+gitAUTOINC+0bd6e466ba-r0 do_compile: Error executing a python function in exec_func_python() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_func_python() autogenerated', lineno: 2, function: <module> 0001: *** 0002:devicetree_do_compile(d) 0003: File: '/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/poky/meta/classes-recipe/devicetree.bbclass', lineno: 137, function: devicetree_do_compile 0133: if not(os.path.isfile(dtspath)) or not(dts.endswith(".dts") or devicetree_source_is_overlay(dtspath)): 0134: continue # skip non-.dts files and non-overlay files 0135: except: 0136: continue # skip if can't determine if overlay *** 0137: devicetree_compile(dtspath, includes, d) 0138:} 0139: 0140:devicetree_do_install() { 0141: for DTB_FILE in `ls *.dtb *.dtbo`; do File: '/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/poky/meta/classes-recipe/devicetree.bbclass', lineno: 125, function: devicetree_compile 0121: dtcargs += ["-i", i] 0122: dtcargs += ["-o", "{0}.{1}".format(dtname, "dtbo" if isoverlay else "dtb")] 0123: dtcargs += ["-I", "dts", "-O", "dtb", "{0}.pp".format(dts)] 0124: bb.note("Running {0}".format(" ".join(dtcargs))) *** 0125: subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 0126: 0127:python devicetree_do_compile() { 0128: includes = expand_includes("DT_INCLUDE", d) 0129: listpath = d.getVar("DT_FILES_PATH") File: '/home/mlt/petalinux/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/python3.10/subprocess.py', lineno: 524, function: run 0520: # We don't call process.wait() as .__exit__ does that for us. 0521: raise 0522: retcode = process.poll() 0523: if check and retcode: *** 0524: raise CalledProcessError(retcode, process.args, 0525: output=stdout, stderr=stderr) 0526: return CompletedProcess(process.args, retcode, stdout, stderr) 0527: 0528: Exception: subprocess.CalledProcessError: Command '['dtc', '-@', '-@', '-p', '0x1000', '-@', '-i', '/home/mlt/myboot/ethernet/PZ_ZYNQ/components/plnx_workspace/device-tree/device-tree', '-i', '/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work-shared/zynq-generic-7z035/kernel-source/scripts/dtc/include-prefixes', '-i', '/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/zynq_generic_7z035-xilinx-linux-gnueabi/device-tree/xilinx-v2023.1+gitAUTOINC+0bd6e466ba-r0', '-i', '/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work-shared/zynq-generic-7z035/kernel-source/arch/arm/boot/dts', '-i', '/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/zynq_generic_7z035-xilinx-linux-gnueabi/device-tree/xilinx-v2023.1+gitAUTOINC+0bd6e466ba-r0/git/device_tree/data/kernel_dtsi/2023.1/BOARD/', '-o', 'system-top.dtb', '-I', 'dts', '-O', 'dtb', 'system-top.dts.pp']' returned non-zero exit status 1. Subprocess output: Error: /home/mlt/myboot/ethernet/PZ_ZYNQ/components/plnx_workspace/device-tree/device-tree/system-conf.dtsi:14.1-16 Label or path axi_ethernet_0 not found FATAL ERROR: Syntax error parsing input tree ERROR: Logfile of failure stored in: /home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/zynq_generic_7z035-xilinx-linux-gnueabi/device-tree/xilinx-v2023.1+gitAUTOINC+0bd6e466ba-r0/temp/log.do_compile.26216 ERROR: Task (/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/meta-xilinx/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb:do_compile) failed with exit code '1' ERROR: cracklib-2.9.8-r0 do_fetch: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export SSL_CERT_FILE="/home/mlt/petalinux/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/ssl-3/certs/ca-certificates.crt"; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="1938"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export GIT_SSL_CAINFO="/home/mlt/petalinux/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/etc/ssl/certs/ca-certificates.crt"; export PATH="/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/poky/scripts:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot-native/usr/bin/arm-xilinx-linux-gnueabi:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot/usr/bin/crossscripts:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot-native/usr/sbin:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot-native/usr/bin:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot-native/sbin:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot-native/bin:/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/poky/bitbake/bin:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/hosttools"; export HOME="/home/mlt"; LANG=C git -c gc.autoDetach=false -c core.pager=cat fetch -f --progress https://github.com/cracklib/cracklib refs/*:refs/* failed with exit code 128, no output ERROR: cracklib-2.9.8-r0 do_fetch: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'git://github.com/cracklib/cracklib;protocol=https;branch=master') ERROR: Logfile of failure stored in: /home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/temp/log.do_fetch.50736 ERROR: Task (/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/poky/meta/recipes-extended/cracklib/cracklib_2.9.8.bb:do_fetch) failed with exit code '1'
最新发布
08-19
在使用 Yocto 构建过程中,若遇到设备树编译错误 `Label or path axi_ethernet_0 not found` 以及 `cracklib` 的 Git 仓库拉取失败,这通常涉及设备树配置路径错误和远程资源获取失败两个方面。 ### 设备树编译错误:Label or path axi_ethernet_0 not found 该错误通常表示设备树源文件(.dts 或 .dtsi)中引用的标签或节点路径不存在。例如,`axi_ethernet_0` 是一个符号引用,用于指向设备树中的某个以太网控制器节点。如果该节点未被正确定义或引用路径错误,编译器将无法找到对应的节点并报错。 在设备树源码中,应确保以下几点: - 节点 `axi_ethernet_0` 在 `.dts` 文件中被正确定义,例如: ```dts axi_ethernet_0: axi-ethernet@40400000 { compatible = "xlnx,axi-ethernet-1.0"; reg = <0x40400000 0x2000>; ... }; ``` - 若该节点是从其他 `.dtsi` 文件中引用,需确认其包含路径是否正确,且未被误删或重命名。 - 检查设备树的 `include` 指令是否正确指向了包含该节点的 `.dtsi` 文件,例如: ```dts #include "system-conf.dtsi" ``` 若设备树中确实存在该节点但仍然报错,可能是编译器缓存问题,尝试清理构建环境并重新编译: ```bash bitbake -c cleanall <image-name> bitbake <image-name> ``` ### cracklib git fetch failure 在构建 `cracklib` 时,若出现 Git 仓库拉取失败的问题,例如: ``` ERROR: cracklib-2.9.8-r0 do_fetch: Fetcher failure for URL: 'git://git@github.com/cracklib/cracklib.git' ``` 这通常意味着 BitBake 无法从指定的 Git 仓库获取源码。可能原因包括: - Git 仓库地址已变更或不可用。 - 网络连接受限,无法访问远程仓库。 - SSH 权限问题导致无法克隆私有仓库。 解决方法包括: 1. **修改 `SRC_URI` 使用 HTTPS 代替 SSH** 在 `cracklib_2.9.8.bb` 文件中,将 Git 地址改为 HTTPS 格式,例如: ```bitbake SRC_URI = "git://github.com/cracklib/cracklib.git;protocol=https" ``` 2. **使用本地源码替代远程拉取** 若无法访问远程仓库,可手动下载源码并打包为 `.tar.gz` 文件,将其放置在本地下载目录中,并修改 `SRC_URI` 指向本地文件: ```bitbake SRC_URI = "file://cracklib-2.9.8.tar.gz" ``` 3. **配置 BitBake 使用本地下载缓存** 在 `conf/local.conf` 中配置 `pre-mirror` 并启用 `BB_NO_NETWORK`,以避免网络依赖: ```bitbake PREMIRRORS_prepend = "git://.*/.* file:///path/to/local/sources \n" BB_NO_NETWORK = "1" ``` 4. **清理缓存并重新构建** 若上述方法无效,可尝试清理 BitBake 缓存并重新执行构建: ```bash bitbake -c clean cracklib bitbake cracklib ``` --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值