03-Android_SDK_Compilation
SDK Overview
Version Information
Kernel version: 5.4
Android OS version: 12.0
Obtaining the SDK Source Code
Network Disk Download Directory:
1-SDK\Android12.0\
h618-android12.0-xxxxxxxxxx.tar.gz
# Download the latest dated version.Copy the source code archive to the compilation host:
Notes:
Do not compile the source code in a shared directory.
Do not use the ROOT account to log in to the compilation host.
Verify file integrity with MD5:
$ md5sum -c *.md5Extract the source code archive:
$ tar -zxvf *.tar.gzAfter extraction, only the
.gitfolder will be visible. Proceed to the next step to fully restore the source code.
Restore the source code using Git:
$ git reset --hardInitial Compilation Environment Setup
First-time compilation requires environment configuration. Skip this step if the SDK location remains unchanged.
# Navigate to the "longan" directory
$ cd longan
# Execute the configuration command
$ ./build.sh configSelect the following configurations:
Welcome to mkscript setup progress
All available platform:
0. android
1. linux
Choice [android]: 0
All available ic:
0. h618
Choice [h618]: 0
All available board:
0. ft
1. p1
2. p2
3. p7
4. p7l
5. perf1
6. perf2
7. perf3
8. qa
Choice [p2]: 2
All available flash:
0. default
1. nor
Choice [default]: 0
All available kern_ver:
0. linux-5.4
Choice [linux-5.4]: 0
All available arch:
0. arm
1. arm64
Choice [arm64]: 1Return to the previous directory:
$ cd -Select the Target Board:
$ ./build.sh lunch
will lunch sdk
You're building on Linux
Lunch menu...pick a combo:
1. BoardConfig-kickpi-k2b-tablet.mk
2. BoardConfig-kickpi-k2b-tv.mk
3. BoardConfig-kickpi-k2c-tablet.mk
4. BoardConfig-kickpi-k2c-tv.mk
Which would you like? [0]:Note:
BoardConfig-kickpi-'board'-'desktop'
board: Options includek2b/k2c
desktop: Options includetv/tablet
Compile the Full Image
$ ./build.shOutput directory:
longan/out/h618_android12_p2_uart0.img
Troubleshooting: If the Android compilation fails without clear errors, reduce the parallel build processes in
build.sh(e.g., changemake -j32tomake -j8based on your hardware).
Compile Partition Images Separately
Compile U-Boot Only:
$ ./build.sh ubootOutput directory:
longan/out/h618_android12_p2_uart0.img
Compile Kernel Only:
$ ./build.sh kernelOutput directory:
longan/out/h618_android12_p2_uart0.img
Compile Android Only:
$ ./build.sh androidOutput directory:
longan/out/h618_android12_p2_uart0.img
Configure the Kernel
cd longan
./build.sh menuconfigNotes
Ensure the compilation environment has sufficient disk space and memory.
Use
git pullregularly to update the SDK source code.Generated images can be flashed to the target device using tools like
PhoenixSuitorFastboot.
Last updated