Establish Android build environment.
Install additional packages:
sudo apt-get install bc coreutils dosfstools e2fsprogs fdisk kpartx mtools ninja-build pkg-config python3-pip
sudo pip3 install meson mako jinja2 ply pyyaml dataclasses
repo init -u https://android.googlesource.com/platform/manifest -b android-15.0.0_r4
curl -o .repo/local_manifests/manifest_brcm_rpi.xml -L https://raw.githubusercontent.com/raspberry-vanilla/android_local_manifest/android-15.0/manifest_brcm_rpi.xml --create-dirs
Or optionally, you can reduce download size by creating a shallow clone and removing unneeded projects:
repo init -u https://android.googlesource.com/platform/manifest -b android-15.0.0_r4 --depth=1
curl -o .repo/local_manifests/manifest_brcm_rpi.xml -L https://raw.githubusercontent.com/raspberry-vanilla/android_local_manifest/android-15.0/manifest_brcm_rpi.xml --create-dirs
curl -o .repo/local_manifests/remove_projects.xml -L https://raw.githubusercontent.com/raspberry-vanilla/android_local_manifest/android-15.0/remove_projects.xml
repo sync
. build/envsetup.sh
rpi4
or rpi5
) and build target (tablet UI, tv
for Android TV, or car
for Android Automotive):lunch aosp_rpi4-ap3a-userdebug
lunch aosp_rpi4_tv-ap3a-userdebug
lunch aosp_rpi4_car-ap3a-userdebug
lunch aosp_rpi5-ap3a-userdebug
lunch aosp_rpi5_tv-ap3a-userdebug
lunch aosp_rpi5_car-ap3a-userdebug
make bootimage systemimage vendorimage -j$(nproc)
rpi4
or rpi5
):./rpi4-mkimg.sh
./rpi5-mkimg.sh
Also look into Linux kernel build instructions.