After the brief description of OpenWrt system in the previous article
OpenWrt
we describe now how to build the firmware for our router.
We use as tartget device the TP-Link TL-MR3420 router version 1.
This model is in the list of the supported OpenWrt devices; here is the specific documentation for this device
TP-Link TL-MR3420
From the documentation we know that the SOC is an Atheros AR7241. This information will be used in the configruation phase of the buildin envinronment. As a preliminary operation also download the original firmware of this router from the link
Original Firmware
In the page TP-Link TL-MR3420 we find the links to two differents versions of the OpenWrt firmware:
- Firmware used to install OpenWrt: openwrt-15.05.1-ar71xx-generic-tl-mr3420-v1-squashfs-factory.bin.
- Firmware used to update OpenWrt: openwrt-15.05.1-ar71xx-generic-tl-mr3420-v1-squashfs-sysupgrade.bin
If we have the original firmware in our device we must utilize the first one, while in the case of updates we use the second one..
We now execute the operation described in the link
OpenWrt Building
in the Debian envinronment installed in previous article
Debian Envinronment
In a shell command window we install the prerequisites as non root user (sviluppo in our case)
|
sudo apt-get install git-core sudo apt-get install build-essential sudo apt-get install libssl-dev sudo apt-get install libncurses5-dev sudo apt-get install unzip sudo apt-get install gawk sudo apt-get install subversion sudo apt-get install mercurial |
We create a folder OpenWrt under the home user folder (sviluppo in our case) and clone the repository. In this build we choose the stable branch 15.05
|
mkdir OpenWrt cd OpenWrt git clone https://git.openwrt.org/15.05/openwrt.git 15.05 |
At the end of the git task, execute
|
cd 15.05 ./scripts/feeds update -a ./scripts/feeds install -a |
We are now ready to build the firmware of the TP-Link TL-MR3420 V1.
Execute the command
and we choose as target Target System AR7xxx/AR9xxx as described in the following screenshotsWith the following choices we change the options
- y: we buil it.
- m: we build it as module.
- n: we skip it.
At the following link
OpenWrt Building
we find all the documentation about the building.
In the Target System with enter we can choose our Target PlatformWe have to install the base packages to admin the system, so we access LuCI Optionthen Collectionsand at the end the luci package; with this option the system installs an http server tooWe choose as modules some cryptographics packages in the kernel modules sectionsthen Cryptographic Api modulesand at the end the following modules merged into the firmware fileYou should save the configuration in a file in order to use it again later. Finally save the configuration in the .config file.
We can now exit the menuconfig and execute the following command in the shell command window
This task checks for the prerequisites.
To build the firmware we execute
in verbose mode.
At the end of the task we can find the firmware in the atheros platform under the bin folder. In our case our images are highlighted in the following screenshotWe can now flash the firmware.
WARNING: Before installing the firmware verify the recovery process of your router in the event of a problem, i.e how to start in recovery mode, flash via tftp, use JTAG, etc. The image installation on the device is at your own risk. We accept no responsibility if the installation leads to malfunction or block of the device.
The OpenWrt web site describes all the vaious options to build the firmware and packages. In the next article
Building OpenWrt package
we’ll describe how to build and install from a shell window command the vsftpd package.