找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 36454|回复: 13

编译padavan(即老毛子)rt-n56u华硕固件简易教程

  [复制链接]
发表于 2016-9-1 20:05 | 显示全部楼层 |阅读模式
本帖最后由 oldcat 于 2016-9-2 08:50 编辑

方法来自


  源安装方法地址有说兼容什么环境和虚拟机的,这里不在多说,我就是虚拟机的ubuntu15.10环境。根据官方说明,2016年8月29升级到了最新的16.04.其实这个木有多大区别!!
     1:首先更新你的系统,接着安装git。
sudo apt-get update   
sudo apt-get install git

    2:下载源代码,这个建议在其他的网盘下载,如国内的百度云下载人家已经提供好的。不然你去国外git,首先要墙壁,还慢的一比比的。。
    cd ~    //注释: 切换到当然用户主目录
//为什么要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 mc autopoint
注意了又,这里因为作者更新了源码却木有更新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好,编译顺利且,一次完成。太棒鸟,编译出来的文件在 /home/hcg/rt-n56u/trunk/images/RT-N56U_3.4.3.9-097.trx


最后: 如果你修改了本地资源需要存储你应该需要做的步骤sudo git stash   //..这个应该是把本地修好好的资源要保存到网络去,不理解我。。菜鸟啊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重新编译tool

  • If 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


评分

参与人数 3恩山币 +3 收起 理由
oxxo + 1 感谢你的分享,无论怎样,你都是最无私的人!来,说说,你E盘上还有啥一起给我吧!
zzcrazy + 1 哎 同样是autopoint 也害死我了 小白头疼了两天呐
iquelite + 1 autopoint 害死我了。

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
发表于 2016-9-1 22:23 | 显示全部楼层
感谢楼主分享,收藏了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-9-1 22:29 | 显示全部楼层
感谢分享,收藏了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-9-1 22:34 | 显示全部楼层

感谢分享,收藏了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-9-2 08:50 来自手机 | 显示全部楼层
不错!!!多谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-9-2 16:37 | 显示全部楼层
前排支持,谢谢
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-9-2 16:38 | 显示全部楼层
怎么添加k2的信息,比如驱动,各种wan口之类的配置文件?

点评

在 trunk、config 里面有型号信息  发表于 2016-9-2 21:51
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-9-18 16:23 来自手机 | 显示全部楼层
感謝說明!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-10-2 09:53 | 显示全部楼层
大大怎么做硬适配
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-11-30 21:32 | 显示全部楼层
网址哥啊,我来学习学习!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-12-8 14:32 | 显示全部楼层
感谢分享 不知道哪里有添加新程序的教程
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-12-8 17:20 | 显示全部楼层
编译./build_toolchain报这个错误要怎么解决
cd /opt/rt-n56u/toolchain-mipsel
./build_toolchain
=====================BUILD-C-HEADERS====================
‘uClibc-0.9.33.2.config’ -> ‘uClibc-0.9.33.2/.config’
make: /home/fig/opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x/bin/mipsel-linux-uclibc-gcc: Command not found
make: Entering directory `/home/fig/opt/rt-n56u/toolchain-mipsel/src/mipsel-linux-uclibc-toolchain/uClibc-0.9.33.2'
/bin/sh: 1: /home/fig/opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x/bin/mipsel-linux-uclibc-gcc: not found
make: /home/fig/opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x/bin/mipsel-linux-uclibc-gcc: Command not found
make: /home/fig/opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x/bin/mipsel-linux-uclibc-gcc: Command not found
  MKDIR include/config
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-27 11:58 | 显示全部楼层
搜索这个型号,看到了一抹一样的帖子
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-23 17:44

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表