Skip to content
Switch branches/tags

sd-fuse_rk3399 for kernel-4.4.y

Create bootable SD card for NanoPC T4/NanoPi R4S/NanoPi M4/Som-RK3399/NanoPi NEO4

Note: Since RK3399 contains multiple different versions of kernel and uboot, please refer to the table below to switch this repo to the specified branch according to the OS

OS branch image directory name
[ ]friendlywrt kernel-5.10.y friendlywrt
[ ]friendlywrt-kernel4 kernel-4.19 friendlywrt-kernel4
[ ]friendlycore focal kernel-4.19 friendlycore-focal-arm64
[ ]friendlycore lite focal (kernel5.x) kernel-5.10.y friendlycore-lite-focal-kernel5-arm64
[ ]friendlycore lite focal (kernel4.x) kernel-4.19 friendlycore-lite-focal-kernel4-arm64
[ ]android10 kernel-4.19 android10
[*]friendlydesktop bionic master friendlydesktop-arm64
[*]friendlycore bionic master friendlycore-arm64
[*]lubuntu xenial master lubuntu
[*]eflasher master eflasher
[-]android8 master android8
[-]android7 master android7

How to find the /dev name of my SD Card

Unplug all usb devices:

ls -1 /dev > ~/before.txt

plug it in, then

ls -1 /dev > ~/after.txt
diff ~/before.txt ~/after.txt

Build friendlycore bootable SD card

git clone -b master
cd sd-fuse_rk3399
sudo ./ /dev/sdX friendlycore-arm64

Notes: will check the local directory for a directory with the same name as OS, if it does not exist will go to download it from network.
So you can download from the netdisk in advance, on netdisk, the images files are stored in a directory called images-for-eflasher, for example:

cd sd-fuse_rk3399
tar xvzf /path/to/NETDISK/images-for-eflasher/friendlycore-arm64-images.tgz
sudo ./ /dev/sdX friendlycore-arm64

Build an sd card image

First, download and unpack:

git clone -b master
cd sd-fuse_rk3399
tar xvzf friendlycore-arm64-images.tgz

Now, Change something under the friendlycore-arm64 directory, for example, replace the file you compiled, then build friendlycore-arm64 bootable SD card:

sudo ./ /dev/sdX friendlycore-arm64

or build an sd card image:

sudo ./ friendlycore-arm64

The following file will be generated:


You can use dd to burn this file into an sd card:

dd if=out/rk3399-sd-friendlycore-bionic-4.4-arm64-20181112.img of=/dev/sdX bs=1M

Build an sdcard-to-emmc image (eflasher rom)

Enable exFAT file system support on Ubuntu:

sudo apt-get install exfat-fuse exfat-utils

Generate the eflasher raw image, and put friendlycore image files into eflasher:

git clone
cd sd-fuse_rk3399
tar xzf emmc-flasher-images.tgz
tar xzf friendlycore-arm64-images.tgz
sudo ./ friendlycore-arm64

The following file will be generated:


You can use dd to burn this file into an sd card:

dd if=out/rk3399-eflasher-friendlycore-bionic-4.4-arm64-20181112.img of=/dev/sdX bs=1M

Replace the file you compiled

Install cross compiler and tools

Install the package:

sudo apt install liblz4-tool
sudo apt install android-tools-fsutils
sudo apt install swig
sudo apt install python-dev python3-dev

Install Cross Compiler:

git clone -b master --depth 1 friendlyelec-toolchain
(cd friendlyelec-toolchain/gcc-x64 && cat toolchain-6.4-aarch64.tar.gz* | sudo tar xz -C /)

Build U-boot and Kernel for Lubuntu, FriendlyCore and FriendlyDesktop

Download image files:

cd sd-fuse_rk3399
tar xzf lubuntu-desktop-images.tgz
tar xzf friendlycore-arm64-images.tgz
tar xzf friendlydesktop-arm64-images.tgz

Build kernel, the relevant image files in the images directory will be automatically updated, including the kernel modules in the file system:

cd sd-fuse_rk3399
git clone --depth 1 -b nanopi4-linux-v4.4.y out/kernel-rk3399
# lubuntu
KERNEL_SRC=$PWD/out/kernel-rk3399 ./ lubuntu

# friendlycore-arm64
KERNEL_SRC=$PWD/out/kernel-rk3399 ./ friendlycore-arm64

# friendlydesktop-arm64
KERNEL_SRC=$PWD/out/kernel-rk3399 ./ friendlydesktop-arm64

Build uboot:

cd sd-fuse_rk3399
git clone --depth 1 -b nanopi4-v2014.10_oreo uboot-rk3399
UBOOT_SRC=$PWD/uboot-rk3399 ./ lubuntu
UBOOT_SRC=$PWD/uboot-rk3399 ./ friendlycore-arm64
UBOOT_SRC=$PWD/uboot-rk3399 ./ friendlydesktop-arm64

Custom rootfs for Lubuntu, FriendlyCore and FriendlyDesktop

Custom rootfs in the bootable SD card

Use FriendlyCore as an example:

git clone
cd sd-fuse_rk3399

tar xzf rootfs-friendlycore-arm64.tgz

Now, change something under rootfs directory, like this:

echo hello > friendlycore-arm64/rootfs/root/welcome.txt  

Remake rootfs.img:

./ friendlycore-arm64/rootfs friendlycore-arm64

Make sdboot image:

./ friendlycore-arm64

or make sd-to-emmc image (eflasher rom):

./ friendlycore-arm64

Build Android8

git clone --depth 1 -b master
cd rk3399-android-8.1
./ -F -M
tar xzf android-oreo-images.tgz
cp rockdev/Image-nanopc_t4/* android8

Copy the new image files to the exfat partition of the eflasher sd card:

cp -af android8 /mnt/exfat/


Create bootable SD card for NanoPC-T4/NanoPi M4/NanoPi NEO4



No releases published


No packages published