Building Android

Fetching the code

Fetch the code using repo:

For Android 14 :

mkdir ~/src/khadas-aosp-14 && cd $_
repo init -u https://gitlab.baylibre.com/baylibre/amlogic/atv/aosp/manifest.git -b yukawa-android-14
repo sync

For more information about repo, visit Android’s official documentation

Note

To save same disk space, pass the --depth=1 option to repo init:

repo init -u https://gitlab.baylibre.com/baylibre/amlogic/atv/aosp/manifest.git -b yukawa-android-14 --depth=1

Setup

Refer to:

Build

For Android 14 :

cd ~/src/khadas-aosp-14
source build/envsetup.sh
lunch LUNCH-TARGET
m

Supported Lunch target:

Android lunch target

Android Variant

yukawa-userdebug

TV Debug (VIM3)

yukawa-user

TV Release (VIM3)

We also support the following build flags to enable optional features:

  • TARGET_AVB_ENABLE=true : Enable AVB

  • TARGET_KERNEL_USE=6.1|mainline : Select Kernel version (default is 6.1)

  • TARGET_VIM3=true : Build for VIM3 Board

  • TARGET_VIM3L=true : Build for VIM3L Board (Default target)

  • TARGET_BUILTIN_EDID=true : This option allows to preload 1920x1080 EDID structure

  • TARGET_USE_TABLET_LAUNCHER=true : Use tablet launcher instead of Android TV launcher

Initial Flashing instructions

Initial flashing instructions:

Flashing instructions

To reflash on a device which already has Android installed, run:

  1. Reboot to U-Boot

adb reboot bootloader
  1. Flash using the script: in a different terminal, change directory to out/target/product/yukawa and run :

# for VIM3
fastboot flash bootloader u-boot_kvim3_ab.bin&& fastboot erase bootenv && fastboot reboot bootloader
fastboot oem format && fastboot reboot bootloader

# for VIM3L
fastboot flash bootloader u-boot_kvim3l_ab.bin && fastboot erase bootenv && fastboot reboot bootloader
fastboot oem format && fastboot reboot bootloader

# For both
fastboot erase bootenv && fastboot oem format && fastboot reboot bootloader
fastboot flash boot_a boot.img && fastboot flash boot_b boot.img &&
  fastboot flash super super.img && fastboot flash userdata userdata.img &&
  fastboot flash dtbo_a dtbo-unsigned.img && fastboot flash dtbo_b dtbo-unsigned.img &&
  fastboot erase misc && fastboot erase frp && fastboot format metadata
  1. Reboot the board

fastboot reboot