This translation is older than the original page and might be outdated. See what has changed.


这是一个关于如何构建您自己第一个快照版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

→


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


git clone
cd openwrt

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

make menuconfig

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

  • “Target System” ⇒ “Atheros AR7xxx/AR9xxx”
  • “Target Profile” ⇒ “TP-LINK TL-WR841N/ND v11



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

  • 以 *-factory.bin 命名的固件是用于首次安装。
  • 以 *-sysupgrade.bin 命名的固件是用于更新已安装的OpenWrt。


  • 如需重新编译固件,再次执行make命令。
  • 如需快速编译,可使用make -j N命令, 其中N为CPU内核数+1。请注意,此方法在编译期间容易出错。如果遇到编译错误,你的第一步是在没有-j N的情况下再次编译. 建议在并行编译之前使用make download命令以防止出现这些错误(对于那些拥有更快Internet连接的用户来说,使用-jN命令在下载环节通常可以更安全)
  • 使用 make menuconfig 命令可以更改设置并再次编译。
  • 您可以将固件中的自定义文件放入目录<buildroot>/files。例如,您想将my_config在固件的/etc/config/目录中,则对应路径为<buildroot>/files/etc/config/my_config。如果files 目录在您的构建系统中不存在,手动创建即可。
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2020/01/05 09:57
  • by lujimmy