Skip to content

Instantly share code, notes, and snippets.

@babldev
Last active May 12, 2025 23:23
Show Gist options
  • Save babldev/ade0de11f4509a2804aea029bc60e67f to your computer and use it in GitHub Desktop.
Save babldev/ade0de11f4509a2804aea029bc60e67f to your computer and use it in GitHub Desktop.
TI Linux Yocto build

TI AM67A Linux SDK - Yocto build on Google Cloud Compute Engine

Instance type

Linux Ubuntu expects amd64 architecture.

Build performance on c3d-standard-8-lssd (8 vCPU, 32 GB Memory, SSD)

  • ~10 hours (CPU bound)
  • Used 351GB (of 369GB SSD)
  • Final rootfs image is 1.1GB tar.gz

Used 351 GB (of 369GB SSD).

$ du --summarize --human-readable *
4.0K    README
312K    bitbake-setup
323G    build
1.8M    conf
872K    configs
28G     downloads
4.0K    git_retry.sh
376K    kas
32K     oe-layertool-setup.sh
144K    sample-files
440M    sources
504K    src

Note: The directories used across builds only tally to ~50GB. downloads/ is only 28G and build/sstate-cache/ is 19G. The majority of the space is used for the build/arago-tmp-* temp directories (300GB+).

I chose Google Container Optimized OS so Docker is pre-installed.

Instance bootstrap

Mount SSD: docs

sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/nvme1n1
sudo mkdir -p /mnt/disks/ssd1
sudo mount -o discard,defaults /dev/nvme1n1 /mnt/disks/ssd1/
sudo chmod a+w /mnt/disks/ssd1/

Create build directory:

mkdir /mnt/disks/ssd1/yocto
export WORK_DIR=/mnt/disks/ssd1/yocto

Start TI Ubuntu:

docker run --privileged -it \
    -v ${WORK_DIR}:/home/tisdk \
    -w /home/tisdk \
    ghcr.io/texasinstruments/ubuntu-distro:latest

Bootstrap SDK repo:

sudo chown -R tisdk /home/tisdk
git clone https://git.ti.com/git/arago-project/oe-layersetup.git tisdk
cd tisdk/

Bootstrap SDK build:

./oe-layertool-setup.sh -f configs/processor-sdk-analytics/processor-sdk-analytics-10.01.00-config.txt
cd build
. conf/setenv
echo 'ARAGO_BRAND = "edgeai"' >> conf/local.conf

Optional: Use screen so you can reconnect to build if SSH connection is lost. Google Container OS does not allow package installs so you need to do this within Docker. Alternatively, use Ubuntu/Debian VM instead of the locked down Google Container OS.

sudo apt update
sudo apt install screen
screen -ARd

Build full tisdk-edgeai-image SDK:

MACHINE="j722s-evm" bitbake -k tisdk-edgeai-image

Reconnecting to Docker image screen instance (if disconnected):

docker exec -it NAME_OF_CONTAINER /bin/bash
screen -ARd

Restoring stopped instance

Start instance:

gcloud beta compute instances start INSTANCE_NAME \
     --zone=ZONE
gcloud compute ssh INSTANCE_NAME --zone=ZONE

Remount SSD:

sudo mkdir -p /mnt/disks/ssd1
sudo mount -o discard,defaults /dev/nvme1n1 /mnt/disks/ssd1/
export WORK_DIR=/mnt/disks/ssd1/yocto

Restart TI Ubuntu docker image and enter:

docker run --privileged -it \
    -v ${WORK_DIR}:/home/tisdk \
    -w /home/tisdk \
    ghcr.io/texasinstruments/ubuntu-distro:latest
cd tisdk/build/
. conf/setenv

Rebuilding

Delete the existing build/deploy-ti/ directory or you may get errors.

rm -rf build/deploy-ti/

Speeding up builds

Build limited images

The minimal tisdk-bootstrap-image will build faster than tisdk-edgeai-image.

Persist SSD storage on shutdown

gcloud beta compute instances stop INSTANCE_NAME \
    --discard-local-ssd=false \
    --zone=ZONE

Faster/more vCPUs

Initial builds are CPU bound so adding vCPUs will reduce build time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment