Build Ubuntu with the legacy kernel for Orange PI Zero Plus2 H5

Written on August 6, 2018 by thanh



  1. Ubuntu 16.04 or higher x64 Bare-metal / VM
  2. 10 GB of available hard disk space and 2GB or more free of RAM
  3. Internet connection for clone source code

Note: Although OrangePI (aka Xunlong) provider their build script to build custom image but missing importance library for multimedia, video decode and graphics (

So you can build a new image with hardware acceleration to decode video for yourself and hack something inside image by choosing from the configurations available below.


  1. Get/Update toolchain, blob, build script, binary firmware and source code
  2. Start the build. This will automatically compile uboot, Image kernel, package packages, and finally generate an image ready to be flashed.
  3. Proceed to installing image

Note: The legacy uboot source code for Soc H5 was provided by Xunlong but missing ARM trusted firmware source code (binary included instead)

Checking out source

mkdir -p ~/buildroot
cd ~/buildroot

# Build script
git clone scripts

# Binary blob / prebuild firmware
git clone external

# uBoot source code
git clone uboot

# Kernel source code
git clone kernel

ln -sf script/

Install toolchain

cd ~/buildroot
# Toolchain
git clone toolchain
cd toolchain

ROOT=`cd .. && pwd`

tar xzvf $TOOLTAR -C $TOOLS


Build board support package

Supported cross platform build:

  • libcedrus: Sunxi Video Engine library.
  • libvdpau-sunxi: VDPAU for Allwinner sunxi SoCs.
cd ~/buildroot

# Type 6 for Build Board Support Packages

Building Images

cd ~/buildroot

# Type 0 for build image

Proceed to installing image

cd ~/buildroot
sudo apt-get install -y dc3dd
sudo dc3dd if=out/image/OrangePiH5_Zero_Plus2.img of=/dev/mmcblX <~ replace x by sdcard device
sudo sync