=Install repo=

 git clone https://github.com/friendlyarm/repo
 sudo cp repo/repo /usr/bin/

=Download Source Codes=

 mkdir friendlywrt-rk3399
 cd friendlywrt-rk3399
 repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v19.07.5 \
     -m rk3399.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle
 repo sync -c  --no-clone-bundle

=Setup Development Environment=

 wget https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh
 chmod +x install.sh
 ./install.sh

=Build System=
 ./build.sh nanopi_r4s.mk

Image will be generated in out directory.

Added external packages (optional)
 cd friendlywrt/package
 git clone https://github.com/jerrykuku/lua-maxminddb.git
 git clone https://github.com/jerrykuku/luci-app-vssr.git
 git clone https://github.com/xiaorouji/openwrt-passwall.git
 cd ..
 make menuconfig #Enable luci-app-vssr & proxy applications
 cd ..

 ./build.sh friendlywrt
 ./build.sh sd-img