Configure the build Environment install virtual machine install Ubuntu 16.04LTS install git
1 2
|
sudo apt- sudo apt-get install git
|
Go to
/opt
Directories, and cloning Padavan warehouses with commands
1 2
|
Cd/opt Https://bitbucket.org/padavan/rt-n56u.git
|
Install the tools needed to compile the firmware
1
|
sudo apt-get install autoconf automake Bison build-essential Flex gawk gettext gperf libtool pkg-config zlib1g-D EV libgmp3-dev libmpc-dev libmpfr-Dev texinfo python-docutils MC
|
Compiling a cross-compiled tool chain
1 2 3
|
CD/Opt/rt-n56u/toolchain-mipsel sudo./clean_sources sudo./build_toolchain
|
Compiling firmware for the 3.0 kernel
If you need to compile firmware for the 3.0 kernel, you need to perform the following steps, which support the 3.4 kernel by default
1 2 3
|
CD/Opt/rt-n56u/toolchain-mipsel sudo./clean_sources sudo./build_toolchain_3. 0.x
|
The compiled tool chain is placed in the/opt/rt-n56u/toolchain-mipsel/toolchain-3.0.x
You will need to perform the above steps later in the case of updating or upgrading the toolchain.
Model adaptation (Newifi mini) into the firmware source directory
Build configuration file
1 2 3 4 5 6 7 |
The. config file under Opt/rt-n56u/trunk, which is hidden by default, can be used to display and hide the configuration file using Ctrl+h (or delete it with the following command)
Opt/rt-n56u/trunk and rename it to. config (or operate with the following command)
Opt/rt-n56u/trunk/configs/templates/ac54_base.config/Opt/rt-n56u/trunk/.config
|
Modifying a configuration file
As a result of the changes in the default. config file in the document written in very detailed, not much explanation, according to their needs to open and close the need and unnecessary features, #
the symbol is the default comment code, that is, to turn off a function, or vice versa is open (you can copy the contents of the document into the translation of the translation again, Can clearly see what each function is for.
Adapter Light and Reset key
Modify a file/opt/rt-56u/trunk/configs/boards/RT-AC54U/board.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
/* ASUS rt-ac54u */
#define Board_pid"Rt-ac54u" #define Board_name"Rt-ac54u" #define Board_desc"ASUS rt-ac54u 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/RTAC54U/" #define Board_boot_time25 #define Board_flash_time120 #undef Board_gpio_btn_reset #define Board_gpio_btn_wps11 #undef Board_gpio_btn_wltog #undef Board_gpio_led_all #define Board_gpio_led_wifi72 #undef board_gpio_led_sw2g #define BOARD_GPIO_LED_SW5G50 #define Board_gpio_led_power9 #define Board_gpio_led_lan55 #define Board_gpio_led_wan51 #define Board_gpio_led_usb52 #undef Board_gpio_led_router #undef BOARD_GPIO_PWR_USB #define BOARD_HAS_5G_11AC1 #define BOARD_NUM_ANT_5G_TX2 #define BOARD_NUM_ANT_5G_RX2 #define BOARD_NUM_ANT_2G_TX2 #define BOARD_NUM_ANT_2G_RX2 #define BOARD_NUM_ETH_LEDS1 #define BOARD_HAS_EPHY_L10000 #define BOARD_HAS_EPHY_W10000
Above is Newifi Mini, because each model is different, for reference only
|
Suitable for WAN ports and LAN ports
Modify a file/opt/rt-56u/trunk/configs/boards/RT-AC54U/kernel-3.4.x.config
1 2 3 4 5 6 7
|
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
Above is Newifi Mini, because each model is different, for reference only
|
Open external Pa&lan support
/opt/rt-56u/trunk/configs/boards/RT-AC54U/kernel-3.4.x.config
Delete # CONFIG_EXTERNAL_PA_EXTERNAL_LNA is not set
This line of code in, and add the following code
1
|
Config_external_pa_external_lna=y
|
Extended memory
To modify the /opt/rt-56u/trunk/configs/boards/RT-AC54U/kernel-3.4.x.config
configuration file, take ac-54u as an example, the default is 64M, so you just need to change the following code as follows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
64M of memory before modification config_rt2880_dram_16mIsNotSet config_rt2880_dram_32mIsNotSet Config_rt2880_dram_64m=y config_rt2880_dram_128mIsNotSet config_rt2880_dram_256mIsnot set config_ralink_ram_size= 64 //modified to 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 |
Setting the time zone
Modify/opt/rt-56u/trunk/user/shared/defaults.h
1 2
|
#define Def_timezone"CST-8" #define DEF_NTP_SERVER0"ntp1.aliyun.com"
|
Generate firmware purge source tree
Start compiling the build firmware
Firmware generated after compilation is in the /opt/rt-56u/trunk/images
inside
Update source
Go to /opt
directory, clone the latest source
If you make changes to the local storage repository, you must run the following command when updating the source code
1 2
|
sudo git stash sudo git pull
|
If you change the toolchain, you must rebuild it
1 2 3 4
|
CD/Opt/rt-n56u/toolchain-mipsel sudo./clean_sources sudo./clean_toolchain sudo./build_toolchain
|
The above changes are recommended to use manual modification, if the direct use of files to overwrite, it is easy to error. and a compilation error, it takes a lot of time to adjust, so you can slowly change your own step by step.
For more information, please refer to the Padavan website compiling tutorial
Padavan Compiling tutorials