I've got NanoPi-R6S and I've downloaded rk3588-sd-ubuntu-jammy-desktop-6.1-arm64-20240311.img.gz from RK3588-FriendlyElec Google drive. The system works fine but it has overlayfs with rootfs and userdata partitions. I would like to setup my own configuration of overlayfs. The idea is to have rootfs, overlay and mode partitions so that:
1. rootfs has system data on it, some additional soft installed and some user data and rootfs is read-only
2. overlay is cleared every time after reboot (is we use "overlay mode" described later)
3. mode has a script on it, which is not cleared at reboot and contains a flag that determines whether we boot with overlay or not
a) if the boot mode is "with overlay", then at boot overlay filesystem is created, lower level is rootfs and upper level is empty overlay
b) if the boot mode is "without overlay", then at boot no overlay filesystem is created and we just have rootfs (but as we do not have overlay filesystem in this case rootfs is read-write now and we can change installed soft or our user data)
Is this scenario achievable and if yes, then how can I do this?