[Miscellaneous Android Development] munjeni:
Yes thats it! What need to be manualy tried first before anything is:

mkdir -p /data/local/tmp/work
mkdir -p /data/local/tmp/upper
mount -t overlay overlay -o lowerdir=/system,upperdir=/data/local/tmp/upper,workdir=/data/local/tmp/work /system

If that work than it will definitelly work on ramdisk level. Overlayfs is an powerfull thing, ideal to beat our android RO. I'm running overlayfs on Openvrt ruter Fritz Box 7360SL and an external 1Tb hard disc, I'm compiled a ton of things that way from 2017. and I have now it like full Linux envinronment with compiled a lot of things directly inside router, Apache, PHP, Mysql, GCC, Python, Torrent.... many more things , see how powerfull overlayfs can convert an router into an true Linux -> https://pastebin.com/5zCQTrSc :) And when I disconnect external hard disc everything is stock and unmodified, no need to mess by reinstalling anything.

List of things compiled on router directly:

root@LEDE:~# ls -l /overlay/ROM/squashfs-root
total 1808
drwxr-xr-x 7 root root 4096 May 8 2018 MediaInfo
drwxr-xr-x 7 root root 4096 May 7 2018 MediaInfoLib
drwxr-xr-x 6 root root 4096 Nov 2 2017 ZenLib
drwxr-xr-x 28 1001 1001 4096 May 26 2018 apr-1.6.3
drwxr-xr-x 21 1001 1001 4096 May 27 2018 apr-util-1.6.1
drwxrwxr-x 9 root root 4096 May 26 2018 autoconf-2.69
drwxr-xr-x 11 1000 998 4096 May 26 2018 automake-1.16
drwxr-xr-x 2 root root 4096 Jun 21 2018 bin
drwxr-xr-x 14 root root 4096 May 28 2018 bison-2.7.91
drwxr-xr-x 2 root root 4096 May 27 2018 bzip2-1.0.6
drwxrwxr-x 11 root root 4096 May 25 2018 coreutils-8.29
drwxr-xr-x 2 root root 4096 May 26 2018 crypt_0_03
drwxr-xr-x 13 1000 1000 4096 May 27 2018 curl-7.60.0
drwxr-xr-x 22 root root 4096 Jun 20 2018 cyrus-sasl
drwxrwxr-x 14 100 users 4096 Apr 13 2017 db-6.2.32
drwxr-xr-x 2 root root 4096 Jun 19 2018 dev
drwxr-xr-x 29 root root 4096 Jun 22 2018 etc
drwxrwxr-x 14 1000 1000 4096 May 26 2018 expat-2.1.0
drwxr-xr-x 11 root root 4096 May 28 2018 flex-2.6.0
drwxrwxr-x 22 1000 1000 4096 May 27 2018 fontconfig-2.13.0
drwxr-xr-x 8 1000 users 4096 May 27 2018 freetype-2.9.1
drwxr-xr-x 2 root root 4096 May 26 2018 getconf-master
drwxr-xr-x 10 root root 4096 May 27 2018 gettext-0.19.8.1
drwxr-xr-x 27 root root 20480 Jun 1 2018 git-master
drwxr-xr-x 16 1001 root 4096 May 27 2018 gmp-6.1.2
drwxr-xr-x 7 root root 4096 May 27 2018 gperf-3.1
drwxr-sr-x 12 root 40 4096 May 28 2018 httpd-2.4.33
drwxr-xr-x 13 root root 4096 May 29 2018 imap-2007f
-rwxr-xr-x 1 root root 78 Nov 18 2017 init
drwxr-xr-x 4 500 users 8192 May 27 2018 jpeg-9c
drwxr-xr-x 11 root root 4096 Jun 21 2018 lib
drwxrwxr-x 15 root root 4096 May 27 2018 libgd-gd-2.2.5
drwxr-xr-x 22 root root 4096 May 26 2018 libiconv-1.15
drwxr-xr-x 7 1000 1000 4096 May 26 2018 libmbfl-1.2.0
drwxrwxrwx 9 500 adm 4096 May 26 2018 libmcrypt-2.5.8
drwxr-xr-x 13 179 1001 8192 Apr 7 2020 libpcap-1.9.1
drwxr-xr-x 12 1004 5101 4096 May 27 2018 libpng-1.6.34
drwxr-xr-x 13 1000 1000 4096 May 27 2018 libssh2-1.8.0
drwxr-xr-x 10 root root 4096 Feb 18 2019 libtorrent
drwxrwxr-x 4 1000 1000 4096 May 27 2018 libuuid-1.0.3
drwxrwxr-x 19 1000 1000 8192 May 28 2018 libxml2-2.9.8
drwxr-xr-x 13 root root 4096 May 31 2018 lynx2-8-8
drwxr-xr-x 4 root root 4096 May 26 2018 lzip-1.19
drwxr-xr-x 10 root root 4096 May 26 2018 mhash-0.9.9.9
drwxr-xr-x 2 root root 4096 May 28 2018 mnt
-rw-r--r-- 1 root root 1374500 Dec 6 2009 mpfr-2.4.0.tar.gz
drwxr-xr-x 11 root root 4096 Feb 18 2019 musl-1.1.16
drwxr-xr-x 2 root root 4096 May 28 2018 musl_crypt
drwxrwxrwx 32 7155 10 4096 May 27 2018 mysql-5.1.73
drwxr-xr-x 18 1001 users 4096 May 27 2018 ncurses-6.1
drwxr-xr-x 18 root root 4096 May 26 2018 openssl-1.1.0h
drwxr-xr-x 2 root root 4096 Nov 18 2017 overlay
drwxr-xr-x 9 1169 1169 8192 May 27 2018 pcre-8.42
drwxr-xr-x 8 1169 1169 4096 May 26 2018 pcre2-10.31
drwxr-xr-x 27 544 513 8192 May 26 2018 perl-5.26.2
drwxr-xr-x 19 root root 4096 May 30 2018 php-7.2.6
drwxrwxr-x 5 1000 1000 4096 May 27 2018 pkg-config-0.29.2
drwxr-xr-x 2 root root 4096 Nov 18 2017 proc
drwxr-xr-x 2 root root 4096 Nov 18 2017 rom
drwxr-xr-x 4 root root 4096 Jun 21 2018 root
drwxr-xr-x 9 root root 4096 Feb 18 2019 rtorrent
drwxr-xr-x 2 root root 4096 Jun 21 2018 sbin
drwxr-xr-x 22 root root 4096 Jun 20 2018 sendmail-8.15.2
drwxr-xr-x 9 556 21 4096 Apr 7 2020 ssldump-0.9b3
-rw-r--r-- 1 root root 137435 Apr 7 2020 ssldump-0.9b3.tar.gz
drwxr-xr-x 2 root root 4096 Nov 18 2017 sys
drwxr-xr-x 2 29189 29189 4096 May 25 2018 termcap-1.3.1
drwxr-xr-x 12 1107 5100 4096 May 27 2018 tiff-4.0.9
drwxrwxrwt 2 root root 4096 May 25 2018 tmp
drwxr-xr-x 25 root root 4096 Jun 21 2018 usr
drwxr-xr-x 6 root root 4096 May 27 2018 uuid-1.6.2
lrwxrwxrwx 1 root root 4 May 25 2018 var -> /tmp
drwxr-xr-x 4 root root 4096 Nov 18 2017 www
drwxr-xr-x 6 root root 4096 Feb 17 2019 xmlrpc-c
drwxr-xr-x 14 root root 4096 May 28 2018 zlib-1.2.11
root@LEDE:~#