{"id":22738269,"url":"https://github.com/sembamax/android-automotive-rpi","last_synced_at":"2025-04-23T20:49:46.014Z","repository":{"id":64969720,"uuid":"580148274","full_name":"SembaMax/android-automotive-rpi","owner":"SembaMax","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-25T12:55:55.000Z","size":10,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T03:29:29.897Z","etag":null,"topics":["android","automotive","debian","rpi4"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SembaMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-19T20:54:22.000Z","updated_at":"2025-01-29T12:59:29.000Z","dependencies_parsed_at":"2024-12-10T22:36:17.876Z","dependency_job_id":null,"html_url":"https://github.com/SembaMax/android-automotive-rpi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SembaMax%2Fandroid-automotive-rpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SembaMax%2Fandroid-automotive-rpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SembaMax%2Fandroid-automotive-rpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SembaMax%2Fandroid-automotive-rpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SembaMax","download_url":"https://codeload.github.com/SembaMax/android-automotive-rpi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250514002,"owners_count":21443204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","automotive","debian","rpi4"],"created_at":"2024-12-10T22:24:46.874Z","updated_at":"2025-04-23T20:49:45.993Z","avatar_url":"https://github.com/SembaMax.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android Automotive RPI\n\n## Hardware\n\n* Raspberry Pi 4B - with minimum 4GB RAM\n* HDMI IPS Touchscreen\n* Minimum 32 GB SD card\n\n\n## Build machine\nYou need a reasonably powerful machine because AOSP build process will take several hours.\n\n* Minimum 16GB RAM - recommended 32 GB\n* Recommended at least 8 cores CPU\n* Minimum 512 GB disk space\n* Debian 11 OS\n\n## Install prerequisites\nInstalling the packages needed for the process\n\n```\n$ sudo apt install gcc-aarch64-linux-gnu git-core python-is-python3 fdisk curl libssl-dev flex build-essential bison rsync meson\n```\n\nAnd you will need also to install Repo tool manually\n\n```\n$ mkdir -p ~/.bin\n$ PATH=\"${HOME}/.bin:${PATH}\"\n$ curl https://storage.googleapis.com/git-repo-downloads/repo \u003e ~/.bin/repo\n$ chmod a+rx ~/.bin/repo\n```\n\n## Download Android source\n\nRefer to http://source.android.com/source/downloading.html\n\nFirst you need to init the Android source, here we are using Android 12L according to [AOSP AVD for Automotive](https://source.android.com/docs/devices/automotive/start/avd/android_virtual_device)\n```\n$ repo init -u https://android.googlesource.com/platform/manifest -b android-12L\n```\n\nThen checkout the local manifest with the required changes for Automotive OS\n```\n$ git clone https://github.com/SembaMax/local_manifests .repo/local_manifests -b arpi-12L\n```\n\nAt last you should run `repo sync` to kick off the download process.\n\n\n## Patch\nOnce `repo sync` is done, there's set of manual modifications you will need to do before proceeding to the build phase.\n\nPlease follow the instructions [here](https://github.com/android-rpi/device_arpi_rpi4/wiki/arpi-12-:-framework-patch)\n\n\n## Build AOSP\nRefer to http://source.android.com/source/building.html\n\nNow after you had a successful Android source download, you are good to go for the build step.\n\nThe build step consists two main build processes\n\n### Build Android source\nHere you come to generate the Android automotive OS image\n\n```\n  $ source build/envsetup.sh\n  $ lunch automotive_rpi4-eng\n  $ make ramdisk systemimage vendorimage\n```\n\nUse -j[n] option with make in order to accelerate the build process, if your build machine has a good number of CPU cores.\n\nIf you are using build machine with RAM less than 20GB, you may encounter to `OUT_OF_MEMORY` error.\n\nAs a workaround for this problem without upgrading your hardware you can use `swap`\n\n### Build linux kernel\nFor Android 11, the kernel directory is under the Android source repo.\n\nyou can run the following commands to build the kernel:\n\n```\n$ cd kernel/arpi\n$ ARCH=arm64 scripts/kconfig/merge_config.sh arch/arm64/configs/bcm2711_defconfig kernel/configs/android-base.config kernel/configs/android-recommended.config\n$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make Image.gz\n$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- DTC_FLAGS=”-@” make broadcom/bcm2711-rpi-4-b.dtb\n$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- DTC_FLAGS=”-@” make overlays/vc4-kms-v3d-pi4.dtbo\n```\n\nOtherwise, please follow the the next instructions.\n\nKernel build process is a little bit different starting from Android 12, you will need to download and build the linux kernel separately from the Android source.\n\n#### Download kernel\nMake separate kernel directory apart from Android source.\n\n```\n  $ cd \u003ckernel directory\u003e\n  $ repo init -u https://github.com/android-rpi/kernel_manifest -b arpi-5.10\n  $ repo sync\n```\n\n#### Build kernel\n```\n  $ build/build.sh\n```\n\nOutput files will be under $OUT/arpi-5.10/dist/\n\n## Prepare sd card\nNow as the last step you need to prepare your SD card for deploying the AOSP image.\n\nPartitions of the SD card should be set exactly like followings\n\n| #  | Size      | Partition | Options                            |\n| -- | --------- | --------- | ---------------------------------- |\n| p1 | 128MB     | boot      | set W95 FAT32(LBA) \u0026 bootable type |\n| p2 | 2048MB    | /system   |                                    |\n| p3 | 128MB     | /vendor   |                                    |\n| p4 | remaining | /data     |                                    |\n\nCreate file system on the following two partitions (p1, p4)\n```\n$ mkfs.vfat /dev/sdX1\n$ mkfs.ext4 /dev/sdX4\n```\n\nimages will be written on the other two partitions (p2, p3), so no need to create file systems on them.\n\n## SD card deployment\nMost likely the SD card will appear as /dev/sdX on your build machine.\n\nFor the following steps you just need to replace X with what appears on your machine.\n\n\n### Write system \u0026 vendor partition\n```\n# dd if=$OUT/target/product/rpi/system.img of=/dev/sdX2 bs=1M status=progress\n# dd if=$OUT/target/product/rpi/vendor.img of=/dev/sdX3 bs=1M status=progress\n```\n\n### Copy firmware \u0026 ramdisk to boot partition\n```\n$ mount /dev/sdX1 /mnt\n$ cp device/arpi/rpi4/boot/* /mnt\n$ cp $OUT/target/product/rpi4/ramdisk.img /mnt\n```\n\n### Copy kernel binaries to boot partition\n```\n$ mkdir /mnt/overlays\n$ cp \u003ckernel directory\u003e/out/arpi-5.10/dist/Image.gz /mnt\n$ cp \u003ckernel directory\u003e/out/arpi-5.10/dist/bcm2711-rpi-*.dtb /mnt\n$ cp \u003ckernel directory\u003e/out/arpi-5.10/dist/vc4-kms-v3d-pi4.dtbo /mnt/overlays\n```\n\nAnd finally remove the SD card\n```\numount /mnt\neject /dev/sdX\n```\n\n## Booting the Raspberry PI\nCongratulations! you have made it that far.\n\nNow all you need is to insert the SD card to the raspberry pi and boot it up.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsembamax%2Fandroid-automotive-rpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsembamax%2Fandroid-automotive-rpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsembamax%2Fandroid-automotive-rpi/lists"}