Setting up an OpenWrt build environment

Setting up an OpenWrt build environment for the TP-Link Archer A7 and deploying a custom firmware involves several steps. Below is a detailed guide to achieve this:


1. Prepare Your System

Ensure your build environment has the required tools and dependencies.

For Debian/Ubuntu:

sudo apt update && sudo apt upgrade -y
sudo apt install build-essential libncurses5-dev gawk git gettext unzip zlib1g-dev file libssl-dev wget python3

1.5. Install a Python virtual Enviornment


2. Clone the OpenWrt Source Code

Clone the OpenWrt repository:

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt

git fetch --all
git checkout v23.05.0

3. Install and Update Feeds

The package feeds must be updated and installed before building.

./scripts/feeds update -a
./scripts/feeds install -a

4. Configure the Build System

Select the Archer A7 Target

  1. Open the configuration menu:
    make menuconfig
  2. Select the following options:
    • Target System: Atheros ATH79
    • Subtarget: Generic
    • Target Profile: TP-Link Archer A7 v5
  3. Customize additional options:
    • Add/remove specific packages or kernel modules as needed.
    • Save your configuration and exit.

5. Build the Firmware

Start the build process:

make -j$(nproc)
  • Replace $(nproc) with the number of CPU cores available for faster builds.

If any errors occur, check for missing dependencies or misconfigurations.


6. Locate the Built Firmware

After the build completes successfully, the firmware file for the Archer A7 will be in:

bin/targets/ipq40xx/generic/

Look for a file like:

openwrt-ipq40xx-generic-tplink_archer-a7-v5-squashfs-factory.bin

7. Flash the Firmware on the Archer A7

Option 1: Flash via Web Interface

  1. Access the Router’s Web Interface:
  2. Upload Firmware:
    • Go to the Firmware Upgrade section.
    • Upload the factory.bin file you built.
  3. Wait for the Flash Process:
    • The router will reboot automatically.

Option 2: Flash via TFTP

This method is useful if the router doesn’t allow a web upgrade.

  1. Set Up a TFTP Server:
    • Install a TFTP server on your PC:
      sudo apt install tftp-hpa
    • Place the firmware file in the TFTP root directory (e.g., /srv/tftp/).
  2. Prepare the Router:
    • Set a static IP for your PC (e.g., 192.168.0.66).
    • Turn off the router, then hold the Reset button while turning it back on.
  3. Upload Firmware:
    • The router will automatically request the firmware file and flash it.

8. Verify the Installation

  1. After flashing, connect to the router.
  2. Access OpenWrt via SSH:
    ssh root@192.168.1.1
  3. Test the basic functionalities and ensure your custom changes are applied.

Optional: Backup and Restore

Before flashing, back up the current configuration:

scp root@192.168.1.1:/etc/config /path/to/backup/

After flashing, restore if necessary:

scp /path/to/backup/* root@192.168.1.1:/etc/config/

Scroll to Top