fd55325b320dc38f56e833a24c12696b46a1157f
* Moving forward there will be two copies of Mesa in Raspberry Vanilla AOSP source tree. external/mesa3d is the upstream AOSP fork directly from AOSP that has soong blueprint makefiles to satisfy package dependencies for gfxstream-vulkan elsewhere in the AOSP tree. external/mesa3d-rpi is the Raspberry Vanilla fork (generally the latest upstream mainline stable version) that has some additional patches and soong blueprint makefiles to build only the drivers that are used on Raspberry Pi (vc4 & v3d gallium, broadcom vulkan).
Device specific configuration to build AOSP Android 16 for Raspberry Pi 4 and Raspberry Pi 5.
How to build (Ubuntu 22.04 LTS):
-
Establish Android build environment.
-
Install additional packages:
sudo apt-get install coreutils dosfstools e2fsprogs fdisk kpartx mtools ninja-build pkg-config python3-pip rsync
sudo pip3 install dataclasses jinja2 mako meson ply pyyaml
- Initialize repo:
repo init -u https://android.googlesource.com/platform/manifest -b android-16.0.0_r1
curl -o .repo/local_manifests/manifest_brcm_rpi.xml -L https://raw.githubusercontent.com/raspberry-vanilla/android_local_manifest/android-16.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-16.0.0_r1 --depth=1
curl -o .repo/local_manifests/manifest_brcm_rpi.xml -L https://raw.githubusercontent.com/raspberry-vanilla/android_local_manifest/android-16.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-16.0/remove_projects.xml
- Sync source code:
repo sync
- Setup Android build environment:
. build/envsetup.sh
- Select the device (
rpi4
orrpi5
) and build target (tablet UI,tv
for Android TV, orcar
for Android Automotive):
lunch aosp_rpi4-bp2a-userdebug
lunch aosp_rpi4_tv-bp2a-userdebug
lunch aosp_rpi4_car-bp2a-userdebug
lunch aosp_rpi5-bp2a-userdebug
lunch aosp_rpi5_tv-bp2a-userdebug
lunch aosp_rpi5_car-bp2a-userdebug
- Compile:
make bootimage systemimage vendorimage -j$(nproc)
- Make flashable image for the device (
rpi4
orrpi5
):
./rpi4-mkimg.sh
./rpi5-mkimg.sh
Also look into Linux kernel build instructions.
Issues:
Wiki:
Description