固件构建快速入门

这是一个关于如何构建您自己第一个快照版OpenWrt固件的简短指南,如果您想编译一个稳定版使用构建自己固件的入门指南作为指南。 它没有掩饰任何陷阱,但如果一切顺利,提供了一个快速的方法。实现相同目标的替代指南有: 使用Image Builder构建自己固件的入门指南

The development branch can contain experimental code that is under active development and should not be used for production environments. Snapshot images may support additional hardware; however, it is experimental, considered unstable, and sometimes won't compile.

Prebuilt snapshot images do not come with any web interface or GUI. You will need to be comfortable using a command line and remote shell to install one yourself → See How to install LuCI and Use SSH to connect to the internet and install Luci Web interface

→ Read more...

首先,我们需要确认所有的依赖软件已安装。下面以Debian/Ubuntu为例:

sudo apt-get install subversion g++ zlib1g-dev build-essential git python rsync man-db
sudo apt-get install libncurses5-dev gawk gettext unzip file libssl-dev wget zip time

接下来,使用以下命令获取OpenWrt的源代码:

git clone https://git.openwrt.org/openwrt/openwrt.git/
cd openwrt

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

make menuconfig

最后一个命令将打开一个菜单,如果您想为“TL-WR841N v11”这款无线路由构建固件,您可以这样设置:

然后选择退出并保存设置。现在我们就可以开始使用以下命令构建固件了,该过程将持续一段时间:

make

完成以后,固件可以在目录 ./bin/targets/ar71xx/generic/ 中找到。

备注: