固件源码也是来自padavan的。
源安装方法地址有说兼容什么环境和虚拟机的,这里不在多说,我就是虚拟机的ubuntu15.10环境。根据官方说明,8月29升级到了最新的16.04.其实这个木有多大区别!!
1:首先更新你的系统,接着安装git。
sudo apt-get update
sudo apt-get install git
2:下载源代码,这个建议在其他的网盘下载,如国内的百度云下载人家已经提供好的。不然你去国外git,首先要墙壁,还慢的一比比的。。
cd ~ //注释: 切换到5然用户主目录
sudo git clone /padavan/rt-n56u.git//为什么要sudo呢,它原来的放在opt目录下的,当前非root用户是无法访问/opt的,这里我已经当前用户主目录来存放源码,不知道会不会不行,暂时不管那么多。
注意了这里,官方教程默认是使用/opt作为源码主目录的,如无需特别要求请根据官方一致!!!
3: 根据你下载的源码的readme,安装支持组件
sudo apt-get install build-essential gawk pkg-config gettext automake autoconf libtool bison flex zlib1g-dev libgmp3-dev libmpfr-dev libmpc-dev texinfo mcautopoint
注意了又,这里因为作者更新了源码却木有更新wiki说明,所以会在编译的时候会报个错误提示。如图:请根据错误提示自行安装 autopoint组件支持 ,恩,我已经添加在上面了。。
4:切换到tool工作目录,编译tool
4-1:如果你是和我一样download源码在自己用户名的目录下,请自行建立超链接到/opt
ln -s ~/rt-n56u/ /opt/rt-n56u/
cd /opt/rt-n56u/
sudo ./clean_sources
sudo ./build_toolchain
The result will be collected the target of toolchain /opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x
If you plan to build the firmware with the kernel 3.0, you must build the appropriate version of tolchain: //这里有说你需要编译什么版本内核就使用什么文件去编译
cd /opt/rt-n56u/toolchain-mipsel
sudo ./clean_sources
sudo ./build_toolchain_3.0.x
The result will be collected the target of toolchain /opt/rt-n56u/toolchain-mipsel/toolchain-3.0.x
In the future, you will need these commands only if the toolchain will be updated.//还提到未来会有更多升级。
我这个需要更具你路由器的型号来编译交叉编译工具。默认./build_toolchain即可,默认是选择为./3.4.x的,为3.0.x应该是为专门的路由器固件支持的。这个具体可以看下面的图片的配置文件,如果哪个配置文件是需要3.0.x的则需要编译它。
sudo./build_toolchain
编译进行中。。。。
tool编译完毕
5:如何修改你需要编译的机型。
开始的图片有部分机型的配置文件,可以复制~/rt-n56u/trunk/configs/templates里面“机型.config”改名为.config丢在~/rt-n56u/trunk/里面即可。(.config是隐藏的可以用ctrl+h显示因此文件)
5-1:进入资源目录
cd ~/rt-n56u/trunk/
and edit file ~/rt-n56u/trunk/.config to fit your needs.
too build the firmware, for example, for router RT-N65U uncomment (remove the simbol #) the line:
CONFIG_FIRMWARE_PRODUCT_ID="RT-N65U" //这里让取消注释#并输入需要的ID,例子是以RT-N65U
然后保存即可。
为了,更加直观且简单,我用的是winscp修改的,当然也可以使用ubuntu里面的gpedit或者支持vim修改都不是问题。效果达到即可
这里经过测试,不能填写~,而是必须绝对路径,我的是/home/hcg/ 不然下面的编译会报错的
6: 每次进行新的编译都需要处理的步骤
cd /opt/rt--n56u/trunk/
sudo ./clear_tree
7:正式编译固件了。
sudo ./build_firmware好,编译顺利且,一次完成。太棒鸟,编译出来的文件r/home/hcg/rt-n56u/trunk/images/RT-N56U_3.4.3.9-097.trx
最后: 如果你修改了本地资源需要存储你应该需要做的步骤sudo git stash //..这f应该是把本地修好好的资源要保存到网络去,不理解我。。菜鸟啊
sudo git pull //这个是更新网络源代码。假如你需要编译不同的内核版本,那么你需要重新编译tool也就文章提到的3.0 3.4 恩。这里我有点不明白,默认编译的就是3.4的内核,only linux-3.0.x for "RT-N65U" target yet应该是只有rt-n65u的才需要3.0的内核,所以。我也不是很明白。。附::清理tool重新编译toolIf toolchain sources (cross-compiler and tools for building) is changed you must re-build it:
cd /opt/rt-n56u/toolchain-mipsel
sudo ./clean_sources
sudo ./clean_toolchain
sudo ./build_toolchain
如果觉得《郴州华硕服务器维修 如何编译padavan路由器rt-n56u华硕(即老毛子)固件》对你有帮助,请点赞、收藏,并留下你的观点哦!