openwrt for the rock64
#1
hello,

for anyone interested I managed to generate an openwrt image for the rock64 based off the latest master tree

Link to download:

https://yadi.sk/d/TfX6-MYy3RTf5h?w=1

I basically provide this as is as a proof it's doable that said it should be good to go as a basic router using ethernet vlans, and there's wireguard that can be set up via webui to try it as a vpn etc. Power usage seems good, only 1.4w-1.5w idle with only the microsd card and ethernet plugged in and working.


Don't forget to turn on  'packet steering' in the web ui and you can probably increase performance by increasing the minimum cpu frequency in the starup section by just pasting something like  ''echo 600000 >  /sys/bus/cpu/devices/cpu0/cpufreq/scaling_min_freq"  or "echo 816000 > /sys/bus/cpu/devices/cpu0/cpufreq/scaling_min_freq"
  Reply
#2
Awesome stuff, thanks for sharing! Feel free to add your img to the ROCK64 Software Release wiki page, too!
  Reply
#3
updated again and cleaned up this thread and just decided to share the directory

latest glibc / 5.4.74 kernel / wireguard backport tree instead of compat
  Reply
#4
Thanks for sharing!

I'm trying to install some kmods and opkg is complaining about infompatible architecture, though the architecture is aarch64_generic everywhere. Adding --force-depends doesn't help. kmods for a different svn build of rockchip kernel 5.4.74-1 don't work either.
Apparently it wants the specific kernel build from your image. Would you be able to build and upload the kmod packages somewhere?



Code:
root@OpenWrt:~# opkg --force-depends install kmod-usb-net-sr9700
Unknown package 'kmod-usb-net-sr9700'.
Collected errors:
* pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-net-sr9700 found, but incompatible with the architectures configured
* opkg_install_cmd: Cannot install package kmod-usb-net-sr9700.

root@OpenWrt:~# opkg info kmod-usb-net-sr9700
Package: kmod-usb-net-sr9700
Version: 5.4.80-1
Depends: kernel (= 5.4.80-1-bef9a69b0c7edeeb82435f427c7332e6), kmod-usb-net
Status: unknown ok not-installed
Section: kernel
Architecture: aarch64_generic
Size: 5049
Filename: kmod-usb-net-sr9700_5.4.80-1_aarch64_generic.ipk
Description: Kernel module for CoreChip-sz SR9700 based USB 1.1 10/100 ethernet devices

root@OpenWrt:~# wget https://downloads.openwrt.org/snapshots/targets/rockchip/armv8/kmod/5.4.74-1-63fa2731cb0f8e88239410e4cc044b42/kmod-usb-net-sr9700_5.4.74-1_aarch64_generic.ipk

root@OpenWrt:~# opkg install --nodeps --force-depends ./kmod-usb-net-sr9700_5.4.74-1_aarch64_generic.ipk
Unknown package 'kmod-usb-net-sr9700'.
Collected errors:
* pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-net-sr9700 found, but incompatible with the architectures configured
* opkg_install_cmd: Cannot install package kmod-usb-net-sr9700.
  Reply
#5
(11-29-2020, 11:30 PM)yura407 Wrote: Thanks for sharing!

I'm trying to install some kmods and opkg is complaining about infompatible architecture, though the architecture is aarch64_generic everywhere. Adding --force-depends doesn't help. kmods for a different svn build of rockchip kernel 5.4.74-1 don't work either.
Apparently it wants the specific kernel build from your image. Would you be able to build and upload the kmod packages somewhere?



Code:
root@OpenWrt:~# opkg --force-depends install kmod-usb-net-sr9700
Unknown package 'kmod-usb-net-sr9700'.
Collected errors:
* pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-net-sr9700 found, but incompatible with the architectures configured
* opkg_install_cmd: Cannot install package kmod-usb-net-sr9700.

root@OpenWrt:~# opkg info kmod-usb-net-sr9700
Package: kmod-usb-net-sr9700
Version: 5.4.80-1
Depends: kernel (= 5.4.80-1-bef9a69b0c7edeeb82435f427c7332e6), kmod-usb-net
Status: unknown ok not-installed
Section: kernel
Architecture: aarch64_generic
Size: 5049
Filename: kmod-usb-net-sr9700_5.4.80-1_aarch64_generic.ipk
Description: Kernel module for CoreChip-sz SR9700 based USB 1.1 10/100 ethernet devices

root@OpenWrt:~# wget https://downloads.openwrt.org/snapshots/targets/rockchip/armv8/kmod/5.4.74-1-63fa2731cb0f8e88239410e4cc044b42/kmod-usb-net-sr9700_5.4.74-1_aarch64_generic.ipk

root@OpenWrt:~# opkg install --nodeps --force-depends ./kmod-usb-net-sr9700_5.4.74-1_aarch64_generic.ipk
Unknown package 'kmod-usb-net-sr9700'.
Collected errors:
* pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-net-sr9700 found, but incompatible with the architectures configured
* opkg_install_cmd: Cannot install package kmod-usb-net-sr9700.


Hello,

I've just rebuilt the image with sr9700 and ax88179 support.

I updated the  kernel version to 5.10.1 now and looks to work ok so far for me.

I guess I could compress the linux source from the build directory if you like, tomorrow I might try to get a build going with rtl8156 support and maybe switch the mt76 support to straight from github.com/nbd168


Currently it looks like for the rtl8153 adapter you have to disable TSO for proper stability e.g :

ethtool -K eth1 tso off
ethtool -K eth2 tso off
  Reply
#6
ok the build that is currently there has out-of-tree rtl8152 and asix ax88179 modules

you may not need to turn TSO off with the rtl8153 with this driver and I can confirm it works with the 8156 (2.5 gbps ethernet, can't do full speed test yet, waiting for adapters in the mail)


the ax88179 driver might not be totally great
  Reply
#7
testing out the rtl8156 via the usb 3 port on the Rock64

Speeds definitely up up over 1.0 gpbs

e.g :



iperf3 -c 192.168.1.1
Connecting to host 192.168.1.1, port 5201
[  5] local 192.168.1.166 port 48130 connected to 192.168.1.1 port 5201
[ ID] Interval          Transfer    Bitrate        Retr  Cwnd
[  5]  0.00-1.00  sec  265 MBytes  2.22 Gbits/sec    0  1.10 MBytes     
[  5]  1.00-2.00  sec  280 MBytes  2.35 Gbits/sec    0  1.10 MBytes     
[  5]  2.00-3.00  sec  280 MBytes  2.35 Gbits/sec    0  1.10 MBytes     
[  5]  3.00-4.00  sec  280 MBytes  2.35 Gbits/sec    0  1.10 MBytes     
[  5]  4.00-5.00  sec  280 MBytes  2.35 Gbits/sec    0  1.10 MBytes     
[  5]  5.00-6.00  sec  280 MBytes  2.35 Gbits/sec    0  1.10 MBytes     
[  5]  6.00-7.00  sec  280 MBytes  2.35 Gbits/sec    0  1.10 MBytes     
[  5]  7.00-8.00  sec  280 MBytes  2.35 Gbits/sec    0  1.10 MBytes     
[  5]  8.00-9.00  sec  280 MBytes  2.35 Gbits/sec    0  1.10 MBytes     
[  5]  9.00-10.00  sec  280 MBytes  2.35 Gbits/sec    0  1.10 MBytes     
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval          Transfer    Bitrate        Retr
[  5]  0.00-10.00  sec  2.72 GBytes  2.34 Gbits/sec    0            sender
[  5]  0.00-10.03  sec  2.72 GBytes  2.33 Gbits/sec                  receiver

iperf Done.
iperf3 -c 192.168.1.1 --reverse
Connecting to host 192.168.1.1, port 5201
Reverse mode, remote host 192.168.1.1 is sending
[  5] local 192.168.1.166 port 48230 connected to 192.168.1.1 port 5201
[ ID] Interval          Transfer    Bitrate
[  5]  0.00-1.00  sec  213 MBytes  1.79 Gbits/sec                 
[  5]  1.00-2.00  sec  227 MBytes  1.91 Gbits/sec                 
[  5]  2.00-3.00  sec  226 MBytes  1.89 Gbits/sec                 
[  5]  3.00-4.00  sec  216 MBytes  1.81 Gbits/sec                 
[  5]  4.00-5.00  sec  226 MBytes  1.89 Gbits/sec                 
[  5]  5.00-6.00  sec  226 MBytes  1.90 Gbits/sec                 
[  5]  6.00-7.00  sec  228 MBytes  1.91 Gbits/sec                 
[  5]  7.00-8.00  sec  223 MBytes  1.87 Gbits/sec                 
[  5]  8.00-9.00  sec  220 MBytes  1.85 Gbits/sec                 
[  5]  9.00-10.00  sec  219 MBytes  1.84 Gbits/sec                 
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval          Transfer    Bitrate        Retr
[  5]  0.00-10.03  sec  2.17 GBytes  1.86 Gbits/sec    0            sender
[  5]  0.00-10.00  sec  2.17 GBytes  1.87 Gbits/sec                  receiver

iperf Done.
  Reply
#8
updated again

there seems to be a small bug in this image where the firewall doesn't start properly

to work around it you can go to the startup section and disable the firewall
you might as well disable 'haveged' as well as I don't think it's needed

but then in the 'local startup' section put '/etc/init.d/firewall start'

reboot

also it does look like you need to disable tso on the r8152 driver so while you are there you can also put in

ethtool -K eth1 tso disable
ethtool -K eth2 tso disable

etc
  Reply
#9
Hi wilsonYan,

First off, thank you for your work in getting openWrt compiled for the Rock64.

Secondly, I would like to replicate your work. I would like to build a completely customized image including kmods for my specific use case. I have downloaded your openwrt-rock64-messy.patch from your link above. I have tried applying this patch to the root git directory of the latest openWrt commit, 54bfebdca00f071f0982e05e69be7a7d4176147b though it does not apply cleanly.

As a sanity check and judging by the timestamp of your last post, I have successfully applied the openwrt-rock64-messy.patch in the root git directory of openWrt commit d6cb50c7ba8447f018139401d0d3821069e5f389. From there, I had a few small issues with a full openWrt build from scratch, namely with the file rk3328-nanopi-r2s.dts that was non-existent on my system, and is surely unnecessary for the Rock64 build.

After manually removing 006-rockchip-rk3328-fix-NanoPi-R2S-GMAC-clock-name.patch, manually applying (after some googling) arm64-dts-rockchip-add-usb3-controller-node-for-RK3328-SoCs.diff patch, and  "faking" the rk3328-nanopi-r2s.dts file at the end of the build process, I was able to complete a successful rock64 build with both ext4 and squashfs img variants from the openWrt build system. This successfully booted and I could access LuCI, iperf3, and the various packages that I selected in menuconfig.

I have a specific dual-port ax88179 USB 3.0 device (search Amazon VTOP USB 3.0 to Gigabit Ethernet NIC 10/100/1000 Mbps Network Adapter with Dual RJ45 LAN Ports Compatible for Windows 10 and MacOS 10.15(Intel)) that I'm trying to get working on my build. This device normally enumerates as a USB hub and then two unique network interfaces (eth1 and eth2 on top of the built in eth0 gigabit port). On your last openwrt-rockchip-armv8-pine64_rock64-ext4-sysupgrade.img.gz build, this device enumerated on the USB2 ports, but not USB3. However, a separate single NIC rtl8153 device did seem to work correctly on the USB3 port, so it is likely related to the built-in USB hub on the device.

On my build, nothing on USB3 seemed to work, including the rtl8153, despite my modifications mentioned earlier. My guess is that this is because I am using the stock openWRT kernel, not a specific kernel for rock64, even though I think the .dtb was correct. The kernel being built on commit d6cb50c7ba8447f018139401d0d3821069e5f389 was 5.4.x whereas I think your latest image included a rockchip-specific 5.10.x kernel.

On top of debugging my USB3 issue, I have plenty of other kernel-related packages that I would like to include natively in my build such as NFS and others.

Can you give a quick overview of your openWrt build process and any modifications needed to create your images? Do you have a method of incorporating the rock64 kernel patches or sources as part of the openWrt build that will allow for the kmod packages to be built successfully? Or are you building both openWrt and the Rock64 kernel image separately (with the additional network drivers that you've mentioned above) and manually combining them in the end? There are many openWrt packages I am interested in including in my build that rely on 1 or more kmod packages and I am trying to figure out the best way to get the build working on my system so that I can customize and troubleshoot my own images further.

Thanks,
~Chainu
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Linux Images (ROCK64) pineadmin 163 122,840 01-05-2021, 10:43 AM
Last Post: DuckyBoi
  slarm64 (unofficial slackware) Rock64 RK3328 (aarch64) mara 100 41,622 12-28-2020, 11:39 AM
Last Post: mara
  Armbian for Rock64 pineadmin 26 14,530 12-25-2020, 11:07 PM
Last Post: lanefu
  DietPi OS for ROCK64 MichaIng 9 848 12-22-2020, 03:25 PM
Last Post: MichaIng
  RETRO-GAMING: UPDATED RELEASE OF RECALBOX FOR THE ROCK64 Mrfixit2001 31 17,418 12-21-2020, 08:17 AM
Last Post: hermes73
  RetroPie on Rock64 Luke 40 22,107 10-31-2020, 07:12 AM
Last Post: BigSkyEntertainment
  Lakka (retrogaming) os for rock64 Wizardknight 2 867 09-21-2020, 07:18 PM
Last Post: Wizardknight
  Debian (Vanilla) on Rock64 and eMMC - how ? as365n4 4 1,426 09-21-2020, 04:33 AM
Last Post: as365n4
Sad Rock64 crash randomly during usb 3 copy with RAID1 drive phalae 24 14,743 09-14-2020, 10:48 AM
Last Post: BrownLuther007
  Arch Linux ARM on the Rock64 V3 justinweiss 2 1,421 08-24-2020, 05:16 PM
Last Post: justinweiss

Forum Jump:


Users browsing this thread: 1 Guest(s)