快速上手编译 OpenWrt

日暮清林
2024-02-02 / 0 评论 / 129 阅读 / 正在检测是否收录...

前言

快速编译 OpenWrt!(演示于 Ubuntu 24.04 LTS 系统)

教程

  1. 安装编译依赖 (可参考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
  2. 拉取源码

    git clone https://git.openwrt.org/openwrt/openwrt.git
  3. 为路由器准备配置文件

    • 拉取并安装所有 feeds 源

    ./scripts/feeds update -a && ./scripts/feeds install -a

    • 打开 GUI 菜单并配置

    make menuconfig

    • 在 GUI 中选择对应的 CPU/SoC 、平台、机型,调整(启用/禁用/替换软件包)
  4. 预下载编译资源

    make -j$(nproc --all) download
  5. 开始编译

    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

评论 (0)

取消