How to Build FriendlyWrt (2023)

1Introduction to FriendlyWrt

FriendlyWrt is a customized OpenWrt system developed by FriendlyElec. It is open source and suitable for applications in IoT, NAS and etc.

2User Name & Password

No password set default, please configure a root password to protect the web interface and enable SSH.

3Supported FriendlyElec Boards

OSVersionSupported Board TypesImage FileDownload Link
FriendlyWrt for H319.07.1NanoPi-R1S, NanoPi-R1, NanoPi-NEO, NanoPi-NEO-Air,
NanoPi-M1, ZeroPi, NanoPi-NEO-S,
NanoPi-NEO-Core, NanoPi-M1-Plus, NanoPi-Duo2

H3 Download Link

FriendlyWrt for H519.07-snapshotNanoPi-NEO2,NanoPi-K1-Plus,

H5 Download Link

FriendlyWrt for S5P441819.07-snapshotNanoPi-Fire2A, NanoPC-T2, NanoPi-S2,
NanoPi-M2A, Smart4418

S5P4418 Download Link

FriendlyWrt for S5P681819.07-snapshotNanoPi-Fire3, NanoPC-T3,

S5P6818 Download Link

FriendlyWrt for RK3399 (1/2)21.02.5 with rockchip kernel-4.19All FriendlyElec's RK3399 based boards, including NanoPi-M4v2, NanoPi-M4B,

RK3399 Download Link

FriendlyWrt for RK3399 (2/2)21.02.5 / 22.03.2 with mainline kernel-5.15NanoPi-R4S, NanoPi-R4SE, NanoPC-T4, NanoPC-M4v1,

RK3399 Download Link

FriendlyWrt for RK332821.02.5 / 22.03.2NanoPi-R2S, NanoPi-R2C,

RK3328 Download Lin

FriendlyWrt for RK356821.02.5 /

RK3568 download link

FriendlyWrt for RK358821.02.5 /

RK3588 download link

How to test the image: extract the image file, use the "dd" command under Linux or the win32image utility under Windows to flash the image to an SD card.

4Get Source Code

4.1Install repo

Firstly you need to install the repo utility:

git clone --depth 1sudo cp repo/repo /usr/bin/

4.2Download Source Code

There are two ways to obtain the source code. For mainland Chinese users the first is recommended:

4.2.1One: Use Repo Package from FriendlyElec's Cloud Storage

The source files are located at the "sources/friendlywrt-CPU-YYYYMMDD.tar" directory in FriendlyElec's cloud storage. "CPU" stands for an SoC model and YYYYMMDD stands for date(the year, month and day) in which the package is packed.
After you get a repo package run the following command to extract it. Let's take an image for Allwinner H3 based boards as an example:

tar xvf /path/to/netdisk/sources/friendlywrt-h3-20190101.tarcd friendlywrt-h3repo sync -l --no-clone-bundle

Now you have had the full source code for generating an image. The last number digits in the file name stand for the packing date. If you want to obtain the latest official release, remove "-l" and do "repo sync" again:

cd friendlywrt-h3repo sync --no-clone-bundle

4.2.2Two: Get Source Code from Github Based Boards
mkdir friendlywrt-h3cd friendlywrt-h3repo init -u -b master-v19.07.1 -m h3.xml --repo-url= --no-clone-bundlerepo sync -c --no-clone-bundle Based Boards
mkdir friendlywrt-h5cd friendlywrt-h5repo init -u -b master \ -m h5.xml --repo-url= --no-clone-bundlerepo sync -c --no-clone-bundle Based Boards
mkdir friendlywrt-s5p4418cd friendlywrt-s5p4418repo init -u -b master \ -m s5p4418.xml --repo-url= --no-clone-bundlerepo sync -c --no-clone-bundle Based Boards
mkdir friendlywrt-s5p6818cd friendlywrt-s5p6818repo init -u -b master \ -m s5p6818.xml --repo-url= --no-clone-bundlerepo sync -c --no-clone-bundle Based Boards
  • FriendlyWrt with Rockchip kernel-4.19

For NanoPi-M4, NanoPC-T4, NanoPi-NEO4, Som-RK3399:

mkdir friendlywrt-rk3399cd friendlywrt-rk3399repo init -u -b master-v21.02 \ -m rk3399-kernel4.19.xml --repo-url= --no-clone-bundlerepo sync -c --no-clone-bundle
  • FriendlyWrt with Mainline kernel-5.10

For NanoPi-R4S/NanoPi-R4SE:

mkdir friendlywrt21-rk3399cd friendlywrt21-rk3399git clone --depth 1 toolstools/repo init -u -b master-v21.02 \ -m rk3399.xml --repo-url= --no-clone-bundletools/repo sync -c --no-clone-bundle
(Video) NanoPi - R2S - FriendlyWRT - Wireless Router Based Boards
mkdir friendlywrt21-rk3328cd friendlywrt21-rk3328git clone --depth 1 toolstools/repo init -u -b master-v21.02 \ -m rk3328.xml --repo-url= --no-clone-bundletools/repo sync -c --no-clone-bundle Based Boards
mkdir friendlywrt21-rk3568cd friendlywrt21-rk3568git clone --depth 1 toolstools/repo init -u -b master-v21.02 \ -m rk3568.xml --repo-url= --no-clone-bundletools/repo sync -c --no-clone-bundle Based Boards
mkdir friendlywrt21-rk3588cd friendlywrt21-rk3588git clone --depth 1 toolstools/repo init -u -b master-v21.02 \ -m rk3588.xml --repo-url= --no-clone-bundletools/repo sync -c --no-clone-bundle

4.2.3Get Latest Release With "Sync"

repo sync -c --no-clone-bundle

If synchronization is interrupted you can run the following script to do sync again:

#! /bin/bashrepo sync -c --no-clone-bundlewhile [ $? -ne 0 ]; do repo sync -c --no-clone-bundledone

4.2.4Swtich To Different Platform

If you have been working on the source code for Allwinner H3's boards and want to swtich to the source code for Allwinner H5's boards you can do it this way:

cp -af friendlywrt-h3 friendlywrt-h5cd friendlywrt-h5repo init -m h5.xmlrepo sync --force-sync

5Compile Source Code

5.1Setup Development Environment

You need a host PC running a 64-bit Ubuntu 18.04 system and run the following command on the PC:

wget -O - | bash

5.2Build buildroot in Docker container

Please use the Docker image provided by this link, for details, please refer to the README document:

5.3Get Help Info

Run the script without any options it will print the help information:


Let's take Allwinner H3 as an example, the help information will be presented as follows:

USAGE: ./ <parameter># Select Board Type: ./ ./ ./ ./ ./ ./ ./ ./ Select Module: ./ all -compile all ./ uboot -compile uboot ./ kernel -compile kernel ./ friendlywrt -compile friendlywrt ./ sd-img -generate an image for an sd card ./ emmc-img -generate an image for emmc (the generated image should be flased to an SD card and then flashed to emm with this SD card)# Clean: ./ cleanall

5.4Auto Compile

For a first time compilation you need to select an SoC platform. Let's take the NanoPi R1(Allwinner H3) as an example:

(Video) Cheap & Capable pfSense/OpenWRT Machine! Fujitsi S920 Router Review


After the script is done successfully all components including a u-boot, a kernel and a friendlywrt will be compiled, and an image file will be generated.

5.5Compile Individual Component


./ kernel


./ uboot


method 1:

./ friendlywrt

method 2:

cd friendlywrt./scripts/feeds update -a ./scripts/feeds install -a cp ../configs/config_XXXX .configmake defconfigmake download -j8make -j8

5.6Generate Image for SD Card

sudo ./ sd-img

If an img file is generated successfully you will see the following messages. You can use the "dd" command to flash the img file to an SD card. Note: you will need to replace "/dev/sdX" with the actual device name which your system recognizes the device as:

Run the following for sdcard install: sudo dd if=out/FriendlyWrt_20190828_NanoPi-R1_armhf_sd.img bs=1M of=/dev/sdX

5.7Generate emmc (eflasher) Image

sudo ./ emmc-img

If an img file is generated successfully you will see the following messages. You can use the "dd" command to flash the img file to an SD card. Note: you will need to replace "/dev/sdX" with the actual device name which your system recognizes the device as:

Run the following for sdcard install: sudo dd if=out/FriendlyWrt_20190828_NanoPi-R1_armhf_eflasher.img bs=1M of=/dev/sdX

Use this SD card to boot the eflasher system and run eflasher commands to install an OS to emmc. After installation is done, take off the SD card of the board and boot your system friendlywrt will load from eMMC.

6Make Your Own Friendlywrt

6.1Structure of Source Code Directories

├── friendlywrt│ ├── friendlywrt -> friendlywrt's source code│ └── configs -> save the "friendlywrt defconfig" file│ └── toolchain -> cross-compiler, used for compiling a u-boot and kernel│ ├── -> script for auto-compile│ ├── device/friendlyelec -> configuration file for friendlyelec boards│ ├── kernel -> kernel│ └── u-boot -> u-boot│ └── scripts -> script files for generating an img
(Video) OpenWRT - NanoPi R5S Performance Test (NAT, OpenVPN & Wireguard VPN)

6.2Configure friendlywrt Components

  • Configure by Using Make Menuconfig(H3)
cd friendlywrt-h3/friendlywrtmake menuconfig
  • Save Your Configurations
make menuconfig./scripts/ > ../configs/my_config
  • Set Your Configurations As Default

Let's take the NanoPi-R1 as an example and edit the following file:


Set TARGET_FRIENDLYWRT_CONFIG to your configurations.

  • Recompile Friendlywrt and Generate Image for SD Card
./ friendlywrt./ sd-img

6.3Put Your Add-on Features to Friendlywrt

Let's take H3 as an example. Put your files and directories to the following directory and they will be compiled to an img file.


Or you can put your files and directories in a new directory. Let's take the NanoPi-R1 as an example and edit the following file:


Open the file and add a new line(replace "XXX" with your directory):


6.4Change Friendlywrt's Default Configurations(Network, Firewall Etc)

Open and edit the following files:


6.5Change U-boot and Kernel's Configurations(H3)

Open and edit the following file:


Change uboot's settings to your own by making the following changes:

(Video) OpenWRT - NanoPi R5S Overview & Initial Setup


Change kernel's settings to your own by making the following changes:


6.6Change Other COnfigurations

Open and edit the following xml file and you can replace the source code of kernel, uboot and friendlywrt yo your own code:


For more details about what each item in the xml file means, refer to:repo Manifest Format
After you make your changes you need to do "repo" to sync and make the changes effective. For example after you change the kernel's source code you need to run the following command to sync:

repo sync --force-sync kernel

After synchronization you just need to recompile the kernel's source code:

./ kernel

6.7Repacking firmware after editing

After compiling FriendlyWrt, you can get a copy of the filesystem contents (directory named rootfs) with the following command:

export KEEP_CACHE=1./ sd-imgcd scripts/sd-fuserm -rf ./rootfscp -r out/rootfs.* ./rootfs

Repacking firmware after editing:

./ $PWD/rootfs friendlywrt./ friendlywrt


7.1Visit FriendlyWrt management page

Enterhttp://friendlywrt/or the IP address on the computer browser to enter the FriendlyWrt management page. By default, the IP address of the LAN port is, and the WAN will dynamically obtain an IP address from your main router.

7.2mount smbfs resource

mount -t cifs // /movie -o username=xxx,password=yyy,file_mode=0644

8Common Issues and Tips

  • When you compile a source code under Ubuntu you cannot do it as root and you need to do it as a non-root user
  • Compilation in VNC may not succeed


repo guidance

10Report bug


11Update Log


  • RK33xx platform: upgrade FriendlyWrt to 21.02.1, features are basically the same as 19.07.5, support docker, usb wifi, etc.


  • Add a high-speed 5G USB WiFi support, the network card model is Comfast CF-WU782AC V2, the chip model is MediaTek MT7662
  • Improved USB WiFi compatibility
  • Improved PWM fan support (RK3399 platform), fan controlled by kernel drive, temperature control support(Please search for "PWM fans" on the R4S WiKi page for details)
  • Improved stability on first boot (previous version, bpfilter error occurred in some cases on first boot)


11.3.1RK3328 FriendlyWrt:

  • RK3328 FriendlyWrt has been updated to the official stable version 19.07.5


  • RK3399 FriendlyWrt has been updated to the official stable version 19.07.5, which provides two versions of the kernel:
    • Mainline kernel-5.10 for NanoPi-R4S, NanoPC-T4, NanoPC-M4v1, NanoPi-NEO4
    • Rockchip kernel-4.19 for All FriendlyElec's RK3399 based boards


  • Optimized openssl performance
  • Added support for PWM fan, support fan speed control (platform: rk33xx)


  • Released English version


1. NanoPi R2S friendlyWrt image No response.
(F K Tech - OSS)
2. NanoPi R6S Bootup - Firmware Update (eMMC) - PPPoE Speedtest
(Van Tech Corner)
3. OpenWRT for beginners - Full basic configuration video tutorial
(Van Tech Corner)
4. How to Create a VLAN - A Beginner's Guide // OpenWrt Router (Up to 19.x)
(Dev Odyssey)
5. Adguard Home Setup on R2S/R2C/R4S/Doornet1 for Privacy, Adblocking & Security 广告拦截 隐私保护 OpenWrt 网页秒开
(Xenstar Network)
6. How to configure OpenWrt as Firewall for your home network and Guest Wifi and IPTables explained


Top Articles
Latest Posts
Article information

Author: Patricia Veum II

Last Updated: 08/23/2023

Views: 5633

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Patricia Veum II

Birthday: 1994-12-16

Address: 2064 Little Summit, Goldieton, MS 97651-0862

Phone: +6873952696715

Job: Principal Officer

Hobby: Rafting, Cabaret, Candle making, Jigsaw puzzles, Inline skating, Magic, Graffiti

Introduction: My name is Patricia Veum II, I am a vast, combative, smiling, famous, inexpensive, zealous, sparkling person who loves writing and wants to share my knowledge and understanding with you.