arm 编译openwrt

原创 muxinghe  2024-04-15 23:23 

本文主要是利用晶晨系列盒子或手机,编译openwrt。

环境设置

对于晶晨盒子,建议使用docker编译,拉取ubuntu最新docker,然后更新并安装依赖:

sudo apt update -y
sudo apt full-upgrade -y
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache clang cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext \
  git gnutls-dev gperf haveged help2man intltool libelf-dev \
  libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5 \
  libncursesw5-dev libpython3-dev libreadline-dev libssl-dev libtool lld llvm lrzsz mkisofs msmtp \
  nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip python3-ply \
  python3-pyelftools qemu-utils re2c rsync scons squashfs-tools subversion swig \
  texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

或直接拉取下列docker:

registry.cn-hangzhou.aliyuncs.com/muxinghe/ubuntu-sshd-lede:latest

依赖安装完成,即可正常按照电脑编译过程进行编译。

对于手机,建议使用termux,然后使用tmoe相关的功能创建croot或proot的ubuntu容器,然后安装相关依赖即可。

遇到的问题与解决方案

1、编译到golang ,提示Makefile:380: *** go-bootstrap cannot be installed on linux/arm64.  Stop.解决方法为apt install golang-go,然后配置文件修改languages-go-configation-external bootstrap go root directroy ,添加/usr/local/go,或者安装后直接编辑config,找到并修改CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT="/usr/bin/go"

2、如编译ucl的时候,提示无法获取到系统架构,这个问题百度了一下解决了,需要在./configure 后加 --build=arm-linux,我的方法是修改tools/ucl/Makefile 中./configure一行。

3、如遇到相关依赖不存在(通常是gcc相关),建议通过apt查找类似名称的依赖进行替换,或百度之。

本文地址:http://xuexi.muxinghe.cn/index.php/2024/04/15/arm-%e7%bc%96%e8%af%91openwrt/
版权声明:本文为原创文章,版权归 muxinghe 所有,欢迎分享本文,转载请保留出处!
相关文章 关键词:

评论已关闭!