Download
Install repo
Make sure you have a bin/ directory in your home directory and that it is included in your path:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
Download the Repo tool and ensure that it is executable:
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Create an empty directory to hold your working files. Give it any name you like:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
Configure git with your real name and email address.
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"
Download with local_manifests
Download Android source with patches(local_manifests)
$ repo init -u https://android.googlesource.com/platform/manifest -b android-n-preview-1
$ cd .repo
$ git clone https://github.com/peyo-hd/local_manifests -b npv
$ repo sync
*1 local_manifests allows you to customize the list of repositories used in your copy of the source code by overriding or supplementing the default manifest.
*2 the files will be saved in .repo while downloading, and moved to working directory after downloading.
Build
Build kernel
$ sudo apt-get install gcc-arm-linux-gnueabihf
if you found “depends error”, please try:
$ sudo apt-get purge libc6-dev-armel-armhf-cross
start to build
$ cd kernel/rpi
$ ARCH=arm scripts/kconfig/merge_config.sh arch/arm/configs/bcm2709_defconfig android/configs/android-base.cfg android/configs/android-recommended.cfg
$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make zImage
$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make dtbs
build anroid
$ sudo apt-get install python-mako
avoid logcat flood
Apply following patch under frameworks/base, to avoid logcat flood by mouse event.
frameworks/base/core/java/android/view/GestureDetector.java
@@ line 490 @@ public class GestureDetector {
public boolean onTouchEvent(MotionEvent ev) {
+ switch(ev.getAction() & MotionEvent.ACTION_MASK) {
+ case MotionEvent.ACTION_HOVER_MOVE:
+ case MotionEvent.ACTION_HOVER_ENTER:
+ case MotionEvent.ACTION_HOVER_EXIT:
+ case MotionEvent.ACTION_BUTTON_PRESS:
+ case MotionEvent.ACTION_BUTTON_RELEASE:
+ case MotionEvent.ACTION_SCROLL:
+ return false;
+ }
if (mInputEventConsistencyVerifier != null) {
Continue build with
http://source.android.com/source/building.html
http://source.android.com/source/initializing.html
$ source build/envsetup.sh
$ lunch rpi3-eng
$ make
* you can run with make -j4
* aobut out of memory
add following to ~/.jacksetting
JACK_VM_COMMAND=${JACK_VM_COMMAND:=”java -Xmx4096m”}
SERVER_NB_COMPILE=1
and run
export JACK_SERVER_VM_ARGUMENTS=”-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m”
out/host/linux-x86/bin/jack-admin kill-server
out/host/linux-x86/bin/jack-admin start-server
Prepare sd card
-
Partitions of the card should be set-up like followings.
p1 512MB for BOOT : Do fdisk : W95 FAT32(LBA) & Bootable, mkfs.vfat
p2 512MB for /system : Do fdisk, new primary partition
p3 512MB for /cache : Do fdisk, mkfs.ext4
p4 remainings for /data : Do fdisk, mkfs.ex4
Set volume label for each partition - system, cache, userdata
- use -L option of mkfs.ext4, e2label command, or -n option of mkfs.vfat
Write system partition
$ cd out/target/product/rpi3
$ sudo dd if=system.img of=/dev/<p2> bs=1M
Boot partition, kernel & ramdisk
device/brcm/rpi3/boot/* to p1:/
kernel/rpi/arch/arm/boot/zImage to p1:/
kernel/rpi/arch/arm/boot/dts/bcm2710-rpi-3-b.dtb to p1:/
out/target/product/rpi3/ramdisk.img to p1:/
refs:
https://groups.google.com/forum/m/#!forum/android-rpi
https://github.com/peyo-hd/local_manifests/tree/npv
https://github.com/peyo-hd/device_brcm_rpi3
https://github.com/peyo-hd/kernel_rpi/tree/rpi3
https://github.com/peyo-hd/device_brcm_rpi2/wiki