Description
Minimum host computer configuration requirements for compiling the Android14 system:
32-core CPU32GB RAM400GB Storage
I have not tested lower configurations. Configurations below these requirements may experience various unexplained errors.
- Host system:
Ubuntu22.04
SDK Description
- Linux kernel version:
6.1.99 - Device tree:
tspi-3m-rk3576 - Kernel config files:
rk3576_defconfigandroid-14.configrk3576.config
Compile Image
0⃣. Enter SDK root directory:
lckfb@leenixp:~/workspace/build/TaishanPi-3-Android14$ ls
Android.bp RKTools bootable cts device javaenv.sh libnativehelper packages restore_patches.sh system tspi-sdk-init.sh
BUILD WORKSPACE bootstrap.bash dalvik external kernel mkcombinedroot pdk rkbin test u-boot
Copyright_Statement.pdf art build developers frameworks kernel-6.1 mkimage.sh platform_testing rkst toolchain vendor
RKDocs bionic build.sh development hardware libcore mkimage_ab.sh prebuilts sdk2
3
4
5
1⃣. Set environment variables:
source build/envsetup.shFunction Description
The envsetup.sh script initializes the Android build environment, mainly completing the following tasks:
- Load build tools: Load various tools and functions required for Android compilation into the current Shell environment
- Set environment variables: Configure
PATH,TARGET_PRODUCT, and other key environment variables - Provide convenient commands: Provide commonly used build commands like
lunch,mm, etc. - Initialize build system: Prepare the Android build system framework
Each time you open a new terminal window for compilation, you need to execute this command first to initialize the build environment.
2⃣. Select configuration file:
lunch tspi_3m-userdebuglunch Item Configuration Description
tspi_3m-userdebug: For Android14 product, hardware adapted to LCSC-TaishanPi-3M-RK3576 development board. The default corresponding dts file is tspi-3m-rk3576.dts. This compiles the userdebug version, used for development and debugging. (The final generated image size will be larger)tspi_3m-user: For Android14 product, hardware adapted to LCSC-TaishanPi-3M-RK3576 development board. The default corresponding dts file is tspi-3m-rk3576.dts. This compiles the user version, used for production. (The final generated image size is slightly smaller than userdebug version)
3⃣. Start compilation with one click:
./build.sh -UKAup -J$(nproc)Command Explanation
-U: Compile u-boot-K: Compile Kernel-A: Compile android-u: Generate update.img-p: Compile packages and install packages into the image-J: Specify multi-core compilation.$(nproc)will automatically detect the maximum number of CPU threads available on the current host
Other commands:
-C: Build kernel with Clang-o: Build OTA package-v: Build android with 'user' or 'userdebug'-d: Build kernel dts name-V: Build version-S: spl-new
4⃣. Compilation successful:
After compilation, you can find the generated update.img in the rockdev/ directory. Then, according to the method in Finished Image Flashing 🚀 chapter, flash the update.img image to see the system start.