一、环境准备

编译Openwrt固件需要一台Linux系统的电脑,建议使用Ubuntu系统,本文以Ubuntu 18.04 LTS为例,并假设用户已经安装了必要的软件,如Git、build-essential、libncurses5-dev等。

二、从源码库中获取Openwrt

从Github上获取Openwrt的源码,可以使用以下命令:

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

cd openwrt

三、编译Openwrt固件

进入openwrt目录后,使用以下命令来编译Openwrt固件:

make menuconfig

make defconfig

make download

make V=s

make -j1 V=s

编译完成后,在openwrt/bin/targets/xxx/xxx/下就可以找到编译好的固件。