Downloading and Compiling Rockchip RK3588 Source Code (Based on Android 13)

Downloading and Compiling Rockchip RK3588 Source Code (Based on Android 13)

Downloading and Compiling Rockchip RK3588 Source Code (Based on Android 13)

Source Code Download

Download Link

repo init --repo-url https://gerrit.rock-chips.com:8443/repo-release/tools/repo
-u https://gerrit.rock-chips.com:8443/Android_T/manifests.git -m Android13.xml

Server Mirror Download

repo init --repo-url https://gerrit.rock-chips.com:8443/repo-release/tools/repo
-u https://gerrit.rock-chips.com:8443/Android_T/manifests.git -m Android13.xml -mirror

You need to apply for SDK usage permission from RK.

Since AOSP uses repo to manage source code repositories, RK also provides a download for the repo tool for developers.

git clone https://gerrit.rock-chips.com:8443/repo-release/tools/repo

How to Set Up Your Own Repo Server

This article describes how to write an article about setting up your own repo code server using Markdown. Below are the detailed steps and guidance.

Environment Preparation

Before starting, you need to install the following packages:

  • openssh-server: for remote server login

  • git: for project management

  • keychain: for public and private key management tool

You can use the following command to install them on Linux:

sudo apt-get install openssh-server git keychain

Setting Up Gitolite

Server-side Operations

Taking the server address 10.10.10.206 as an example:

  1. 1. Create a system user named git:

sudo adduser --system --shell /bin/bash --group git
sudo passwd git
  1. 1. Log in to the server using the git user.

  2. 2. Ensure that the ~/.ssh/authorized_keys file is empty or does not exist.

  3. 3. Copy the server administrator’s public key to the ~/YourName.pub file.

  4. 4. Download the Gitolite source code:

git clone https://github.com/sitaramc/gitolite.git
  1. 1. Create a directory named bin in the git user’s home directory:

mkdir -p ~/bin
  1. 1. Execute the following command to install Gitolite (installation methods may vary for different versions, please refer to the documentation in the source code):

gitolite/install -to ~/bin
  1. 1. Set administrator permissions:

~/bin/gitolite setup -pk YourName.pub

Client-side Operations

  1. 1. Clone the Gitolite admin repository on the server:

git clone ssh://[email protected]/gitolite-admin.git
  1. 1. Add the user’s public key to the gitolite directory under the keydir directory:

cp username.pub keydir/username.pub
  1. 1. Add the admin user. Open the conf/gitolite.conf file and add the admin username to the @admin group:

@admin = admin1 admin2 admin3
repo gitolite-admin
RW+     =   @admin

Setting Up Repo Mirror

Server-side Operations

  1. 1. Log in to the server using the git account.

  2. 2. Download the Repo tool in the root directory:

git clone https://gerrit.rock-chips.com:8443/repo-release/tools/repo
  1. 1. Create a directory named RK_Android13_mirror:

mkdir RK_Android13_mirror
  1. 1. Enter the RK_Android13_mirror directory:

cd RK_Android13_mirror
  1. 1. Download the RK Android13 SDK mirror:

repo init --repo-url https://gerrit.rock-chips.com:8443/repo-release/tools/repo
-u https://gerrit.rock-chips.com:8443/Android_T/manifests.git -m Android13.xml -mirror
  1. 1. Create repository group permissions:

.repo/repo/repo list -n > android_t.conf
sed -i 's/^/@android_t = RK_Android13_mirror\/&/g' android_t.conf

Client-side Operations

Below are the steps to download and operate the repo on the client:

  1. 1. Download the manifests_xxx repository

Download the manifests_xxx.git repository on other client computers:

git clone ssh://[email protected]/Android_T/manifests_xxx.git
  1. 1. Download the original manifests repository

Download the original manifests repository:

git clone ssh://[email protected]/Android_T/manifests.git
  1. 1. Submit the manifest.xml file to the manifests_xxx repository

Copy the files from the original manifests into manifests_xxx, you can use the following command:

cd manifests_xxx
cp -rf manifests/*.xml manifests_xxx/

Check the copied files:

git status

It will display the following files:

Android13.xml
Android13_Express.xml
default.xml
include/rk3326_repository.xml
include/rk356x_repository.xml
include/rk_checkout_from_aosp.xml
include/rk_modules_repository.xml
remote.xml      
remove_t.xml 

Then perform a local commit:

git add -A
git commit -m "init xxx"

Finally, push the changes to the remote branch:

git push origin master:master
  1. 1. Create your own code download link

Download the repo tool in the root directory:

git clone https://gerrit.rock-chips.com:8443/repo-release/tools/repo

After following the above steps, your code download link will be as follows:

mkdir Android13
cd Android13
~/repo/repo init -u ssh://[email protected]/Android_T/manifests_xxx.git -m Android13.xml

Where //10.10.10.206 is your server address.

By following the above steps, you can complete the setup of your own repo server and share your code server link with colleagues for collaborative work.

Code Compilation

RK provides a one-click compilation command to facilitate developers to compile the source code as needed.

./build.sh -UKAup
( WHERE: -U = build uboot
      -C = build kernel with Clang
      -K = build kernel
      -A = build android
      -p = will build packaging in IMAGE
      -o = build OTA package
      -u = build update.img
      -v = build android with 'user' or 'userdebug'
      -d = huild kernel dts name
      -V = build version
      -J = build jobs

Note: Before executing the one-click compilation command, you need to lunch the required project, taking the rk3588_t project as an example.

source build/envsetup.sh
lunch rk3588_t-userdebug

Creating a New Product Lunch

Taking the RK3588 platform as an example to create a new rk3588s_t product:

  1. 1. Modify the device/rockchip/rk3588/AndroidProducts.mk file to add rk3588s_t’s lunch:

--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -17,10 +17,14 @@
 PRODUCT_MAKEFILES := \
        $(LOCAL_DIR)/rk3588_t/rk3588_t.mk \
+       $(LOCAL_DIR)/rk3588s_t/rk3588s_t.mk \

 COMMON_LUNCH_CHOICES := \
    rk3588_t-userdebug \
    rk3588_t-user \
+   rk3588s_t-userdebug \
+   rk3588s_t-user \
  1. 1. Create a directory named rk3588s_t under the device/rockchip/rk3588 directory:

Refer to the existing rk3588_t product directory under device/rockchip/rk3588 to create a new one. You can directly copy the rk3588_t directory and rename it to rk3588s_t, then change all rk3588_t strings in the rk3588s_t directory to rk3588s_t.

After completing the above steps, you have successfully added the lunch option and created the rk3588s_t product directory under device/rockchip/rk3588.

RK Upgrade Tool

The project root directory RKTools contains the upgrade_tool and fastboot tools, including Linux and Windows versions, which can be used as needed.

Upgrade Tool

Flash the entire firmware

$ upgrade_tool UF ~/Downloads/update.img

upgrade_tool -h to view the tool usage.

Downloading and Compiling Rockchip RK3588 Source Code (Based on Android 13)

Fastboot

Fastboot is a debugging tool provided by Android, used in conjunction with adb. This tool can flash individual partitions.

Flash dynamic partitions

adb reboot fastboot
fastboot flash vendor vendor.img
fastboot flash system system.img
fastboot flash odm odm.img

fastboot -h to view the tool usage.

Downloading and Compiling Rockchip RK3588 Source Code (Based on Android 13)

Leave a Comment

×