(DEPRICATED, now we use debian-build-script)

Geting Tools and Firmware

tools

Creating System Image

Create disk image

dd if=/dev/zero of=rockchip.img bs=1M count=3000

Create device maps
sudo kpartx -av rockchip.img

Format image
cat << EOF | sudo gdisk /dev/loop0
o
y
n
1

+4000k

n
2

+64K

n
3

+4M

n
4

+4M

n
5

+4M

n
6

+128M

n
7

w
y
EOF
cat << EOF | sudo gdisk /dev/loop0
x
a
6
2

w
y
EOF
cat << EOF | sudo gdisk /dev/loop0
c
1
loader1
c
2
reserved1
c
3
reserved2
c
4
loader2
c
5
atf
c
6
boot
c
7
rootfs
w
y
EOF
sudo mkfs.fat /dev/mapper/loop0p6
sudo mkfs.ext4 /dev/mapper/loop0p7

Write uboot
tools/mkimage -n rk3288 -T rksd -d spl/u-boot-spl-dtb.bin out&&
sudo dd if=out of=/dev/loop0 seek=64&&sudo dd if=u-boot-dtb.img of=/dev/loop0 seek=256

Copy zimage and dts file to /dev/mapper/loop0p6
sudo mount /dev/mapper/loop0p6 ../boot
sudo cp arch/arm/boot/zImage ../boot/
sudo cp arch/arm/boot/dts/rk3288-fennec.dtb ../boot/rk3288-fennec.dtb

Add extlinux/extlinux.conf to /dev/mapper/loop0p6

label kernel-4.4
    kernel /zImage
    fdt /rk3288-fennec.dtb
    append  earlyprintk console=ttyS2,115200n8 rw root=/dev/mmcblk2p7 rootfstype=ext4 init=/sbin/init

Write rootfs
sudo dd if=linaro-rootfs.img of=/dev/mapper/loop0p7 conv=notrunc

Detach image
sudo umount /dev/mapper/loop0p6 
sudo kpartx -d rockchip.img

Flashing System Image

Press maskrom and reset board

sudo upgrade_tool db rk3288_boot.bin
sudo upgrade_tool wl 0 rockchip.img