Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim1s: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
Last revision Both sides next revision
products:sbc:vim1s:development:android:build-android [2022/07/17 21:50]
nick
products:sbc:vim1s:development:android:build-android [2022/09/28 09:42]
nick
Line 1: Line 1:
-{{indexmenu_n>3}}+ 
 +{{indexmenu_n>15}}
  
  
 ====== VIM1S Build Android ====== ====== VIM1S Build Android ======
 +
 +===== Preparations =====
 +
 +  * [[http://source.android.com/source/initializing.html|Setup the Build Environment]]
 +  * [[products:sbc:vim1s:development:android:download-android-source-code]]
 +  * [[products:sbc:vim1s:development:android:install-toolchains]]
 +
 +===== 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
 +$ ./mk kvim1s
 +```
 +Gernerate images in this step:
 +
 +  * ''build/u-boot.bin'': for onboard eMMC storage booting
 +  * ''build/u-boot.bin.sd.bin'': for external TF card booting
 +
 +==== Build Linux Kernel ====
 +
 +
 +```shell
 +$ ./mk kvim1s -v 5.4 -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 TARGET_LUNCH
 +$ make -jN otapackage
 +```
 +
 +Gernerate images in this step: ''out/target/product/TARGET/update.img''.
 +
 +
 +<WRAP important >
 +  * When compiling Android for VIM3, both Android and the kernel are compiled together. For VIM1S, only Android is compiled, the kernel has to be compiled separately.
 +  * Replace ''N'' with the actual number of threads on your own computer
 +  * Replace ''TARGET_LUNCH'' to your lunch select.
 +    * For VIM1S, it's ''kvim1s-userdebug''.
 +
 +</WRAP>
 +
 +
 +==== Build Script Demo ====
 +
 +```sh demo.sh
 +#!/bin/bash
 +
 +#build U-Boot
 +if [ "$1" == 'u' ] || [ "$1" == 'n' ]; then
 + echo "build U-Boot"
 + cd bootloader/uboot
 + ./mk kvim1s
 + cd -
 +fi
 +
 +#build Kernel
 +if [ "$1" == 'k' ] || [ "$1" == 'n' ]; then
 + echo "build Kernel"
 +if [ "$2" == 'n' ] || [ "$1" == 'n' ]; then
 + make distclean
 +fi
 + ./mk kvim1s -v 5.4 -j100
 +fi
 +
 +#build Android
 +if [ "$1" == 'a' ] || [ "$1" == 'n' ]; then
 + echo "build Android"
 +if [ "$2" == 'n' ] || [ "$1" == 'n' ]; then
 + make clean
 +fi  
 + . build/envsetup.sh 
 + lunch kvim1s-userdebug 
 + make installclean
 + #make -j80 otapackage
 + make -j80
 +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: 2023/08/22 21:24 by goenjoy