Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
2,729
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. How To Independently Build Firmware For The Routers ASUS RT-N14U/N56U/N65U/N11P/AC51U/AC54U/AC1200HP/N56UB1
  2. Instructions for independently build firmware for your router from source in Ubuntu 16.04 LTS i386.
  3. Install to your PC the Oracle VirtualBox.
  4.  
  5. Download Ubuntu 16.04 LTS i386 (for example, from this mirror).
  6.  
  7. Create new virtual machine and install Ubuntu from step 2 to it. VirtualBox may use a ISO-image as drive in virtual machine.
  8.  
  9. warning.png If you plan to use Ubuntu with the GUI, you must dedicate at least 1.5Gb of RAM for the virtual machine. When you select a smaller size of RAM you may receive errors when you create the image of the firmware.
  10.  
  11. Start your virtual machine and open Terminal on it.
  12.  
  13. Install git:
  14.  
  15. sudo apt-get update
  16. sudo apt-get install git
  17. Go to directory /opt and run command for create the local copy of repository:
  18.  
  19. cd /opt
  20. sudo git clone https://bitbucket.org/padavan/rt-n56u.git
  21. This copies all the source code, creates a local git-repository. Directory /opt/rt-n56u will be the root of the git-repository.
  22.  
  23. Read the document /opt/rt-n56u/readme.eng.txt and install all the required packages that are listed in it:
  24.  
  25. sudo apt-get update
  26. sudo apt-get install autoconf automake autopoint bison build-essential flex gawk gettext git gperf libtool pkg-config zlib1g-dev libgmp3-dev libmpc-dev libmpfr-dev texinfo python-docutils
  27. mc (midnight commander) do not need to build the firmware, but it will help you navigate through directories, copy or edit files.
  28.  
  29. Go to directory with toolchain sources (cross-compiler and tools for building) and build it:
  30.  
  31. cd /opt/rt-n56u/toolchain-mipsel
  32. sudo ./clean_sources
  33. sudo ./build_toolchain
  34. The result will be collected the target of toolchain /opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x
  35.  
  36. If you plan to build the firmware with the kernel 3.0, you must build the appropriate version of tolchain:
  37.  
  38. cd /opt/rt-n56u/toolchain-mipsel
  39. sudo ./clean_sources
  40. sudo ./build_toolchain_3.0.x
  41. The result will be collected the target of toolchain /opt/rt-n56u/toolchain-mipsel/toolchain-3.0.x
  42.  
  43. In the future, you will need these commands only if the toolchain will be updated.
  44.  
  45. Now go to directory with sources:
  46.  
  47. cd /opt/rt-n56u/trunk
  48. and edit file /opt/rt-n56u/trunk/.config to fit your needs.
  49.  
  50. Edit path to toolchain (if you need it):
  51.  
  52. CONFIG_TOOLCHAIN_DIR=/opt/rt-n56u/toolchain-mipsel
  53. To build the firmware, for example, for router RT-N65U uncomment (remove the simbol #) the line:
  54.  
  55. CONFIG_FIRMWARE_PRODUCT_ID="RT-N65U"
  56. and comment the line:
  57.  
  58. #CONFIG_FIRMWARE_PRODUCT_ID="RT-N56U"
  59. Save the file after edit.
  60.  
  61. Clear source tree (every time before a new build)
  62.  
  63. sudo ./clear_tree
  64. Build the firmware:
  65.  
  66. sudo ./build_firmware
  67. Created custom firmware file will be in the directory ./path_to_your_dir/rt-n56u/trunk/images. If you want to save the firmware that you created earlier - copy it to another location, because the command clear_tree overwrites the directory images.
  68.  
  69. When repository updated a local source tree must be updated with command:
  70.  
  71. sudo git pull
  72. If you made ​​any changes to the local repository, when you upgrade tree some files could not be copied. In this case, you must give the command:
  73.  
  74. sudo git stash
  75. sudo git pull
  76. If toolchain sources (cross-compiler and tools for building) is changed you must re-build it:
  77.  
  78. cd /opt/rt-n56u/toolchain-mipsel
  79. sudo ./clean_sources
  80. sudo ./clean_toolchain
  81. sudo ./build_toolchain
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement