NanoPi R4S-RK3399 is a great new OpenWrt device

What an excellent video tutorial! It doesn't resolve my question, but it's nonetheless a great link and a very clear explanation for those not already familiar with the information.

Do I infer that you've recently flashed squashfs snapshot sysupgrade images generated with the firmware selector, selected the option to retain configuration, and your network, dhcp and firewall files were not replaced with the default configuration anyway?

I can never rule out careless mistakes or my own stupidity - I've plenty of both. But it's happened to me twice now. On my NanoPi's, network configuration is not retained when I expect it to be. It is retained on other devices when I expect it to be retained.

I did and configuration was kept after it

Looks like I need to look harder in this area then. Thank you for confirming it works for you.

I just did snapshot squashfs firmware selector upgrades with custom packages added on an ER-X and two RAC2V1K's and everything worked as expected. Repeated process again on my R4S and...nope...once again, configuration reverted to default. Very frustrating, but I'll shake something loose eventually.

Looking to purchase a 1GB model. Preferably from Europe to avoid import taxes, with or without a case, new or used as long as it works, this is to test and fix my generated builds on 1Gb models.

FYI I tried to ordered here https://www.ebay.com/itm/314000006183 but received a 4Gb one..... however this is a good deal if you look for this device!

PM me if you want to buy from me :wink:

1 Like

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=18f77ef2d6ee2d3b28f686cbbfff2d7b8c37fb7e - rockchip: Ensure the MAC address for all NanoPi R4S boards is assigned unique for each board.

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=fff797d26e758c596f6602ded82e81746d8f1aa4 - rockchip: add system-LED aliases specific to OpenWrt

Here is a new build of the 22.03.1 release:

  • 2.0Ghz / 1.6Ghz overclock (in between stock 1.8 / 1.4 and ImmortalWrt 2.2 / 1.8)
  • 512MB root
  • Reverted patch that keeps SD card at low speed to fix reboot (I'm running docker from the SD card)
  • Used the older patch that fixes reboot and allows full speed on SD card (but reboot after a kernel panic will not work)
  • r8168 driver
  • legacy firewall3 / iptables (for banip support)
  • curl
  • nano
  • block-mount
  • shadow-utils
  • dnscrypt-proxy2
  • luci-app-adblock
  • luci-app-banip
  • luci-app-ddns
  • luci-app-dockerman
  • luci-app-minidlna
  • luci-app-sqm
  • luci-app-wireguard
  • luci-app-ksmbd
  • docker-compose
  • docker with ext4 support
  • kmod-fs-ext4
  • kmod-fs-ksmbd

(4GB model only) squashfs:

https://drive.google.com/file/d/1uJYBlRxVtqOjMsZbBzJIu1HtpROEkiP2/view?usp=sharing

(4GB model only) ext4:

https://drive.google.com/file/d/1QqCNLcJ5Guz7d0x84otfnu93Rc3FZwrA/view?usp=sharing

This build has the same config / patches / packages / root size as before, so anyone using one of my previous builds should be able to flash this directly from the web interface. Otherwise if you are switching from a different build, you will need to do a config backup, flash this to a clean SD card and then restore the backed-up config.

7 Likes

Hi,
I have the same problem with loosing configuration (R4S device).
The following sysupgrade was performed with latest imagebuilder generated build:

# sysupgrade -v /tmp/openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-ext4-sysupgrade.img

I noticed this problem with images prepared after 2022-10-04.
Do you have some similar experiences?

Yes - that has been my experience.

You missed -c option

Hi,
Thanks for the hint!
I am getting the following error:

root@np1:~# sysupgrade -c -v /tmp/openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-ext4-sysupgrade.img
Cannot find '/overlay/upper/etc', required for '-c'
root@np1:~#
root@np1:~# sysupgrade -c -v /tmp/openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-squashfs-sysupgrade.img
Cannot find '/overlay/upper/etc', required for '-c'
root@np1:~#
root@np1:~# find /overlay/
/overlay/
root@np1:~#
root@np1:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root              1030828     91592    922852   9% /
tmpfs                  1983988   1150944    833044  58% /tmp
tmpfs                      512         0       512   0% /dev
root@np1:~#

I am not sure why /overlay is empty in my case.

I did prepare SD card a few days ago, with following commands:

$ wget https://downloads.openwrt.org/snapshots/targets/rockchip/armv8/openwrt-imagebuilder-rockchip-armv8.Linux-x86_64.tar.xz
$ tar -Jxf openwrt-imagebuilder-rockchip-armv8.Linux-x86_64.tar.xz
$ cd openwrt-imagebuilder-rockchip-armv8.Linux-x86_64/
$ sed -i "s/CONFIG_TARGET_ROOTFS_PARTSIZE=.*/CONFIG_TARGET_ROOTFS_PARTSIZE=1024/g" .config
$ make image PROFILE=friendlyarm_nanopi-r4s PACKAGES="\
6in4 adblock block-mount bridge bzip2 comgt curl ddns-scripts-cloudflare ddns-scripts-freedns ddns-scripts-noip \
dnscrypt-proxy2 dmesg dropbear e2fsprogs gzip htop ifstat iperf3 ip-bridge ip-full \
kmod-fs-autofs4 kmod-fs-ext4 kmod-fs-msdos kmod-fs-ntfs kmod-tun kmod-usb-storage-uas kmod-usb2 kmod-usb3 \
lm-sensors ncat nmap nping less liblzo2 \
luci luci-ssl luci-app-adblock luci-app-advanced-reboot luci-app-bcp38 luci-app-ddns luci-app-openvpn luci-app-sqm luci-app-statistics luci-app-vnstat2 \
mkf2fs mailsend netdata netperf ntfs-3g openvpn-openssl openssl-util sqm-scripts sqm-scripts-extra \
tcpdump transmission-cli transmission-daemon transmission-remote unrar unzip vim vnstat2 wget-ssl xz-utils"
$ cd bin/targets/rockchip/armv8/
$ gzip -d openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-ext4-sysupgrade.img.gz
$ sudo dd if=openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-ext4-sysupgrade.img of=/dev/sdc bs=32M

Do you have a similar experience?
Am I doing something wrong?

ext4 image doesn't have overlay partition that mean ext4 not support reset configuration to default, cannot cross upgrade from ext4 to squashfs. you need reflash sdcard with squashfs image.

1 Like

Hi,

Thanks @leendy for the tip.
It's still not working for me - I lose configuration after I re-flash.
Here is what I did - tried it now with just the squashfs image.

a) build image:

$ wget https://downloads.openwrt.org/snapshots/targets/rockchip/armv8/openwrt-imagebuilder-rockchip-armv8.Linux-x86_64.tar.xz
$ tar -Jxf openwrt-imagebuilder-rockchip-armv8.Linux-x86_64.tar.xz
$ cd openwrt-imagebuilder-rockchip-armv8.Linux-x86_64/
$ sed -i "s/CONFIG_TARGET_ROOTFS_PARTSIZE=.*/CONFIG_TARGET_ROOTFS_PARTSIZE=1024/g" .config
$ make image PROFILE=friendlyarm_nanopi-r4s PACKAGES="\
6in4 adblock block-mount bridge bzip2 comgt curl ddns-scripts-cloudflare ddns-scripts-freedns ddns-scripts-noip \
dnscrypt-proxy2 dmesg dropbear e2fsprogs gzip htop ifstat iperf3 ip-bridge ip-full \
kmod-fs-autofs4 kmod-fs-ext4 kmod-fs-msdos kmod-fs-ntfs kmod-tun kmod-usb-storage-uas kmod-usb2 kmod-usb3 \
lm-sensors ncat nmap nping less liblzo2 \
luci luci-ssl luci-app-adblock luci-app-advanced-reboot luci-app-bcp38 luci-app-ddns luci-app-openvpn luci-app-sqm luci-app-statistics luci-app-vnstat2 \
mkf2fs mailsend netdata netperf ntfs-3g openvpn-openssl openssl-util sqm-scripts sqm-scripts-extra \
tcpdump transmission-cli transmission-daemon transmission-remote unrar unzip vim vnstat2 wget-ssl xz-utils"

b) flash SD card:

$ cd bin/targets/rockchip/armv8
$ gzip -d if=openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-squashfs-sysupgrade.img.gz
$ sudo dd if=/dev/zero of=/dev/sdc bs=8192 count=10 status=progress
$ sudo dd if=openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-squashfs-sysupgrade.img of=/dev/sdc bs=32M status=progress

c) transfer image to Nano PI:

$ scp -O bin/targets/rockchip/armv8/openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-squashfs-sysupgrade.img.gz root@192.168.1.1:/tmp

d) reflash (upgrade) NanoPI:

root@np1:~# cd /tmp && gzip -d openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-squashfs-sysupgrade.img.gz
root@np1:~# sysupgrade -c -v /tmp/openwrt-rockchip-armv8-friendlyarm_nanopi-r4s-squashfs-sysupgrade.img

Am I doing something wrong?

I'm download image from official repos & upgraded stable 23.03.2 without any issue, not use imagebuilder. Not know exactly yr issue.
Try omit bs=32M option in dd command, try another flashtool & sdcard.

I don't think so. Master does not keep config after sysupgrade. Looks like a fix is in progress with this PR:

I just recently upgraded an Orange Pi R1 Plus by flashing a squashfs build in luci over an ext4 build with different root partition size while keeping config, and it actually worked for me in that case. While the ext4 build does not have an overlay, I believe it either tracks changed config files, or maybe it looks at file timestamps or compares them to default files when you flash a new build and backs up any that don't match the default. I wasn't very confident when I pressed the upgrade button, but to my surprise it did indeed work. Not saying it would work in all cases, just that it might work in some cases.

I know this is old but I think I ran into the same issue and found a solution for expanding the filesystem for /overlay on a squashfs image with that error! It cannot survive overwriting the sd card with a new image just like always but I share my findings in case it is useful.

I found that the filesystem on /dev/loop1 is ext4 instead of f2fs with the mount command.
root@R4S-wrt:~# mount

/dev/root on /rom type squashfs (ro,relatime)
...
/dev/loop0 on /overlay type ext4 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)

I did a hybrid process that worked!:

opkg update
opkg install losetup e2fsprogs resize2fs 
LOOP="$(losetup -n -O NAME | sort | sed -n -e "1p")"
ROOT="$(losetup -n -O BACK-FILE ${LOOP} | sed -e "s|^|/dev|")"
OFFS="$(losetup -n -O OFFSET ${LOOP})"
LOOP="$(losetup -f)"
losetup -o ${OFFS} ${LOOP} ${ROOT}
e2fsck -f ${LOOP}
mount ${LOOP} /mnt
umount ${LOOP}
resize2fs ${LOOP}
reboot

See my full write-up for more details:

1 Like

Try increasing the kernel size sed -i "s/CONFIG_TARGET_KERNEL_PARTSIZE=.*/CONFIG_TARGET_KERNEL_PARTSIZE=32/g" .config

1 Like

Hi,

Thanks @antoncycle for the tip!
This solved the issue!

Friendlyelec has started selling the NanoPi R6S, quite disappointed for the lack of m.2 nvme for storage like the R5S https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R6S

2 Likes