前言
快速编译 OpenWrt!(演示于 Ubuntu 24.04 LTS 系统)
教程
安装编译依赖 (可参考OpenWrt Wiki)
sudo apt update && sudo apt install build-essential ccache ecj fastjar file g++ gawk gettext git java-propose-classpath libelf-dev libncurses5-dev libncursesw5-dev libssl-dev python-is-python3 python3 unzip wget python3-distutils python3-setuptools python3-dev rsync subversion swig time xsltproc zlib1g-dev拉取源码
git clone https://git.openwrt.org/openwrt/openwrt.git为路由器准备配置文件
- 拉取并安装所有 feeds 源
./scripts/feeds update -a && ./scripts/feeds install -a- 打开 GUI 菜单并配置
make menuconfig- 在 GUI 中选择对应的 CPU/SoC 、平台、机型,调整(启用/禁用/替换软件包)
预下载编译资源
make -j$(nproc --all) download开始编译
make -j$(nproc --all)等待编译完成即可。编译产物可在
./bin/内获取。
报错解决
错误:
find: The relative path '~/.local/bin' is included in the PATH environment variable, which is insecure in combination with the -execdir action of find. Please remove that entry from $PATH解决方案:
在PATH中移除:~/.local/bin' 等变量,同时确保 PATH 中不包含空格、Windows 系统下路径。
评论 (0)