Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search


ROCK Pi 4 > Android10

Recommend build host is Ubuntu 16.04 64bit, for other hosts, refer official Android documents Establishing a Build Environment.


   radxa$ wget '' -P /tmp/
   radxa$ sudo cp /tmp/repo /usr/local/bin/repo
   radxa$ sudo chmod +x /usr/local/bin/repo

In China Download Repo:

   radxa$ echo "export REPO_URL=''" >> ~/.bashrc
   radxa$ source ~/.bashrc
   radxa$ curl -o /tmp/repo
   radxa$ sudo cp /tmp/repo /usr/local/bin/repo
   radxa$ sudo chmod +x /usr/local/bin/repo


   FROM ubuntu:xenial
   RUN apt-get update -y && apt-get install -y openjdk-8-jdk python git-core gnupg flex bison gperf build-essential \
       zip curl liblz4-tool zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
       lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
       libgl1-mesa-dev libxml2-utils xsltproc unzip mtools u-boot-tools \
       htop iotop sysstat iftop pigz bc device-tree-compiler lunzip \
       dosfstools vim-common parted udev libssl-dev python3 python-pip lzop swig
   #### For China
   RUN curl > /usr/local/bin/repo && \
       chmod +x /usr/local/bin/repo && \
       which repo
   #### For China End
   RUN pip install pycrypto
   ENV USER=android10-docker
   RUN groupadd -g ${GROUP_ID} jenkins-docker && useradd -m -g jenkins-docker -u ${USER_ID} android9-docker
   USER android10-docker

Build DockerFile

   radxa$ docker build -t android-builder:10.x --build-arg USER_ID=`id -u` --build-arg GROUP_ID=`id -g` $(which-dir-dockerfile-in)

Download source code

   $ mkdir rockpi4-android-10
   $ cd rockpi4-android-10

Then run:

   $ repo init -u -b rockchip-android-10 -m rockchip-q-release.xml 
   $ repo sync -d --no-tags -j4

Build u-boot

   radxa:rockpi4-android10       $ cd u-boot
   radxa:rockpi4-android10/u-boot$ ./ rk3399
   radxa:rockpi4-android10/u-boot$ cd ..

The generated images are **rk3399_loader_v_xxx.bin** , and **uboot.img**

Building kernel


   radxa:rockpi4-android10       $ cd kernel
   radxa:rockpi4-android10/kernel$ make rockchip_defconfig
   radxa:rockpi4-android10/kernel$ make rk3399-rockpi-4b.img -j$(nproc)
   radxa:rockpi4-android10/kernel$ cd ..

The generated images are **kernel.img** and **resource.img**:

  1. kernel.img, kernel with rkcrc checksum
  2. resource.img, contains dtb and boot logo, Rockchip format resource package

Building AOSP

Android Tablet:

   radxa:rockpi4-android10$ source build/
   radxa:rockpi4-android10$ lunch rk3399_Android10-userdebug
   radxa:rockpi4-android10$ make -j$(nproc)

It takes a long time, take a break and wait...

Generate images

   radxa:rockpi4-android10$ ln -s RKTools/linux/Linux_Pack_Firmware/rockdev/ rockdev
   radxa:rockpi4-android10$ ./

Generated Image

Android Tablet

   radxa:rockpi4-android10        $ cd rockdev
   radxa:rockpi4-android10/rockdev$ ln -s Image-rk3399_Android10 Image

1. RkUpdate Image

   radxa:rockpi4-android10/rockdev$ ./

The images under rockdev/ are `update.img`


RkUpdate Image Install on eMMC module