NanoPi R4S-RK3399 is a great new OpenWrt device

why is there no 'wireguard' package in the opkg repo?

It looks like the standalone wireguard package is not needed anymore as of the snapshot builds, due to wireguard being integrated into the kernel instead:
https://forum.openwrt.org/t/no-more-wireguard-package-in-snapshot/90267/3

1 Like

thanks!

I was able to figure out why my ansible playbook was not working on openwrt 20.02 - the 'ifname' to 'device' migration changed the configuration syntax.

you might consider these. richb-hanover/OpenWrtScripts: A set of scripts for maintaining and testing OpenWrt (github.com)

specifically the https://github.com/richb-hanover/OpenWrtScripts#config-openwrtsh one. i used that with bit of editing to be able to auto config from clean flash to working. Add in or take away whatever you want. Also means for testing issues etc you dont miss a package or screw up a config. Its helped me go from 19.07 through all the 20 RCs.

1 Like

I found out that using the ext4 version that 'factory reset' function will not work ("firstboot && reboot now"). Trying a squashfs image instead.

Does anyone have any recommended ways to extend the partition to the rest of the microSD?

root@OpenWrt:/# fdisk -l
Disk /dev/loop0: 963.06 MiB, 1009844224 bytes, 1972352 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk0: 58.09 GiB, 62377689088 bytes, 121831424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: x

Device         Boot  Start     End Sectors Size Id Type
/dev/mmcblk0p1 *     65536  147455   81920  40M 83 Linux
/dev/mmcblk0p2      196608 2293759 2097152   1G 83 Linux

Sidebar question: does anyone have any good example github action/workflows repositories to fork that automate the building of images with all kmods and packages desired?

That is a known behaviour of images without a read-only core (squashfs rootfs), so ext4 or jffs2 images without an overlay. The factory reset technically works by deleting the writable overlay and re-creating it on the next boot (with the contents of the underlying read-only squashfs providing the defaults again), you don't have that on ext4 images, any change is final (target independent, so no r4s specific, but also happening on any other target providing ext4 or jffs2 images e.g RPi, x86, x86_64 or even ar71xx or bcm47xx in older releases).

2 Likes

Looks like RC4 has finally added the R4S!

OpenWrt 21.02.0 Fourth release candidate - Release and security announcements - OpenWrt Forum

New hardware targets

A new realtek target has been added, which is often found in managed switches. As a result, it is now possible to run OpenWrt on devices with a significant number of Ethernet ports. See supported devices for realtek.

In addition, new bcm4908 and rockchip targets have been added.

1 Like

should the R4S build be listed here? I only see R2S https://downloads.openwrt.org/releases/21.02.0-rc4/targets/rockchip/armv8/

No, r4s support has only been merged after openwrt-21.02 was branched off - unless it gets backported to this stable branch (at this point probably not too likely), it's not going to be part of the 21.02.x stable releases (but will be part of the next major stable release after that).

The commits were in june... /sigh/ and it was in patch notes that there was updated rockchip targets.
git.openwrt.org Git - openwrt/openwrt.git/commit

well balls to it. I'll keep using anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds: OpenWRT Builds for NanoPi R2S & R4S from official Openwrt source code with minimal set of patches (github.com) once he builds off RC4.

I still have that reboot bug on the snapshot (updated yesterday). Every time I reboot, I have to pull off the power supply and plug it again. I think it's related to the MicroSD card reader/driver. Anyone also having this issue? Is it easily solvable (i.e. without patching and recompiling manually)?
I haven't had this on FriendlyWRT.

I bought one of these to tinker with due to the promising initial results in this thread, but have been unable to get mine to boot. Tried snapshot and compiling from a fresh clone of master (my x86_64 and ipq806x builds work perfectly). I have been prepping the SD card with the following:

>sudo shred -f -v -n 0 -z /dev/sde   (clear all sectors)

>sudo fdisk /dev/sde                 (to write dos disklabel then quit)

>sudo dd if=openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-squashfs-sysupgrade.img of=/dev/sde

SD card then shows the following from fdisk:

Disk /dev/sde: 30.01 GiB, 32220643328 bytes, 62930944 sectors
Disk model: USB3.0 CRW-SD/MS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f

Device     Boot  Start    End Sectors  Size Id Type
/dev/sde1  *     65536  98303   32768   16M 83 Linux
/dev/sde2       131072 344063  212992  104M 83 Linux

Insert SD card into R4S and connect power. Red power light comes on but that's it. Ethernets never come up.

Can someone point out if I am doing something obviously wrong before I have to open the unit and connect to serial? Perhaps I have a bad unit?

This sounds familiar to my first tries with this device, if the microSD is not properly formatted no LEDs or anything will boot. I even purchased a UART cable to see the serial output, apparently if the microsd is also not properly formatted then serial output will also be nil.

My recommendation is to try using balenaEtcher to flash the SD card using a known image like snapshots from owrt and go from there.

Soft reboot issue is mentioned earlier in this post.

1 Like

you did untar/zip the image right?

I made that mistake when i flashed first time however i have a serial connection and once i figured it out and reflashed it booted fine.

Also try both ethernet ports. Mine got flipped on a couple of builds.

resize2fs

There is a guide here. RPi Resize Flash Partitions - eLinux.org
Its for the pi but the section you want is right at the bottom. - Manually resizing the SD card on Raspberry Pi.

1 Like

Yeah, that's why I asked. I was hoping that these patches had already been added to OpenWRT.

It looks like the resize can't be done while openwrt is booted?

root@meow:/# resize.f2fs /dev/mmcblk0p2
        Error: In use by the system!

I did fdisk, deleted, created new partition and rebooted. Final step seems is where I am stuck.

I did try gparted on the ext4 image but I keep reading that squashfs is better to keep the life of the microsd? Anyhow any tips appreciated on resizing the SD on squashfs while booted.

1 Like

It needs to be unmounted. Probably easier to do it with a card reader on linux if you can. There's a section on that link which shows you how.

but

umount /dev/mmcblk0p2

then resize it.

Nice info on squashfs. Is it true? I'm thinking about resizing the partition so I can keep the collectd logs on reboot but I'm currently using ext4.

This is very good / easy to resize partition (instead of fdisk) but after resizing partition the filesystem needs to be expanded, no?

Followed @mercygroundabyss recommendation and unmmounted and tried but it still claims its mounted?

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *     65536   147455    81920   40M 83 Linux
/dev/mmcblk0p2      196608 31116287 30919680 14.7G 83 Linux
root@meow:/# [   31.702153] vbus_typec: disabling
^C
root@meow:/# umount /dev/mmcblk0p2
root@meow:/# resize.f2fs /dev/mmcblk0p2
        Error: In use by the system!

root@meow:/# umount -f -l /dev/mmcblk0p2
umount: /dev/mmcblk0p2: not mounted.
root@meow:/# resize.f2fs /dev/mmcblk0p2
        Error: In use by the system!

mtab

root@meow:/# cat /etc/mtab
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
/dev/loop0 /overlay f2fs rw,lazytime,noatime,background_gc=on,discard,no_heap,us                      er_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=ad                      aptive,active_logs=6,alloc_mode=reuse,fsync_mode=posix 0 0
overlayfs:/overlay / overlay rw,noatime,lowerdir=/,upperdir=/overlay/upper,workd                      ir=/overlay/work 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,mode=600,ptmxmode=000 0 0
cgroup /sys/fs/cgroup tmpfs rw,relatime,mode=755 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/cpu cgroup rw,relatime,cpu 0 0
cgroup /sys/fs/cgroup/cpuacct cgroup rw,relatime,cpuacct 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,relatime,blkio 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,relatime,memory 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,relatime,devices 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,relatime,freezer 0 0
cgroup /sys/fs/cgroup/net_cls cgroup rw,relatime,net_cls 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/net_prio cgroup rw,relatime,net_prio 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup rw,relatime,hugetlb 0 0
cgroup /sys/fs/cgroup/pids cgroup rw,relatime,pids 0 0
cgroup /sys/fs/cgroup/rdma cgroup rw,relatime,rdma 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
none /sys/fs/bpf bpf rw,nosuid,nodev,noexec,noatime,mode=700 0 0
overlayfs:/overlay /opt/docker overlay rw,noatime,lowerdir=/,upperdir=/overlay/u                      pper,workdir=/overlay/work 0 0
root@meow:/#

Tried also

root@meow:/# umount -f -l /
root@meow:/# df -h
Filesystem                Size      Used Available Use% Mounted on
df: /proc/mounts: No such file or directory
root@meow:/# fsck.f2fs -f /dev/mmcblk0p2
Info: Force to fix corruption
        Error: Failed to get the device stat!
root@meow:/# resize.f2fs /dev/mmcblk0p2
        Error: Failed to get the device stat!