Getting the source code
Please refer to
https://github.com/cubieboard2/manifests
Building with your own linux distro rootfs
$ ./build.sh rootfs/your_own_rootfs.tar.gz