Flash OpenWRT to NanoPi R5S without EFlasher

Recently bought a FriendlyARM NanoPi R5S with 4GB RAM to replace the router and firewall functions of GL.iNet GL-MT6000 (Flint 2) that has 1GB RAM only. FriendlyARM provides FriendlyWRT official image, a fork of OpenWRT. I prefer OpenWRT official image for a vanilla experience.

  1. Flash OpenWRT
  2. Expand root partition

Flash OpenWRT §

The easiest way to flash OpenWRT is to use EFlasher utility provided by FriendlyARM, but dd actually works just fine. I found this R6S post to be useful as the guide is also applicable to R5S.

Download and flash OpenWRT to SD card.

curl -LO "https://downloads.openwrt.org/releases/25.12.6/targets/rockchip/armv8/openwrt-25.12.6-rockchip-armv8-friendlyarm_nanopi-r5s-ext4-sysupgrade.img.gz"
gunzip -c "openwrt-25.12.6-rockchip-armv8-friendlyarm_nanopi-r5s-ext4-sysupgrade.img.gz" | sudo dd of=/dev/sdaX bs=1m

Insert the SD card to R5S to boot up OpenWRT. SSH into R5S, download and flash OpenWRT to eMMC (“/dev/mmcblk1”). SD card is identified as “/dev/mmcblk0” in OpenWRT.

curl -LO "https://downloads.openwrt.org/releases/25.12.6/targets/rockchip/armv8/openwrt-25.12.6-rockchip-armv8-friendlyarm_nanopi-r5s-ext4-sysupgrade.img.gz"
gunzip -c "openwrt-25.12.6-rockchip-armv8-friendlyarm_nanopi-r5s-ext4-sysupgrade.img.gz" | sudo dd of=/dev/mmcblk1 bs=1m

Expand root partition §

df -h shows the eMMC root partition (/dev/mmcblk1p2) is only ~150MB not 16GB, so the partition needs to be expanded. Easiest way is to boot up from the eMMC (remove SD card beforehand) and follow the expand_root guide. When using that guide, root partition is also automatically expanded after firmware upgrade.

To expand manually,

apk update
apk add parted resize2fs
resize2fs /dev/mmcblk1p2

resize2fs may prompt to fix partition alignment, proceed with it.

“/dev/mmcblk1p1” is the boot partition, leave it as is.

df -h should now show the root partition is 16GB.

Remove the SD card and reboot. R5S should now boot OpenWRT from the eMMC.

Root partition size will be reverted after firmware upgrade if expanded manually.