系統選用32位的版本,安裝的時候,注意語言不要選中文,不然沒法正常安裝,會報錯:
Unable to install busybox-initramfs
這是存在Ubuntu裏面一個五六年之久的bug,你們都在無腦吹捧開源是多麼多麼好的時候,開源就是這麼任性。html
系統裝好後,默認是沒有SSH服務的,得本身安裝,首先你得把apt源改成國內的源,不然連apt-get update都沒法成功執行(這裏咱們感謝方濱興校長給咱們帶來的各類便利),默認的源直接刪掉,下載我改好的阿里雲的源。
sudo rm /etc/apt/sources.list
python
sudo wget -P /etc/apt/ //hqidi.com/wp-content/uploads/2016/sources.list
sudo apt-get update
sudo apt-get install openssh-server
由於是虛擬機環境,因此直接啓用root,用起來方便,sudo passwd root後回車,輸入兩次密碼就好了。而後修改sshd配置文件,使root能正常遠程登陸。
sudo vi /etc/ssh/sshd_config
找到並用#注 釋掉這行:PermitRootLogin prohibit-password
新建一行 添加:PermitRootLogin yes
sudo service ssh restartgit
vi /etc/network/interface
auto lo
web
iface lo inet loopback
auto ens32
iface ens32 inet static
address 192.168.8.100
netmask 255.255.255.0
gateway 192.168.8.2
dns-nameserver 223.5.5.5
ubuntu
重啓網絡服務 /etc/init.d/networking restart服務器
apt-get install git autoconf automake bison build-essential flex gawk gettext gperf libtool pkg-config zlib1g-dev libgmp3-dev libmpc-dev libmpfr-dev texinfo python-docutils mc autopoint lrzsz -y
這一步耗時大概90秒的樣子。網絡
cd /opt
git clone https://git.oschina.net/gorden5566/rt-n56u.git
這一步耗時稍長,諸位能夠泡一杯板藍根喝。
less
這一步耗時會比較長,諸位打開一個screen進去執行,最保險。同時,能夠泡一杯正山小種。
cd /opt/rt-n56u/toolchain-mipsel
./clean_sources
./build_toolchain
耗時24分鐘
編譯好的工具鏈在 /opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x 目錄,恰好128Mssh
cp /opt/rt-n56u/trunk/configs/templates/n14u_base.config /opt/rt-n56u/trunk/.config
修改/opt/rt-n56u/trunk/.config文件
文件裏寫的很詳細,按需打開和關閉須要的功能。
我主要改了一下幾項
#CONFIG_FIRMWARE_INCLUDE_UVC=y 關閉相機模塊
#CONFIG_FIRMWARE_INCLUDE_LANG_RU=y 關閉俄羅斯語言工具
CONFIG_FIRMWARE_INCLUDE_LANG_UK=y 開啓英語
#CONFIG_FIRMWARE_INCLUDE_LPRD=y 關閉USB打印
#CONFIG_FIRMWARE_INCLUDE_XUPNPD=y 關閉IPVT
編輯 /opt/rt-n56u/trunk/configs/boards/RT-N14U/board.h
/* ASUS RT-N14U */
#define BOARD_PID "RT-N14U"
#define BOARD_NAME "RT-N14U"
#define BOARD_DESC "ASUS RT-N14U Wireless Router"
#define BOARD_VENDOR_NAME "ASUSTek Computer Inc."
#define BOARD_VENDOR_URL "http://www.asus.com/"
#define BOARD_MODEL_URL "http://www.asus.com/Networking/RTN14U/"
#define BOARD_BOOT_TIME 20
#define BOARD_FLASH_TIME 120
#undef BOARD_GPIO_BTN_RESET
#define BOARD_GPIO_BTN_WPS 1
#undef BOARD_GPIO_BTN_WLTOG
#undef BOARD_GPIO_LED_ALL
#define BOARD_GPIO_LED_WIFI 72
#define BOARD_GPIO_LED_POWER 29
#undef BOARD_GPIO_LED_LAN
#define BOARD_GPIO_LED_WAN 44
#define BOARD_GPIO_LED_USB 35
#undef BOARD_GPIO_LED_ROUTER
#undef BOARD_GPIO_PWR_USB
#define BOARD_HAS_5G_11AC 0
#define BOARD_NUM_ANT_5G_TX 0
#define BOARD_NUM_ANT_5G_RX 0
#define BOARD_NUM_ANT_2G_TX 2
#define BOARD_NUM_ANT_2G_RX 2
#define BOARD_NUM_ETH_LEDS 1
#define BOARD_HAS_EPHY_L1000 0
#define BOARD_HAS_EPHY_W1000 0
編輯/opt/rt-n56u/trunk/configs/boards/RT-N14U/kernel-3.4.x.config
在1882行的地方
CONFIG_RAETH_ESW_PORT_WAN=4
CONFIG_RAETH_ESW_PORT_LAN1=1
CONFIG_RAETH_ESW_PORT_LAN2=0
CONFIG_RAETH_ESW_PORT_LAN3=3
CONFIG_RAETH_ESW_PORT_LAN4=2
編輯/opt/rt-n56u/trunk/configs/boards/RT-N14U/kernel-3.4.x.config
// 沒修改前是64M內存
CONFIG_RT2880_DRAM_16M is not set
CONFIG_RT2880_DRAM_32M is not set
CONFIG_RT2880_DRAM_64M=y
CONFIG_RT2880_DRAM_128M is not set
CONFIG_RT2880_DRAM_256M is not set
CONFIG_RALINK_RAM_SIZE=64
// 修改爲128M
CONFIG_RT2880_DRAM_16M is not set
CONFIG_RT2880_DRAM_32M is not set
CONFIG_RT2880_DRAM_64M is not set
CONFIG_RT2880_DRAM_128M=y
CONFIG_RT2880_DRAM_256M is not set
CONFIG_RALINK_RAM_SIZE=128
編輯/opt/rt-n56u/trunk/configs/boards/RT-N14U/kernel-3.4.x.config
刪除# CONFIG_EXTERNAL_PA_EXTERNAL_LNA is not set 這一行代碼,並加入下面的代碼
CONFIG_EXTERNAL_PA_EXTERNAL_LNA=y
編輯/opt/rt-n56u/trunk/user/shared/defaults.h
#ifndef _defaults_h_
#define _defaults_h_
#define SYS_SHELL "/bin/sh"
#define SYS_EXEC_PATH "/usr/sbin:/usr/bin:/sbin:/bin"
#define SYS_EXEC_PATH_OPT "/opt/sbin:/opt/bin:/usr/sbin:/usr/bin:/sbin:/bin"
#define SYS_HOME_PATH_ROOT "/home/admin"
#define SYS_USER_ROOT "admin"
#define SYS_GROUP_ROOT "root"
#define SYS_USER_NOBODY "nobody"
#define SYS_GROUP_NOGROUP "nogroup"
#define DEF_LAN_ADDR "192.168.8.1"
#define DEF_LAN_DHCP_BEG "192.168.8.2"
#define DEF_LAN_DHCP_END "192.168.8.180"
#define DEF_LAN_MASK "255.255.255.0"
#define DEF_WLAN_2G_CC "GB"
#define DEF_WLAN_5G_CC "GB"
#define DEF_WLAN_2G_SSID "ASUS"
#define DEF_WLAN_5G_SSID "ASUS_5G"
#define DEF_WLAN_2G_GSSID "ASUS_GUEST"
#define DEF_WLAN_5G_GSSID "ASUS_GUEST_5G"
#define DEF_WLAN_2G_PSK "1234567890"
#define DEF_WLAN_5G_PSK "1234567890"
#define DEF_ROOT_PASSWORD "admin"
#define DEF_SMB_WORKGROUP "WORKGROUP"
#define DEF_TIMEZONE "CST-8"
#define DEF_NTP_SERVER0 "ntp1.aliyun.com"
#define DEF_NTP_SERVER1 "time.nist.gov"
#define DEF_HTTPS_CIPH_LIST "DH+AESGCM:DH+AES256:DH+AES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!MD5:!DSS"
#endif
這裏面的參數均可以本身改,主要記得改時區和ntp服務器。
編輯/opt/rt-n56u/trunk/user/shared/defaults.c
{"telnetd","0"}.
{"sshd_enable","1"}
1是打開,0是關閉
cd /opt/rt-n56u/trunk
./clear_tree
./build_firmware
用sz命令把編譯好的固件保存到桌面,
sz /opt/rt-n56u/trunk/images/RT-N14U_3.4.3.9-099.trx
刷入後的web界面
PS:
一、在screen裏面,rz sz會報錯 rz waiting to receive,因此要用rz sz的時候,退出screen.
二、像編譯這種純體力活,不建議用本身的筆記本電腦來作,固然,若是你家裏特別冷的話除外。
原創文章,轉載請註明: 轉載自笛聲
本文連接地址: Padavan完整編譯教程