美文网首页
openwrt 生成交叉工具(基于mt7628)

openwrt 生成交叉工具(基于mt7628)

作者: 嵌入式工作 | 来源:发表于2018-11-22 11:00 被阅读0次

在make menuconfig中选择Build the OpenWrt based Toolchain

image.png

make 编译后ls bin/ramips 可以看到压缩文件OpenWrt-Toolchain-ramips-mt7628_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686.tar.bz2

配置交叉工具

这里我们演示将交叉工具链安装到 ubuntu 的“/opt”目录下。首先切换到 openwrt 的
根目录下,输入如下命令:

mkdir /opt/
chmod 777 /opt
sudo tar jxvf ./bin/ramips/OpenWrt-Toolchain-ramips-mt7628_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686.tar.bz2 -C /opt/

设置环境变量

执行命令

sudo vi /etc/bash.bashrc

在文件最后添加以下两行配置

export PATH=/opt/OpenWrt-Toolchain-ramips-mt7628_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin:$PATH
export STAGING_DIR=/your_openwrt_path/staging_dir

上面这个“STAGING_DIR”变量中的“your_openwrt_path”是读者实际放 openwrt 源码
的根目录,如果这个“STAGING_DIR”变量不设置的话,会在用交叉工具链编译文件时有警
告,但是不影响编译结果。
最后保存退出。
接着在终端执行以下命令:

source /etc/bash.bashrc

检查是否安装成功

mipsel-openwrt-linux-gcc -v

相关文章

网友评论

      本文标题:openwrt 生成交叉工具(基于mt7628)

      本文链接:https://www.haomeiwen.com/subject/fyokqqtx.html