11#! /usr/bin/env bash
2- # build-aosp-riscv64.sh - AOSP build pipeline for the Cuttlefish riscv64 target,
3- # overlaid with the eliza_ai_soc device tree .
2+ # build-aosp-riscv64.sh - AOSP build pipeline for the fused Eliza OpenAgent
3+ # E1 RISC-V AI SoC product .
44#
5- # Default lunch combo: aosp_cf_riscv64_phone-trunk_staging-userdebug
6- # Optional lunch combo: eliza_ai_soc-trunk_staging-userdebug (requires the
7- # overlay-mode=local-manifest path so the project is sync'd
8- # under the AOSP tree with a proper repo project entry).
5+ # Default lunch combo: eliza_openagent_ai_soc_phone-trunk_staging-userdebug
6+ # Reference-only combo: aosp_cf_riscv64_phone-trunk_staging-userdebug.
97#
108# This script is intentionally idempotent enough to re-run incrementally:
119# * Pre-flight is non-destructive.
@@ -26,6 +24,7 @@ SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
2624CHIP_ROOT=$( cd -- " $SCRIPT_DIR /../.." && pwd)
2725ELIZA_ROOT=$( cd -- " $CHIP_ROOT /../.." && pwd)
2826DEVICE_OVERLAY_SRC=" $SCRIPT_DIR /device/eliza/eliza_ai_soc"
27+ ELIZA_VENDOR_SRC=" $ELIZA_ROOT /packages/os/android/vendor/eliza"
2928LOCAL_MANIFEST_TEMPLATE=" $SCRIPT_DIR /local_manifests/eliza.xml"
3029
3130usage () {
@@ -38,7 +37,7 @@ required:
3837build options:
3938 --branch BRANCH AOSP manifest branch (default: android-latest-release).
4039 --lunch-target COMBO Lunch target
41- (default: aosp_cf_riscv64_phone -trunk_staging-userdebug).
40+ (default: eliza_openagent_ai_soc_phone -trunk_staging-userdebug).
4241 --jobs N Parallelism for repo sync and `m`
4342 (default: $(nproc)).
4443 --device-overlay-mode MODE
@@ -80,7 +79,7 @@ warn() { printf '[%s] WARN: %s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$*" >&2; }
8079
8180WORKSPACE=" "
8281BRANCH=" android-latest-release"
83- LUNCH_TARGET=" aosp_cf_riscv64_phone -trunk_staging-userdebug"
82+ LUNCH_TARGET=" eliza_openagent_ai_soc_phone -trunk_staging-userdebug"
8483JOBS=$( nproc 2> /dev/null || echo 4)
8584OVERLAY_MODE=" symlink"
8685RESYNC=0
@@ -138,6 +137,9 @@ for required in \
138137 " $DEVICE_OVERLAY_SRC /device.mk" \
139138 " $DEVICE_OVERLAY_SRC /manifest.xml" \
140139 " $DEVICE_OVERLAY_SRC /eliza_e1.xml" \
140+ " $ELIZA_VENDOR_SRC /AndroidProducts.mk" \
141+ " $ELIZA_VENDOR_SRC /eliza_common.mk" \
142+ " $ELIZA_VENDOR_SRC /products/eliza_openagent_ai_soc_phone.mk" \
141143 " $LOCAL_MANIFEST_TEMPLATE " ; do
142144 [ -f " $required " ] || die " missing repo artifact: $required "
143145done
@@ -246,8 +248,9 @@ run_repo_sync() {
246248}
247249
248250install_overlay_symlinks () {
249- log " overlay: dropping symlinks into device/eliza/eliza_ai_soc/"
251+ log " overlay: dropping symlinks into device/eliza/eliza_ai_soc/ and vendor/eliza/ "
250252 local dst=" $WORKSPACE /device/eliza/eliza_ai_soc"
253+ local vendor_dst=" $WORKSPACE /vendor/eliza"
251254 mkdir -p " $dst "
252255 # Mirror the layout exactly. We symlink files (not the whole dir) so any
253256 # additions to the overlay are picked up on the next run.
@@ -257,6 +260,13 @@ install_overlay_symlinks() {
257260 mkdir -p " $dst /$( dirname " $rel " ) "
258261 ln -sfn " $DEVICE_OVERLAY_SRC /$rel " " $dst /$rel "
259262 done
263+ mkdir -p " $vendor_dst "
264+ cd " $ELIZA_VENDOR_SRC "
265+ find . -type f -print0 | while IFS= read -r -d ' ' rel; do
266+ rel=${rel# ./ }
267+ mkdir -p " $vendor_dst /$( dirname " $rel " ) "
268+ ln -sfn " $ELIZA_VENDOR_SRC /$rel " " $vendor_dst /$rel "
269+ done
260270}
261271
262272install_overlay_local_manifest () {
@@ -287,6 +297,13 @@ install_overlay() {
287297 [ -f " $WORKSPACE /device/eliza/eliza_ai_soc/$rel " ] \
288298 || die " overlay install: device/eliza/eliza_ai_soc/$rel did not materialize"
289299 done
300+ for rel in \
301+ AndroidProducts.mk \
302+ eliza_common.mk \
303+ products/eliza_openagent_ai_soc_phone.mk; do
304+ [ -f " $WORKSPACE /vendor/eliza/$rel " ] \
305+ || die " overlay install: vendor/eliza/$rel did not materialize"
306+ done
290307}
291308
292309run_build () {
@@ -314,8 +331,8 @@ run_build() {
314331# Derive the product output directory from the lunch combo.
315332product_out_dir () {
316333 case " $LUNCH_TARGET " in
317- aosp_cf_riscv64_phone-* ) echo " $WORKSPACE /out/target/product/vsoc_riscv64" ;;
318- eliza_ai_soc-* ) echo " $WORKSPACE /out/target/product/eliza_ai_soc" ;;
334+ aosp_cf_riscv64_phone-* ) echo " $WORKSPACE /out/target/product/vsoc_riscv64" ;;
335+ eliza_ai_soc-* |eliza_openagent_ai_soc_phone- * ) echo " $WORKSPACE /out/target/product/eliza_ai_soc" ;;
319336 * )
320337 local short=${LUNCH_TARGET%% -* }
321338 echo " $WORKSPACE /out/target/product/${short} "
0 commit comments