推荐环境: Ubuntu 16 / Ubuntu 18 / wsl (Ubuntu 18) / Debian 9 / Arch Linux
[title]安装依赖包[/title]
对于deb系 (debian/ubuntu):
apt-get update
apt-get install unzip libtool curl cmake gperf gawk flex bison nano \
git python-docutils gettext automake autopoint texinfo build-essential libtool-bin \
pkg-config zlib1g-dev libgmp3-dev libmpc-dev libmpfr-dev libncurses5-dev libltdl-dev
apt-get install unzip libtool curl cmake gperf gawk flex bison nano \
git python-docutils gettext automake autopoint texinfo build-essential libtool-bin \
pkg-config zlib1g-dev libgmp3-dev libmpc-dev libmpfr-dev libncurses5-dev libltdl-dev
[title]克隆源码[/title]
git clone --depth=1 https://gitee.com/hanwckf/rt-n56u.git /opt/rt-n56u
[title]编译工具链 (仅需编译一次!)[/title]
cd /opt/rt-n56u/toolchain-mipsel
./clean_sources
./build_toolchain_3.4.x
./clean_sources
./build_toolchain_3.4.x
[title]#修改机型storage大小,本文以NEWIFI3为例[/title]
nano /opt/rt-n56u/trunk/configs/boards/NEWIFI3/kernel-3.4.x.config
按ctrl+w 搜索CONFIG_MTD_STORE_PART_SIZ
等号后面改为0x600000
变成
CONFIG_MTD_STORE_PART_SIZ=0x600000
按ctrl+o保存退出;
等号后面改为0x600000
变成
CONFIG_MTD_STORE_PART_SIZ=0x600000
按ctrl+o保存退出;
[title]继续修改mtd_storage.sh[/title]
nano /opt/rt-n56u/trunk/user/scripts/mtd_storage.sh
ctrl+w 搜索mtd_part_size
改为6291456
变成
mtd_part_size=6291456
ctrl+o保存退出;
改为6291456
变成
mtd_part_size=6291456
ctrl+o保存退出;
[title]修改机型配置文件,不需要的插件选择no[/title]
nano /opt/rt-n56u/trunk/configs/templates/NEWIFI3.config
如果需要启用或者关闭某项功能,就将对应的项目赋值成y或者n,或者在其前面加上#
注释符,每个项目的具体说明请参考README.md,
[title]进入 trunk/user/shared 修改defaults.h[/title]
有后台账号密码与默认ip,默认wifi名等等
无线地区,改为CN
#define DEF_WLAN_2G_CC "GB"
#define DEF_WLAN_5G_CC "GB"
时区,改为CST-8
#define DEF_TIMEZONE "GMT0"
网络时间校准,改为ntp1.aliyun.com
#define DEF_NTP_SERVER0 "pool.ntp.org"
[title]telnet和ssh开关[/title]
修改defaults.c
找到如下代码,telnet和ssh开关,0为关,1为开
{ "telnetd", "0" },
{ "sshd_enable", "1" },
[title]清理代码树并开始编译[/title]
cd /opt/rt-n56u/trunk
./clear_tree
./build_firmware_modify NEWIFI3
./clear_tree
./build_firmware_modify NEWIFI3
脚本第一个参数为路由型号,当前支持的所有型号在trunk/configs/templates/里面
文章评论