Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim-5:development:android:build-android

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:vim-5:development:android:build-android [2026/09/15 03:00]
nick
products:sbc:vim-5:development:android:build-android [2026/10/30 02:30] (current)
goenjoy
Line 4: Line 4:
 ====== VIM 5 Build Android ====== ====== VIM 5 Build Android ======
  
-TODO+===== Preparations ===== 
 + 
 +  * [[http://source.android.com/source/initializing.html|Set up a Build Environment]] 
 +  * [[products:sbc:vim5:development:android:download-android-source-code|Downloading the Android Source]] 
 +  * [[products:sbc:vim5:development:android:install-toolchains|Install Toolchains for the Amlogic Platform]] 
 + 
 +===== Building ===== 
 + 
 + 
 +<WRAP important > 
 +Make sure you have done all the ''Preparations'' listed above before getting started. 
 +</WRAP> 
 + 
 +**Build U-Boot:** 
 + 
 +```shell 
 +$ cd PATH_YOUR_PROJECT 
 +$ cd bootloader/uboot-repo/ 
 +$ ./mk kvim5 --fastboot-write --avb2 --vab 
 +``` 
 +Gernerate images in this step: 
 + 
 +  * ''build/u-boot.bin.signed'': for onboard eMMC storage booting 
 +  * ''build/u-boot.bin.sd.bin.signed'': for external TF card booting 
 + 
 +**Build Linux Kernel:** 
 + 
 + 
 +```shell 
 +$ ./mk kvim5 -v common16-6.12 -jN 
 +``` 
 + 
 +<WRAP important > 
 +Replace ''N'' with the actual number of threads on your own computer. 
 +</WRAP> 
 + 
 + 
 +**Build Android:** 
 + 
 + 
 +```shell 
 +$ cd PATH_YOUR_PROJECT 
 +$ . build/envsetup.sh 
 +$ lunch kvim5_arm64-bp4a-userdebug 
 +$ make -jN 
 +$ make -jN otapackage 
 +``` 
 + 
 +Gernerate images in this step: ''out/target/product/kvim5/update.img''. 
 + 
 + 
 +<WRAP important > 
 +Replace ''N'' with the actual number of threads on your own computer. 
 +</WRAP> 
 + 
 + 
 +**Build Script Demo:** 
 +```sh demo.sh 
 +$ cat demo.sh 
 +#!/bin/bash 
 + 
 +#build uboot 
 +if [ "$1" == 'u' ] || [ "$1" == 'n' ]; then  
 + echo "build uboot" 
 + cd bootloader/uboot-repo/ 
 +if [ "$2" == 'n' ] || [ "$1" == 'n' ]; then 
 + make clean  
 + echo "build uboot n" 
 +fi  
 + ./mk kvim5 --fastboot-write --avb2 --vab 
 + cd - 
 +fi 
 + 
 +#build kernel 
 +if [ "$1" == 'k' ] || [ "$1" == 'n' ]; then 
 + echo "build kernel" 
 +if [ "$2" == 'n' ] || [ "$1" == 'n' ]; then 
 + rm -rf common/common16-6.12/out 
 +fi  
 + ./mk kvim5 -v common16-6.12 -j88 
 +fi 
 + 
 +#build android 
 +if [ "$1" == 'a' ] || [ "$1" == 'n' ]; then 
 + echo "build android"  
 +if [ "$2" == 'n' ] || [ "$1" == 'n' ]; then 
 + rm -rf out/ 
 +fi 
 + . build/envsetup.sh 
 +  lunch kvim5_arm64-bp4a-userdebug 
 +# make installclean 
 + rm android.log 
 + make -j88 >> android.log 
 +fi 
 + 
 +if [ "$1" == 'o' ] || [ "$1" == 'n' ]; then 
 + echo "build otapackage"  
 + . build/envsetup.sh 
 +  lunch kvim5_arm64-bp4a-userdebug 
 + make -j88 otapackage 
 +fi 
 +``` 
 + 
 +**Build U-Boot:** 
 +```shell 
 +$ ./demo.sh u 
 +``` 
 + 
 +**Build Kernel:** 
 + 
 +```shell 
 +$ ./demo.sh k 
 +``` 
 + 
 +**Build Android:** 
 + 
 +```shell 
 +$ ./demo.sh a 
 +``` 
 + 
 +**Build all:** 
 + 
 +```shell 
 +$ ./demo.sh n 
 +``` 
Last modified: 2026/09/15 03:00 by nick