openwrt编译需要的环境
我这边使用的是debian
1 2 3
| apt update && apt install build-essential clang flex bison g++ gawk \ gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev \ python3-setuptools rsync swig unzip zlib1g-dev file wget -y
|
选择你要拉取的分支
我这边选择的是openwrt-23.05
可以自行去openwrt官方仓库查看最新分支
1
| git clone -b openwrt-23.05 https://github.com/openwrt/openwrt.git
|
1 2 3
| cd openwrt-23.05 #打开项目文件夹 ./scripts/feeds update -a #更新包列表 ./scripts/feeds install -a #安装更新包
|
生成完使用以下命令进行编译
1 2
| make download #下载源代码包 make -j$(nproc) V=s #编译
|
如果你是以root用户运行的话请输入下面命令行
但是不建议使用root用户进行编译
1 2
| export FORCE_UNSAFE_CONFIGURE=1
|
引用:
openwrt wiki 编译依赖对应表
https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem