Thread:User talk:MaheshKalmeshwar/Quick MarshMallow Android Porting on Beaglebone Black

http://www.globaledgesoft.com/ Quick Guide for Android Porting on ARM Architecture By Globaledge Software Pvt Team Members: Sravan Kumar Muppidi, Mahesh Kalmeshwar

Contents:

1. General Porting Activity i.Linux Kernel Changes to make an Android Kernel ii.ARM SoC(System On Ship)Changes iii.Board specific Changes iv.OEM Changes v.OEM's customer changes vi.Library Integration'''

2. Case Study i.Previous Android Version is running on Board''' ii.No Android version is Running on board – But Linux is running''' iii.New Board and No Linux Kernel'''

3. Marshmallow porting on Beaglebone black

1. General Porting Activity

i. Linux Kernel Changes to make an Android Kernel Binder,ashmem,Pmem,Logger,wakelock,OOMHandling,alarm timer,Paranoid Network security, Time out/Timed GPIO,RAM,Console,ADB etc

'''ii. ARM SoC(System On chip) Changes:''' Processor and SoC manufacture specific Example -Cortex series – Qualcomm, TI, Nvidia, ST etc... '''iii. BSP(Board Support package) specific Changes:''' Example - Snapdragon, DM356, DM368 etc....

'''iv. OEM Changes:''' Example -LG, Samsung, MI etc

v. OEM's Customer Changes: Example -Reliance, Verizon etc.....

'''vi. Library Integration:''' Example - Modem ,GPU ,Telephony, Camera, OPENGL,OPENMAX etc.......

2. Case Study

i.Previous android version is up and running on TI Board Lollipop is running on TI platform How to port next Android version on this Platform? Get the difference between AOSP and currently running android version Will get TI specific changes and any proprietary library. These Changes need to incorporate to next version AOSP porting (ex: Lollipop to Marshmallow). This is baseline code. Once the Base line is ready, distribute to the Other team (middleware and application Team). We ported Marshmallow on Begal Bone Black ,RPI etc. Skills required Moderate on Linux.

ii.No Andriod version is Running on board – But Linux is running Convert Linux Kernel to Android Kernel. Incorporate HAL, Middleware, Vendor specific, third party library Changes. Needs file system modifications. Skills required – Experts on Linux Porting

iii.New Board and No Linux Kernel Porting U-boot and Linux Kernel Follow The Case study ii. Skills Required -Strong Linux Kernel Porting On New SoC & Board.

3.Marshmallow porting on Beaglebone black:

steps:

Get AOSP source from Google $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ mkdir ~/aosp $ cd aosp $ repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.0_r5 $ repo sync -c

Get device files for the BeagleBone Black $ cd ~/aosp/device $ mkdir ti        $ cd ti         $ git clone https://github.com/csimmonds/bbb-android-device-files.git beagleboneblack $ cd beagleboneblack

Get the Rowboat kernel configure and compile $ cd ~/aosp $ git clone https://gitorious.org/rowboat/kernel.git $ cd kernel $ git checkout rowboat-am335x-kernel-3.2 $ patch -p1 < ../device/ti/beagleboneblack/kernel-patches/0001-Tweak-backlight-PWM-for-	  LCD4-Beaglebone-cape.patch $ patch -p1 < ../device/ti/beagleboneblack/kernel-patches/0002-Reboot-reason-flags-for-	 	  BBB.patch $ make ARCH=arm CROSS_COMPILE=arm-eabi- am335x_evm_android_defconfig $ make ARCH=arm CROSS_COMPILE=arm-eabi- -j4 uImage $ croot

Get U-Boot configure and compile: $ cd ~/aosp $ git clone https://github.com/csimmonds/u-boot $ cd u-boot $ make CROSS_COMPILE=arm-eabi- am335x_evm_config $ make CROSS_COMPILE=arm-eabi-

Build AOSP $ . build/envsetup.sh       $ lunch - setect your device $ make -j8

Put the images on micro SD card: You need a micro SD card of at least 2 GiB capacity. $ croot $ device/ti/beagleboneblack/write_sdcard.sh

Issues and Modifications:

Build has been tested on a BBB. The initial boot time is bit long. The screen flickers whenever it is updated Dont use gcc 4.8 toolchain that comes with AOSP 6.0 insted use gcc 4.7 toolchain

(1)init: could not import file '/init.unknown.rc' from '/init.rc' It has to be our device file init.am335xevm.rc        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

modify 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: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