Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
zh:docs:guide-developer:quickstart-build-images [2017/07/25 03:18] liangjiazh:docs:guide-developer:quickstart-build-images [2020/01/05 09:57] – 同步英文版本更新 lujimmy
Line 1: Line 1:
-====== 敏捷编译指引 ======+====== 固件构建快速入门 ====== 
 +这是一个关于如何构建您自己第一个**快照版**OpenWrt固件的简短指南,如果您想编译一个**稳定版**使用[[docs:guide-user:additional-software:beginners-build-guide|构建自己固件的入门指南]]作为指南。 
 +它没有掩饰任何陷阱,但如果一切顺利,提供了一个快速的方法。实现相同目标的替代指南有: 
 +[[docs:guide-user:additional-software:imagebuilder|使用Image Builder]], 
 +[[docs:guide-user:additional-software:beginners-build-guide|构建自己固件的入门指南]]。
  
-This is a very short guide on how to compile your first firmware. 
-It does not cover any pitfalls, but provides a quick way if everything goes well. 
  
-First we need to make sure the dependencies are installed (for Debian/Ubuntu):+{{page>releases:snapshot&noheader&nofooter&noeditbtn&firstseconly}}
  
 +首先,我们需要确认所有的依赖软件已安装。下面以Debian/Ubuntu为例:
 <code> <code>
 sudo apt-get install subversion g++ zlib1g-dev build-essential git python rsync man-db 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+sudo apt-get install libncurses5-dev gawk gettext unzip file libssl-dev wget zip time
 </code> </code>
- +接下来,使用以下命名获OpenWrt的源代码
-取 LEDE 源代码命令: +
 <code> <code>
-git clone https://git.lede-project.org/source.git lede +git clone https://git.openwrt.org/openwrt/openwrt.git/ 
-cd lede+cd openwrt
  
 ./scripts/feeds update -a ./scripts/feeds update -a
 ./scripts/feeds install -a ./scripts/feeds install -a
  
-make defconfig 
 make menuconfig make menuconfig
 </code> </code>
- +最后一个命令将打开一个菜单,如果您想为"TL-WR841N v11"这款无线路由构建固件,您可以这样设置:
-The last command will open a menu. +
- +
-If you want to build images for the "TL-WR841N v11" Wifi-Router, select:+
  
   * "Target System" => "Atheros AR7xxx/AR9xxx"   * "Target System" => "Atheros AR7xxx/AR9xxx"
   * "Target Profile" => "TP-LINK TL-WR841N/ND v11"   * "Target Profile" => "TP-LINK TL-WR841N/ND v11"
  
-Select exit and save your settings. +然后选择退出并保存设置。现在我们就可以开始使用以下命令构建固件了,该过程将持续一段时间:
-Now build images. That may take some time:+
  
 <code> <code>
Line 38: Line 34:
 </code> </code>
  
-Afterwards, the images can be found in ./bin/targets/ar71xx/generic/ - done. 8-) +完成以后,固件可以在目录 ./bin/targets/ar71xx/generic/ 中找到。 
- +  * 以 *-factory.bin 命名的固件是用于首次安装。 
-The *-factory.bin images are for the first installation. +  * 以 *-sysupgrade.bin 命名的固件是用于更新已安装的OpenWrt。
-The *-sysupgrade.bin images are for the updating existing LEDE installations. +
- +
-注意: +
- +
-  * For recompiling the images, just execute make again. +
-  * This will now be much faster as well. +
-  * Change settings with //make menuconfig// and compile again. +
-  * Files placed into a directory called files, will be placed into the root file system of the images. E.g. files/etc/config/my_config.+
  
 +备注:
 +  * 如需重新编译固件,再次执行''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'' 目录在您的构建系统中不存在,手动创建即可。
  • Last modified: 2021/10/15 08:27
  • by bobafetthotmail