before everything you must install and download something for ready.
we are using Ubuntu 18
Install some software
apt-get install repo git u-boot-tools device-tree-compiler mtools parted libudev-dev libusb-1.0-0-dev python-linaro-image-tools linaro-image-tools gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu autoconf autotools-dev libsigsegv2 m4 intltool libdrm-dev curl sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio python unzip rsync file bc wget libncurses5 libqt4-dev libglib2.0-dev libgtk2.0-dev libglade2-dev cvs mercurial rsync openssh-client subversion asciidoc w3m dblatex graphviz python-matplotlib libssl-dev pv e2fsprogs fakeroot devscripts libi2c-dev libncurses5-dev texinfo liblz4-tool genext2fs libc6-i386 lib32stdc++6 netpbm
git clone https://github.com/yeacreate-opensources/rockchip-mkbootimg.git
apt-get install libssl-dev
cd rockchip-mkbootimg/
make
make install
download some repo
cd /home;mkdir ntablet;cd ntablet
git clone https://github.com/yeacreate-opensources/tools.git
git clone https://github.com/yeacreate-opensources/rkbin.git
git clone https://github.com/yeacreate-opensources/kernel.git
git clone https://github.com/yeacreate-opensources/rkbin.git
git clone https://github.com/yeacreate-opensources/prebuilts.git
git clone https://github.com/yeacreate-opensources/rkdocs.git
git clone https://github.com/yeacreate-opensources/ntablet_documents.git
git clone https://github.com/yeacreate-opensources/rkwifibt.git
complie u-boot
./make.sh rk3288-ntablet-870a
you would get uboot.img and trust.img
complie kernel
make ARCH=arm ntablet_870a_5648_defconfig
make ARCH=arm menuconfig //(options)
make ARCH=arm rk3288-ntablet-870a-5648.img -j8
you would get the fllowing files:
arch/arm/boot/zImage
arch/arm/boot/dts/rk3288-ntablet-870a-5648.dtb
resource.img
debian rootfs
su root
apt-get install binfmt-support qemu qemu-user-static debootstrap
mkdir rootfs/debian -p
cd rootfs/
debootstrap --verbose --arch=armhf --foreign stretch debian http://mirrors.ustc.edu.cn/debian/
cd debian
cp /usr/bin/qemu-arm-static usr/bin/
LC_ALL=C LANGUAGE=C LANG=C chroot . /debootstrap/debootstrap --second-stage
LC_ALL=C LANGUAGE=C LANG=C chroot . dpkg --configure -a
chroot .
passwd root
echo "Ntablet" > etc/hostname
echo T0:2345:respawn:/sbin/getty -L ttyS2 115200 vt100 >> etc/inittab
echo deb http://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free > etc/apt/sources.list
echo deb http://security.debian.org/ stretch/updates main contrib non-free >> etc/apt/sources.list
apt-get update
apt-get dist-upgrade
apt-get install openssh-server
apt-get install locales
echo "en_US.UTF-8 UTF-8" > etc/locale.gen
echo "zh_CN.UTF-8 UTF-8" >> etc/locale.gen
locale-gen
apt-get install wireless-tools wpasupplicant rfkill screen nano wget tar zip bluetooth bluez bluez-tools libbluetooth-dev v4l-utils i2c-tools
exit
cd ..
copy some useful file
cd ..
cp kernel/arch/arm/boot/dts/rk3288-ntablet-870a-5648.dtb ./rootfs/debian/boot/
cp kernel/arch/arm/boot/zImage ./rootfs/debian/boot/
cp rkwifibt/bin/ ./rootfs/debian/ -R
cp rkwifibt/etc/ ./rootfs/debian/ -R
cp rkwifibt/lib/ ./rootfs/debian/ -R
make the first uEnv.txt file
vi ./rootfs/debian/boot/uEnv.txt
fill the fllowing and save:
bootmenu_0=Linux=run boot0;run usbboot;
boot0=load ${devtype} ${devnum}:${partnum} ${kernel_addr_r} /boot/zImage; \
load ${devtype} ${devnum}:${partnum} ${fdt_addr_r} /boot/rk3288-ntablet-870a-5648.dtb; \
env set bootargs console=ttyS2,${baudrate} rw rootwait rootfstype=ext4 root=/dev/mmcblk1p${partnum} init=/sbin/init earlyprintk noinitrd selinux=0; \
bootz ${kernel_addr_r} - ${fdt_addr_r};
make an img file(2G for example)
dd if=/dev/zero of=./disk.img bs=1024 count=2000000
fdisk ./disk.img
then
n
(enter)
(enter)
w
format this img
mkfs.ext4 -F -L home disk.img
mount it:
mkdir /tmp/rootfs
mount ./disk.img /tmp/rootfs
go to the debian folder:
cd rootfs/debian
tar --exclude=qemu-arm-static -cf - . | tar -C /tmp/rootfs -xvf -
sync
cd ../..
umount the disk.img:
sync
umount /tmp/rootfs/
resize it and make it smaller
e2fsck -p -f ./disk.img
resize2fs -M ./disk.img
now, you get the disk.img
pack firmware
chown xxx.xxx disk.img //change the permission for the disk.img
cd tools/linux/Linux_Pack_Firmware/rockdev/Image/
cp ../../../../../u-boot/rk3288_loader_v1.08.254.bin ./ //copy the loader from u-boot
cp ../../../../../u-boot/uboot.img ./ //copy the uboot image from u-boot
cp ../../../../../u-boot/trust.img ./ //copy the trust image from u-boot
cp ../../../../../disk.img ./ //copy the disk image
cp ../../../../../kernel/resource.img ./ //copy the resource image from kernel
cd ..
./mkupdate.sh
now, you would get a update.img in the rockdev folder. just flash it into your Ntablet
Enjoy