This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Android Marshmallow on Beaglebone black

Marshmallow porting on Beaglebone black

steps:

1. Get Marshmallow AOSP source from Google

user:~$ curl commondatastorage.googleapis.com/.../repo > ~/bin/repo

user:~$ chmod a+x ~/bin/repo

user:~$ mkdir ~/aosp

user:~$ cd aosp

user:~$ repo init -u android.googlesource.com/.../manifest -b android-6.0.0_r5

user:~$ repo sync -c

2. Get device files for the BeagleBone Black

user:~$ cd ~/aosp/device

user:~$ mkdir ti

user:~$ cd ti

user:~$ git clone github.com/.../bbb-android-device-files.git beagleboneblack

user:~$ cd beagleboneblack

3. Get the Rowboat kernel configure and compile:

user:~$ cd ~/aosp

user:~$ git clone gitorious.org/.../kernel.git

user:~$ cd kernel

user:~$ git checkout rowboat-am335x-kernel-3.2

user:~$ patch -p1 < ../device/ti/beagleboneblack/kernel-patches/0001-Tweak-backlight-PWM-for- LCD4-Beaglebone-cape.patch

user:~$ patch -p1 < ../device/ti/beagleboneblack/kernel-patches/0002-Reboot-reason-flags-for- BBB.patch

user:~$ make ARCH=arm CROSS_COMPILE=arm-eabi- am335x_evm_android_defconfig

user:~$ make ARCH=arm CROSS_COMPILE=arm-eabi- -j4 uImage

user:~$ croot

4. Get U-Boot configure and compile:

user:~$ cd ~/aosp

user:~$ git clone github.com/.../u-boot

user:~$ cd u-boot

user:~$ make CROSS_COMPILE=arm-eabi- am335x_evm_config

user:~$ make CROSS_COMPILE=arm-eabi-

5. Build AOSP:

user:~$ . build/envsetup.sh

user:~$ lunch

- setect your device

user:~$ make -j8

6. Put the images on micro SD card:

You need a micro SD card of at least 2 GiB capacity. Insert your SD card into

your SD card reader. It will appear as either `/dev/sd?` Or as `/dev/mmcblk?`.

Use the following script to format and copy the images

user:~$ croot

user:~$ device/ti/beagleboneblack/write_sdcard.sh

Issues and Modifications:

This build has been tested on a BBB. Here are some issues that I am aware of:

The screen flickers whenever it is updated

The Linux 3.2 kernel is unreliable if built with the gcc 4.8 toolchain that comes with AOSP 6.0

I used gcc 4.7 toolchain

1. init: could not import file '/init.unknown.rc' from '/init.rc'

sol: It has to be our device file init.am335xevm.rc

For that we need to modify the BoardConfig.mk file in device/ti/beagleboneblack :

BOARD_KERNEL_CMDLINE := console=ttyO0,115200n8 androidboot.console=ttyO0 rootwait ro qemu=1 qemu.gles=0

I modified the above line as below

BOARD_KERNEL_CMDLINE := console=ttyO0,115200n8 androidboot.console=ttyO0 androidboot.hardware=am335xevm rootwait ro qemu=1 qemu.gles=0

2. init: Service 'sdcard' (pid 124) exited with status 1

init: Service 'sdcard' (pid 124) killing any children in process group

sol: I tried a lot on modifing init.rc file related to sdcard but it doesn't worked. Then i came to know that some modifications has to be done on beaglebone black device files which i have downloaded. I modified the two file fstab.am335xevm-sd & init.am335xevm.rc. Its worked!

The modifications are as follows:

  • device/ti/beagleboneblack/fstab.am335xevm-sd

Add the following line at the end of the above file

/devices/*/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usb:auto

  • device/ti/beagleboneblack/ init.am335xevm.rc

Remove the following lines:

on init

mkdir /mnt/shell/emulated 0700 shell shell

mkdir /storage/emulated 0555 root root

export EXTERNAL_STORAGE /storage/emulated/legacy

export EMULATED_STORAGE_SOURCE /mnt/shell/emulated

export EMULATED_STORAGE_TARGET /storage/emulated

symlink /storage/emulated/legacy /sdcard

symlink /storage/emulated/legacy /mnt/sdcard

symlink /storage/emulated/legacy /storage/sdcard0

symlink /mnt/shell/emulated/0 /storage/emulated/legacy

on post-fs-data

mkdir /data/media 0770 media_rw media_rw

on fs

# virtual sdcard daemon running as media_rw (1023)

service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023

class late_start

Add the following lines:

on init

# Load persistent dm-verity state

verity_load_state

# Support legacy paths

symlink /sdcard /mnt/sdcard

symlink /sdcard /storage/sdcard0

compile the AOSP source: ~/aosp$ make -j8

Put the images on micro SD card: ~/aosp$ device/ti/beagleboneblack/write_sdcard.sh

 

Thank You!!!

1 Reply

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.