Android

Building Android

Fetching the code

Fetch the code using repo:

mkdir ~/src/aosp-main && cd $_
repo init -u https://android.googlesource.com/platform/manifest -b main
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://android.googlesource.com/platform/manifest -b main --depth=1

Setup

Refer to:

Build

Note

The AOSP mainline for yukawa requires a vendor package to be extracted prior to building the image. The vendor package contains all the binaries which have been removed removed from the AOSP device tree. Use the fetch-vendor-package.sh script to download the latest compatible version.

cd ~/src/aosp-main
./device/amlogic/yukawa/fetch-vendor-package.sh
source build/envsetup.sh
lunch yukawa-trunk_staging-userdebug
m

It’s possible to customize the standard build (m), by passing build flags. For example, the following enables AVB on userdebug builds:

$ TARGET_AVB_ENABLE=true m

The following build flags are available. Default values are highlighted.

Flag

Possible values

Description

TARGET_AVB_ENABLE=true

true or omitted

Enable AVB

TARGET_KERNEL_USE=6.1

6.1 or mainline

Select Kernel version (default is 6.1)

TARGET_VIM3=true

true or omitted

Build for VIM3 Board

TARGET_VIM3L=true

true or omitted

Build for VIM3L Board (Default target)

TARGET_BUILTIN_EDID=true

true or omitted

Preloads a 1920x1080 EDID structure

TARGET_USE_TABLET_LAUNCHER=true

true or omitted

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
    
  2. Flash using the script: in a different terminal, change directory to out/target/product/yukawa and run :

    # For VIM3
    export BOOTLOADER_NAME=u-boot_kvim3_ab.bin
    # For VIM3L
    export BOOTLOADER_NAME=u-boot_kvim3l_ab.bin
    
    # for both
    fastboot flash bootloader ${BOOTLOADER_NAME} && fastboot erase bootenv && fastboot reboot bootloader
    fastboot oem format && fastboot reboot bootloader
    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
    
  3. Reboot the board

    fastboot reboot