OPENWRT编译

分类: 操作系统

1.换源 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak sudo nano /etc/apt/sources.list 替换 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware 保存 sudo apt update

2. sudo apt update sudo apt install build-essential clang flex g++ gawk gcc-multilib gettext \ git libncurses5-dev libssl-dev python3-distutils rsync unzip zlib1g-dev \ file wget python3 python3-setuptools python3-pyelftools libelf-dev \ quilt swig ecj fastjar java-propose-classpath bash-completion

3. git clone https://github.com/openwrt/openwrt.git cd openwrt

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

4.make menuconfig 在菜单中,你至少需要配置:

Target System: 路由器的处理器架构(如 x86, MediaTek, Qualcomm)。

Subtarget: 具体细分型号。

Target Profile: 具体的路由器型号。

LuCI: 进入 1. Collections -> 勾选 luci(这是 Web 管理界面,必选)。

5. make download -j8

6.

V=s 表示显示详细日志,-j1 表示单线程

make V=s -j1