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

Difference between revisions of "Rockpi4/rockpi-android10"

(Created page with "__NOTOC__ {{rockpi4_header}} {{Languages|Rockpi4/rockpi-android10}} ROCK Pi 4 > Android10 Recommend build host is Ubuntu 16...")
 
Line 28: Line 28:
 
==== DockerFile ====
 
==== DockerFile ====
 
<code>
 
<code>
FROM ubuntu:xenial
+
    FROM ubuntu:xenial
  
RUN apt-get update -y && apt-get install -y openjdk-8-jdk python git-core gnupg flex bison gperf build-essential \
+
    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 \
+
        zip curl liblz4-tool zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
    lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
+
        lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
    libgl1-mesa-dev libxml2-utils xsltproc unzip mtools u-boot-tools \
+
        libgl1-mesa-dev libxml2-utils xsltproc unzip mtools u-boot-tools \
    htop iotop sysstat iftop pigz bc device-tree-compiler lunzip \
+
        htop iotop sysstat iftop pigz bc device-tree-compiler lunzip \
    dosfstools vim-common parted udev libssl-dev python3 python-pip lzop swig
+
        dosfstools vim-common parted udev libssl-dev python3 python-pip lzop swig
  
#### For China
+
    #### For China
RUN curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > /usr/local/bin/repo && \
+
    RUN curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > /usr/local/bin/repo && \
    chmod +x /usr/local/bin/repo && \
+
        chmod +x /usr/local/bin/repo && \
    which repo
+
        which repo
ENV REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
+
    ENV REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
#### For China End
+
    #### For China End
  
RUN pip install pycrypto
+
    RUN pip install pycrypto
ENV USER=android10-docker
+
    ENV USER=android10-docker
ARG USER_ID=0
+
    ARG USER_ID=0
ARG GROUP_ID=0
+
    ARG GROUP_ID=0
RUN groupadd -g ${GROUP_ID} jenkins-docker && useradd -m -g jenkins-docker -u ${USER_ID} android9-docker
+
    RUN groupadd -g ${GROUP_ID} jenkins-docker && useradd -m -g jenkins-docker -u ${USER_ID} android9-docker
  
USER android10-docker
+
    USER android10-docker
 
</code>
 
</code>
  

Revision as of 02:10, 29 May 2020


ROCK Pi 4 > Android10


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

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

In China Download Repo:

   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

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 libssl-dev python3 python-pip lzop swig
   #### For China
   RUN curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > /usr/local/bin/repo && \
       chmod +x /usr/local/bin/repo && \
       which repo
   ENV REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
   #### For China End
   RUN pip install pycrypto
   ENV USER=android10-docker
   ARG USER_ID=0
   ARG GROUP_ID=0
   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

Build u-boot

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

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

Building kernel

For HDMI 4K

   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/envsetup.sh
   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$ ./mkimage.sh

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$ ./mkupdate.sh

The images under rockdev/ are `update.img`

Installation

RkUpdate Image Install on eMMC module