Support for FriendlyELEC NanoPi R5S rk3566 SBC

Don't know how many who are using the NanoPI R5S with FirendlyWrt besides me.

It would be so nice to be able to use the official version of Openwrt with this router.

Thanks Michael.

8 Likes

Same here - i am using the FriendlyELEC supplied 22.03 image and would love to switch to a official openwrt build

Does the 22.03 image work well for you? I tried it and the R5S would stop routing in a couple minutes. 21.02 and the builds from here work fine.

No issues with the 22.03 image - nothing like you described. The prebuilt image does come with debugFS enabled though, easy to disable by building your own image (using instructions from friendly ELEC wiki).

1 Like

What option in kernel config did you set do disable debug fs?

[    3.485692] rga: rga2_irq, irq = 30, match scheduler
[    3.486190] rga: rga2 hardware loaded successfully, hw_version:3.2.63318.
[    3.486221] rga: rga2 probe successfully
[    3.486541] rga2_mmu: IOMMU binding successfully, default mapping core[0x4]
[    3.486818] rga: Module initialized. v1.2.20
[    3.486832] 
[    3.486839] ********************************************************************
[    3.486845] **     NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE           **
[    3.486850] **                                                                **
[    3.486857] **  WRITEABLE clk DebugFS SUPPORT HAS BEEN ENABLED IN THIS KERNEL **
[    3.486862] **                                                                **
[    3.486867] ** This means that this kernel is built to expose clk operations  **
[    3.486872] ** such as parent or rate setting, enabling, disabling, etc.      **
[    3.486878] ** to userspace, which may compromise security on your system.    **
[    3.486883] **                                                                **
[    3.486888] ** If you see this message and you are not debugging the          **
[    3.486894] ** kernel, report this immediately to your vendor!                **
[    3.486899] **                                                                **
[    3.486904] **     NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE           **
[    3.486909] ********************************************************************

Is this likely to work with the RK3566 based https://wiki.radxa.com/Rock3/CM3

I received a Nanopi R5S recently and created some builds following the same model of the ones I did for R2S and R4S

The repo is here : https://github.com/anaelorlinski/OpenWrt-NanoPi-R5S-Builds

Don't hesitate to report success or bugs

4 Likes

This is awesome. I just downloaded your build and it works great. Happy to test things out for you. I also have an R5C that I hope to get stock OpenWRT on someday :slight_smile:

I got feedback that the R5S image works on R5C too. I could not try myself because I don't own a R5C device, but I could probably add R5C builds as well.

1 Like

can I write the build to emmc?
I use the last build, I couldn't install the "kmod-usb-storage" because of different kernel version.

I didn't try to copy the build to eMMC, I think you can try with the same method provided by FriendlyElec.

Regarding kmod-usb-storage, it works for me with access to network

root@OpenWrt:/# opkg update
Downloading https://downloads.openwrt.org/snapshots/targets/rockchip/armv8/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/snapshots/targets/rockchip/armv8/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_generic/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/snapshots/packagesrch64_generic/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_generic/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_generic/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_generic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_generic/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_generic/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_generic/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_generic/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_generic/telephony/Packages.sig
Signature check passed.
Downloading file:///ipks//Packages.gz
Updated list of available packages in /var/opkg-lists/local
Downloading file:///ipks//Packages.sig
Signature check passed.
root@OpenWrt:/# opkg install kmod-usb-storage
Installing kmod-usb-storage (5.15.108-1) to root...
Downloading file:///ipks//kmod-usb-storage_5.15.108-1_aarch64_generic.ipk
Installing kmod-scsi-core (5.15.108-1) to root...
Downloading file:///ipks//kmod-scsi-core_5.15.108-1_aarch64_generic.ipk
Configuring kmod-scsi-core.
[   63.199132] kmodloader: loading kernel modules from /etc/modules.d/*
[   63.202937] kmodloader: done loading kernel modules from /etc/modules.d/*
Configuring kmod-usb-storage.
[   63.241541] kmodloader: loading kernel modules from /etc/modules.d/*
[   63.245757] kmodloader: done loading kernel modules from /etc/modules.d/*
root@OpenWrt:/#

Alternatively you can try

opkg install /ipks/kmod-usb-storage_5.15.108-1_aarch64_generic.ipk

Finally ported it to openwrt mainline, see https://github.com/openwrt/openwrt/pull/12974
any review/test would be appreciated.

5 Likes

This is awesome!! Thank you so much, @anaelorlinski !! I just installed your latest build onto my R5S and it worked great!

I am noticing something odd (although I may just be misunderstanding OpenWRT filesystem). The R5S advertises 32GB of emmc storage but I'm seeing much less of that being reported (see screenshot):
image
Not sure if others are encountering this or not.

Also, for those wanting to install the build. I just followed the FriendlyELEC instructions here (https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R5S#Install_OS_to_eMMC) and uploaded the img file pulled from the github through the web GUI. Had to manually power cycle for it to take effect after the install completed.

1 Like

You need to expand the partitions and filesystem. You have the howto here https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/blob/main/docs/resize-f2fs.md for squashfs, and there is a similar procedure for ext4 that can be found on OpenWrt docs

1 Like

Appreciate the info, @anaelorlinski !

For those who may follow, here is what I did:

  • Use cfdisk to expand partition
    • cfdisk /dev/mmcblk1
    • Use the cfdisk interface to then expand /dev/mmcblkp2
  • Use losetup and resize2fs to expand filesystem
opkg update
opkg install losetup resize2fs

# Map loop device to root partition
losetup /dev/loop1 /dev/mmcblk1p2

# Expand root filesystem
resize2fs -f /dev/loop1

# Apply changes
reboot
2 Likes

Hi,

I am using Friendlyelec armhf OS version with these details -
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial

I have added few files in this system and trying to create an image of the same OS. Following are the details -
udev 390M 0 390M 0% /dev
tmpfs 98M 6.0M 92M 7% /run
overlay 3.2G 3.0G 37M 99% /
tmpfs 492M 0 492M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 492M 0 492M 0% /sys/fs/cgroup
tmpfs 99M 4.0K 99M 1% /run/user/1000
/dev/mmcblk0p1 60M 13M 43M 23% /media/pi/boot1
tmpfs 99M 0 99M 0% /run/user/0

I am trying to create the custom image of my OS version but the resultant image is not bootable.
I am using the following command to create the image = sudo dd if=/dev/mmcblk0 of=/home/myimage.img

Any help would be appreciated.
Thanks

@guptashubham101 - please direct your questions to the maintainers of the Friendlyelec firmware. Their firmware is not the same as offficial OpenWrt and they are responsible for providing support. As such, this is off-topic for the OpenWrt forums.

I'm planning to bu this device. Is vlans possible with this image?

Yes it works for me I need a specific vlan to connect to my internet provider.

Hi,

I used your steps but in last step I get an error

root@OpenWrt:~# cfdisk /dev/mmcblk1

Syncing disks.
root@OpenWrt:~# losetup /dev/loop1 /dev/mmcblk1p2
root@OpenWrt:~# resize2fs -f /dev/loop1 resize2fs 1.47.0 (5-Feb-2023)
resize2fs: Bad magic number in super-block while trying to open
/dev/loop1
Couldn't find valid filesystem superblock.