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

Difference between revisions of "RockpiN10/Android8"

(Installation)
 
Line 98: Line 98:
 
     radxa$ cd kernel
 
     radxa$ cd kernel
 
     radxa$ make rockchip_defconfig
 
     radxa$ make rockchip_defconfig
 +
    # for core board older than version v1.3
 
     radxa$ make rk3399pro-rockpi-n10-android.img -j$(nproc)
 
     radxa$ make rk3399pro-rockpi-n10-android.img -j$(nproc)
 +
    # for new core board
 +
    radxa$ make rk3399pro-rockpi-n10-v1.3-android.img -j$(nproc)
 
     radxa$ cd ..
 
     radxa$ cd ..
 
</code>
 
</code>

Latest revision as of 06:22, 12 August 2021


    RockpiN10 >  Build Android 8.1

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

Install Repo

   radxa$ wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P /tmp/
   radxa$ sudo cp /tmp/repo /usr/local/bin/repo
   radxa$ sudo chmod +x /usr/local/bin/repo

For Chinese users or the countries the Google is blocked:

   radxa$ echo "export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'" >> ~/.bashrc
   radxa$ source ~/.bashrc
   radxa$ curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o /tmp/repo
   radxa$ sudo cp /tmp/repo /usr/local/bin/repo
   radxa$ sudo chmod +x /usr/local/bin/repo

Init Environment

Android's source code primarily consists of Java, C++, and XML files.
To compile the source code, you'll need to install OpenJDK 8, GNU C and C++ compilers, XML parsing libraries, ImageMagick, and several other related packages.

   radxa$ 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 lzop

Configure the JAVA environment

   radxa$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
   radxa$ export PATH=$JAVA_HOME/bin:$PATH
   radxa$ export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar

DockerFile

   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 lzop
   RUN curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > /usr/local/bin/repo && \
       chmod +x /usr/local/bin/repo
   RUN which repo
   ENV REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/' USER=android8-docker
   ARG USER_ID=0
   ARG GROUP_ID=0
   RUN groupadd -g ${GROUP_ID} jenkins-docker && useradd -m -g jenkins-docker -u ${USER_ID} android8-docker
   USER android8-docker

Build DockerFile

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

Download source code

   radxa$ mkdir rockpi-n10-android8
   radxa$ cd rockpi-n10-android8

Then run:

   radxa$ repo init -u https://github.com/radxa/manifests.git -b rk3399pro-android-8.1 -m rk3399pro-rk-vendor-release.xml
   radxa$ repo sync -d --no-tags -j4

It might take quite a bit of time to fetch the entire AOSP source code(around 86G)!

Build u-boot

   radxa$ cd u-boot
   radxa$ ./make.sh rk3399pro_dual
   radxa$ cd ..

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

Building kernel

For HDMI 4K

   radxa$ cd kernel
   radxa$ make rockchip_defconfig
   # for core board older than version v1.3
   radxa$ make rk3399pro-rockpi-n10-android.img -j$(nproc)
   # for new core board
   radxa$ make rk3399pro-rockpi-n10-v1.3-android.img -j$(nproc)
   radxa$ 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$ source build/envsetup.sh
   radxa$ lunch rk3399pro-userdebug
   radxa$ make -j$(nproc)

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

Generate images

   radxa$ ln -s RKTools/linux/Linux_Pack_Firmware/rockdev/ rockdev
   radxa$ ./mkimage.sh ota

The generated images under rockdev/Image-rk3399pro are

   ├── boot.img
   ├── idbloader.img
   ├── kernel.img
   ├── MiniLoaderAll.bin
   ├── misc.img
   ├── oem.img
   ├── parameter.txt
   ├── ramdisk.img
   ├── recovery.img
   ├── resource.img
   ├── system.img
   ├── trust.img
   ├── uboot.img
   ├── update.img
   └── vendor.img

Generated Image

   radxa$ cd rockdev
   radxa$ ln -s Image-rk3399pro Image

1. RkUpdate Image

   radxa$ ./mkupdate.sh

The images under rockdev/ are `update.img`

Installation