Yocto has a powerful customization architecture that allows people create their own custom Linux distribution for their projects. Compare to the desktop linux distribution(debian), it's more flexible to develop system/applcation on yocto. For examples, when we want to cross-compile gstreamer-rockchip on debian, we need prepare debian docker and debian rules, but on yocto, it just need a single bitbake file.
Though it have lots of advantages, it's not recommended to use it to bring up new boards unless you are familier with rockchip stuff and yocto itself. Please follow the Linux_user_guide and start development with standalone kernel/u-boot!
Getting the Sources
The rockchip linux SDK source tree is located in multi Git repository hosted by Github.
The SDK uses repo to sync down source code.
Create an empty directory to hold your working files
mkdir rk-yocto-bsp cd rk-yocto-bsp
To initialize Yocto SDK source tree
repo init --repo-url=https://github.com/rockchip-linux/repo -u https://github.com/rockchip-linux/manifests -b yocto repo sync
The above command will choose "master" branch of poky (rolling update).
If you want to use a stable yocto branch, then use below comands.
repo init --repo-url=https://github.com/rockchip-linux/repo -u https://github.com/rockchip-linux/manifests -b yocto -m pyro.xml
Building the Sources
The essential and graphical support packages you need for a supported Ubuntu or Debian distribution are shown in the following command. see here for detail.
sudo apt-get install gawk wget git-core diffstat unzip texinfo build-essential chrpath socat cpio python python3 pip3 pexpect libsdl1.2-dev xterm make xsltproc docbook-utils fop dblatex xmlto python-git libssl-dev pv
Setup Yocto Environment
For example, if you want to build a x11 backend image for tinker board, you should use "MACHINE=tinker-rk3288 DISTRO=rk-x11", if you want to use qt eglfs, then change "DISTRO" to "rk-none".
Please see Available for available machines and distros.
mkdir <build_dir> MACHINE=<MACHINE> DISTRO=<DISTRO> . ./setup-environment -b <build_dir>
Now you can find images under <build_dir>/tmp/deploy/images/<MACHINE>/.
*gpt.img is as same as system.img, which conatins the complete image.
./flash_tool.sh -c rk3288 -p system -i <build_dir>/tmp/deploy/images/<MACHINE>/*gpt.img
./flash_tool.sh -c rk3288 -d /dev/sdc -p system -i <build_dir>/tmp/deploy/images/<MACHINE>/*gpt.img
./flash_tool.sh -c rk3288 -p rootfs -i <build_dir>/tmp/deploy/images/<MACHINE>/*.ext4
./flash_tool.sh -c rk3288 -p boot -i <build_dir>/tmp/deploy/images/<MACHINE>/*boot.img
To update u-boot, it's kind of complex, please refer to Boot_option. All necessary binarys can be found in the deploy directory and rkbin directory.
Meta-rockchip layer support mainline kernel and have patch it for GPU/VPU features.
To use mainline kernel, please change
in machine/include/*.conf to
Mainline U-boot/ARM-Trust-Firmware are also available, by including
There are some demo layers under meta-rockchip-extra/demo.
|QT Player||A play based on QT EGLFS plugin + QTMultimedia, make the video layer at the bottom, since we don't have hardware osd layer.|
There are some special layers.
|rk-image-base||Rockchip base Image.|
|rk-image-multimedia||Image with Rockchip's multimedia packages.|
|rk-image-machine-test||Image with Test tools for developing, testing and benchmark.|
|qt5-image||Image with qt packages.|
All build files and code source can be found in the tmp/work/ or tmp/work-shared subdirectory of the Build Directory.
e.g : u-boot : tmp/work/excavator_rk3399-rk-linux/u-boot-rockchip/20170901-r0/git
Once you have update the code, you should issue command like "bitbake u-boot-rockchip -c compile -f && bitbake u-boot-rockchip" to force it recompile and deploy.
- To make an image for suitable of development, you can add "tools-debug debug-tweaks dbg-pkgs" to EXTRA_IMAGE_FEATURES in local.conf to get tools like gdb and add " sshfs-fuse dhcp-client" to "IMAGE_INSTALL_append" to use sshfs for remote transfer. e.g. EXTRA_IMAGE_FEATURES = "tools-debug tools-profile tools-testapps dbg-pkgs debug-tweaks" IMAGE_INSTALL_append = “ sshfs-fuse dhcp-client”
- To use local source, you could change SRC_URI in bb file to "git:///home/debian/kernel.git;protocol=file;nocheckout=1;branch=release-4.4"