Ubuntu x64 编译 Padavan 过程&教程
![](https://devpress.csdnimg.cn/6deffb34f7114cc1a2e1e686a67e0027.png)
Ubuntu x64 编译 Padavan 记录
近 3 个通宵尝试用 Mac OS X 进行编译,1 个通宵解决交叉编译工具链 toolchain 问题,后两个通宵执着于固件编译,随后放弃。解决了 Linux Kernel,在 uClibc 那里我知道我没法继续了。实在受不了,中途居然还因为 Mac 上文件不区分大小写少文件。装 Genymotion 的时候正好有 VBox,顺手下载了 Ubuntu Desktop 16 装上,吐血。下文为编译过程…
先更新系统是有必要的
sudo apt-get update sudo apt-get upgrade
安装必需的组件
首先是 git
sudo apt-get install git
其他组件(mc 可选,我并没有安装)
sudo apt-get install build-essential gawk pkg-config gettext automake autoconf libtool bison flex zlib1g-dev libgmp3-dev libmpfr-dev libmpc-dev texinfo python-docutils autopoint
交叉编译工具链
建议在
/opt
目录下操作
移动到/opt
目录,cd /opt
获取源码:sudo git clone https://bitbucket.org/padavan/rt-n56u.git
下载近 900M,耐心等待…联通 50M 表示下载速度还可以,约 1-4M/scd toolchain-mipsel sudo ./clean_sources sudo ./build_toolchain
耐心等待约 5-10 分钟…无视掉中途无数的警告
修改固件配置
只写出了简单的配置,详细请浏览国内“恩山论坛”和 Google 爬坑
换个位置
cd ../trunk
从/opt/rt-n56u/trunk/configs/templates
目录下复制一份适配的配置文件到/opt/rt-n56u/trunk
内
删除trunk
内的.config
文件并重命名刚刚复制的配置文件为.config
操作如下:
sudo rm -f .config cd /opt/rt-n56u/trunk/configs/templates # xxx.config 为你需要的配置文件 sudo cp ./xxx.config ../../.config # 返回 trunk 目录修改 .config 文件 cd ../../
可用 vim | nano 等命令行编辑器修改内容
由于我使用的 Ubuntu 桌面版,有图形编辑器,所以就用 gedit 了
sudo gedit .config
配置好需要的功能,编辑完成后 Ctrl + S 保存即可
先清理一下sudo ./clear_tree
【同样涉及交叉编译,所以耐心等待约 8 - 20 分钟】
sudo ./build_firmware
完成后提示如下:
#=========================================== # Pack final image and write headers # For No padded, need write kernel size in image header # to correct mount partition in mtd drivers address img file: /opt/rt-n56u/trunk/images/XX-XXXXX_version.trx Product ID: XX-XXXXX Created: Wed Dec 28 05:26:51 2016 Image Type: MIPS Linux Kernel Image (lzma compressed) Data Size: 5223551 Bytes = 5101.12 kB = 4.98 MB Load Address: 0x80000000 Entry Point: 0x802705A0 Kernel Size: 0x00104460 Kernel Ver.: 3.4 FS Ver.: 3.9 make[2]: Leaving directory '/opt/rt-n56u/trunk/vendors/Ralink/MT7620' make[1]: Leaving directory '/opt/rt-n56u/trunk/vendors'
在
/opt/rt-n56u/trunk/images
目录下得到*.trx
文件
如果路由器已有 U-Boot 或 breed 这等神器,刷入他…完毕
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
A beautiful web dashboard for Linux
最近提交
(Master分支:19 天前 )
186a802e
added ecosystem file for PM2
4 年前
5def40a3
Add host customization support for the NodeJS version
4 年前
所有评论(0)