SlideShare a Scribd company logo
Building
My Product on
Android Open Source Project
Android Builders Summit 2015
Rafael Coutinho - Software Engineer
Phi Innovations
1
Agenda
● Motivation
● Build System Overview
● Simple Build
● Product Customization Structure
● Create My Own Products
● Summary
● Q&A
2
Motivation
● At work we design hardware, customize the operating
system, develop high level applications
● SoCs based on
● Freescale (iMX53, iMX6)
● Texas Instruments (Beaglebones)
● AllWinner (A20)
● FriendlyARM (Tiny210)
● Android basic porting are provided by these vendors
● However usually not in a standard way
3
Motivation
● Not in a standard way tricks we have found
● Shell scripts to define the Android variables during build.
● Shell scripts copied to the build that are executed on the init.rc and
then set the actual Android environment variables/configurations.
● Manually executed commands during build (like for compiling HALs)
● Provide a pre built tar file with the root file system to be copied over
the final build
● Hard time figuring out why our customizations do not go
thru the build in each provided AOSP porting
4
Motivation
● Looking for AOSP build process documentation we
have found it is scarce and what is available is old or
cached versions
● build/core/build-system.html - Starts with “Status: Draft (as of May 18, 2006)”
● KAndroid website with cached old version of the Android build
● Embedded Android book from Karim Yaghmour
● Free electrons training
● Some ABS previous presentations
● Usually deep and complete but also complex
5
Motivation
● Describe how to customize an AOSP for a target
product using the standard AOSP build mechanisms
● Making easier to extend/develop ported AOSPs on
customized boards
6
Android Build System
Build systems are software tools designed to automate the
process of program compilation.
Google defined a GNU/Make based build system for
Android
● Replacing Makefile files with Android.mk
● New imported modules must have it’s Makefiles “translated”
● No tool like menuconfig available by default
7
Android Build System Architecture
Originals at: www.opersys.com/training/embedded-android
8
Simple build
Execute the build once (to be fearless)
Build combo aosp_arm-eng
Simple build for development targeting emulator
9
Simple build
$ source build/envsetup.sh
$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
Which would you like? [aosp_arm-eng]
$ make -j16
Wait…
10
Simple build… envsetup
envsetup.sh
This script is for setting up the build environment on the
current shell
● adding macros
● type hmm to list all macros created
● godir - move to the directory containing a file
● m, mm, mmm - macros to start a build with different args
● cgrep - alias to execute grep on c/c++ files
● jgrep - alias to execute grep on java files
11
Simple build… lunch
lunch
● It lists all the combos available in the current
environment to be built
● By following all vendor/* and device/* folders looking for the
vendorsetup.sh files.
● vendorsetup.sh files actually executes the add_lunch_combo with
parameters
12
Simple build… combos
● A build combo are combination of a product to build and
the variant to use.
● product (TARGET_PRODUCT)
● A product defines how the final Android image is, selecting it’s services, initialization,
applications to install etc. For example aosp - for emulators.
● build variant (TARGET_BUILD_VARIANT) select the purpose of this
build. The options are:
● user: Includes modules tagged user, usually used for final release.
● userdebug: Includes modules tagged user or debug. Usually for platform testing.
● eng: Includes modules tagged user, debug or eng. Usually for development phase.
13
Simple build… env variables
lunch sets env variables used by the build.
PATH $ANDROID_JAVA_TOOLCHAIN:$PATH:$ANDROID_BUILD_PATHS
ANDROID_EABI_TOOLCHAIN aosp-root/prebuilt/linux-x86/toolchain/arm-
eabi-4.4.3/bin
ANDROID_TOOLCHAIN $ANDROID_EABI_TOOLCHAIN
ANDROID_BUILD_TOP aosp-root
ANDROID_PRODUCT_OUT aosp-root/out/target/product/generic (has an alias OUT)
TARGET_BUILD_VARIANT eng,user,userdebug
TARGET_BUILD_TYPE debug or release
14
Simple build… output
The build output is generated in the folder defined by
● ANDROID_PRODUCT_OUT usually aosp/out
The output is composed by modules built for the host
system and target ones
● The system image is created in target folder under a
directory named with the target product name
● aosp/out/target/product/aosp/
15
Simple build… images
The following files (among others) are created:
● ramdisk.img
● Contains the root file system of Android, including
● init.* configuration files
● default.prop containing the read only properties of this AOSP build
● /system mounting point
● system.img
● Contains the components generated by the AOSP build, including
● framework, applications, daemons
16
Simple build… images
● userdata.img
● Partition to hold the user data. Usually empty after the build
● recovery.img, ramdisk-recovery.img
● basic image partition used to recover user data or even the actual
system if anything goes wrong.
17
Simple build… emulator
● Open emulator for testing
● Build has set up PATH var to point to an
emulator executable.
emulator -show-kernel -shell
● Model number
● Build number
18
Product customization structure
● The aosp-root/device folder
contains the customizations
● Building procedures and extensions for the
targeted “Android based product” of this
build.
● Devices are grouped by vendor
● Each device have one or more
products and boards.
19
Product customization structure
Product main makefiles:
● AndroidProducts.mk
● full_<product_name>.mk
● Android.mk
● AndroidBoard.mk
● BoardConfig.mk
● device_<board_name>.mk
20
Android product makefile
● AndroidProducts.mk list the products of this vendor
setting the PRODUCT_MAKEFILES build variable
● For instance the device/generic/qemu/AndroidProducts.mk
As reference check build/target/product/AndroidProducts.mk
21
Android product makefile
● A product makefile (full_<product_name>.mk) contains
the product properties (name, version etc) and extras like
modules/programs or prebuilt files to be included in the
build.
● It could include/inherit from other predefined mk files
from build/target/product/
● It must define its boards makefile
● device_<board_name>.mk
As reference check build/target/product/
22
Android product makefile
● Product properties
● PRODUCT_NAME := aosp_arm
● This is the name that will appear in the lunch combo option. This must match this
product folder under devices folder.
● PRODUCT_DEVICE := generic
● This must match the device’s sub directory. TARGET_DEVICE derives from this
variable.
● PRODUCT_MODEL := AOSP on ARM Emulator
● The end-user-visible name for the end product.
23
Android product makefile
● Product files to copy
PRODUCT_COPY_FILES :=  device/sample/etc/apns-conf_br.xml:
system/etc/apns-conf.xml  device/ti/panda/media_codecs.xml:
system/etc/media_codecs.xml  device/ti/panda/init.rc:root/init.rc
● Forces the copy of those files on the final build
24
Android product makefile
● Modules to be included
PRODUCT_PACKAGES += 
my_own_service_module 
CustomGallery 
lib4mywifi
● Defines which modules, besides any inherited (due to the ‘+’ before
the equals), we want to include on the build.
● It could include libs/apps that are only defined under
device/<my_company>/<my_product>.
25
Android product makefile
● Overriding frameworks/packages config/layout files
PRODUCT_PACKAGE_OVERLAYS :=
device/<my_company>/<my_product>/overlay
● Defines a directory that will override the AOSP sources.
● Avoid changing the frameworks folder directly
● The sub folders must have the same AOSP root structure.
device/<my_company>/<my_product>/overlay/frameworks/base/c
ore/res/res/values/config.xml
26
Android product makefile
● Common overlayed files
frameworks/base/core/res/res/values/config.xml
● config_supportAutoRotation
● Enables auto rotation support
● config_longPressOnPowerBehavior
● defines if pressing power button show a global actions menu, only power off or do
nothing.
● config_shortPressOnPowerBehavior
● Similar to above but with other options
● “Documented” here: https://github.
com/android/platform_frameworks_base/blob/master/core/res/res/values/config.xml
27
Android product makefile
● Common overlayed files
frameworks/base/core/res/res/drawable-
nodpi/default_wallpaper.jpg
● Replaces the default wallpaper with no Wallpaper service
customization
28
Android product inheritance
● Inherit to reuse
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
● Inheriting from full_base.mk would define most of the needed base
configurations.
● full_base inherits from
● AllAudio.mk
● Importing some audios for the system
● locales_full.mk
● Get lists of supported languages
● generic_no_telephony.mk
● Includes apps like Calendar, Music, Settings
● Besides includes wpa_supplicant
29
Android product inheritance
● Makefile inheritance
● In order to have the minimal configuration you need
embedded.mk
base.mk
core_minimal.mk
core.mk
generic_no_telephony.mk
full_base.mk
telephony.mk & aosp_base.mk
full_base_telephony.mk
30
Android product inheritance
● Other important make files
● emulator.mk
● Creates the emulator tools for this build.
● Must be included in the MKs in order to get it created.
● telephony.mk
● Includes Dialer and MMS apps
● Include the rild (radio interface layer daemon)
31
Android.mk
If there is any module is defined under
devices/<my_company>/<my_product>
folder to be built, an Android.mk file is needed to call
recursively the build on the sub folders.
32
AndroidBoard.mk
“Binds” the Android to the Board
● Defines the kernel build to use
● device/lge/mako/AndroidBoard.mk
33
BoardConfig.mk
Configures the board (hardware) related parameters
Usually in the same product folder, but could be separated:
device/<my_company>/<my_board>/
Defined by the PRODUCT_DEVICE
● Boot args for loading kernel
● Target CPU, CPU variant
● Partitions sizes
● Build compilation flags
34
BoardConfig.mk
Simple BoardConfig.mk
35
device.mk
● A device makefile (device_<board_name>.mk) contains
the board properties
● Same variables used by the product makefile but now
more attached to the board
● May define this boards overlays
● DEVICE_PACKAGE_OVERLAYS
● It may include any board specific makefiles
As reference check build/target/board/
36
Android product makefile
37
AndroidProducts.mk
full_<product>.mk
Android.mk
AndroidBoard.mk
BoardConfig.mk
device_<board>.mk
vendorsetup.sh
Creating my own product
● Organization “BossaNova” wants to create an Android
product called “Girl Of Ipanema” that runs on the “Tom
Jobim” board.
● This product basically allows a customer to have a customized
Android that has info about Girl Of Ipanema song.
● Create the organization folder under device folder
● Create the device folder where the product and board
files are located
● Customize it
38
Creating my own product
Folders/files structure
● Create bossanova organization folder
● Under bossanova
● Create board mk files
● device_tomjobim.mk (build/target/board/generic/device.mk)
● BoardConfig.mk (build/target/board/generic/BoardConfig.mk)
● AndroidProducts.mk
● full_girlofipanema.mk
● Create script to include this product combo into the lunch menu
● vendorsetup.sh
39
Creating my own product
Folders/files content
● AndroidProducts.mk
PRODUCT_MAKEFILES := $(LOCAL_DIR)/full_girlofipanema.mk
● device_tomjobim.mk
Includes Emulator’s make file
include $(SRC_TARGET_DIR)/product/emulator.mk
Define this devices overlay directory (Just wallpaper replacement)
DEVICE_PACKAGE_OVERLAYS := device/bossanova/tomjobim/boardoverlays
frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.jpg
40
Creating my own product
Folders/files content
● BoardConfig.mk
● Pretty much the emulator’s one
● Reducing the size of userdata partition to 256M
BOARD_USERDATAIMAGE_PARTITION_SIZE := 268435456
● vendorsetup.sh
● Added our combos
41
Creating my own product
Folders/files content
● full_girlofipanema.mk
Define products info (model, name, device…)
Setting this product overlay defining the launchers wallpaper
PRODUCT_PACKAGE_OVERLAYS := device/bossanova/tomjobim/goi_overlays
Customized config.xml overlay
config_toastDefaultGravity=top|center_horizontal
Set the languages to be included in the build
PRODUCT_LOCALES := en_US pt_BR
42
Creating my own product build
Build Girl of Ipanema’s Android for Tom Jobim board
$ source build/envsetup.sh
$ lunch
You're building on Linux
Lunch menu... pick a combo:
[..]
22. full_girlofipanema-userdebug
23. full_girlofipanema-user
24. full_girlofipanema-eng
Which would you like? [aosp_arm-eng] 22
make -j16
43
Emulator
44
Create a second product
● Organization “BossaNova” wants to create another
Android product called “One Note Samba” that runs on
the “Tom Jobim” board.
● This product comes with a default prebuilt app to play
One Note Samba song repeatedly
● This is not a phone but a tablet
● Target market will be Brazil (so default language is
portuguese)
● Change the custom boot animation
45
Creating my own product
Folders/files structure
● Under bossanova
● Create product mk files
● full_onenotesamba.mk
● Update the following files
● AndroidProducts.mk
● vendorsetup.sh
● Create the custom app folder
46
Creating my own product
Folders/files content
● AndroidProducts.mk
PRODUCT_MAKEFILES := 
$(LOCAL_DIR)/full_girlofipanema.mk 
$(LOCAL_DIR)/full_onenotesamba.mk
● vendorsetup.sh
Added our combos
add_lunch_combo full_onenotesamba-userdebug
add_lunch_combo full_onenotesamba-user
add_lunch_combo full_onenotesamba-eng
47
Creating my own product
Folders/files content
● full_onenotesamba.mk
Add a new package to be included into the build, set the overlay folder and
the tablet characteristic
PRODUCT_PACKAGES += OneNoteSambaPlayer
PRODUCT_PACKAGE_OVERLAYS := device/bossanova/tomjobim/ons_overlays
PRODUCT_CHARACTERISTICS := tablet
PRODUCT_COPY_FILES += device/bossanova/tomjobim/bootanimation.zip:
system/media/bootanimation.zip
48
Creating my own product
Folders/files content
● full_onenotesamba.mk
Customized config.xml overlay (setting toast to be in the center)
config_toastDefaultGravity=center_vertical|center_horizontal
Set portuguese to be the default language
PRODUCT_LOCALES := pt_BR en_US
49
Adding a prebuilt app
Create a directory under tomjobim directory
devices/bossanova/tomjobim/OneNoteSambaApp
Copy the pre built apk file into it
Create the Android.mk for describing how to build it
50
Adding a prebuilt app
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# Module name should match apk name to be installed.
LOCAL_MODULE := OneNoteSambaPlayer
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := PRESIGNED
include $(BUILD_PREBUILT)
51
Summary
● AOSP build system has standards mechanisms to allow
customizations
● Following them is important to allow others to expand
and customize your device
● However its documentation is mostly by reading the
code
52
References
Embedded Android, Karim J. Yaghmour - www.opersys.
com/training/embedded-android
Free electrons training - free-electrons.com/training/android
Jelly Bean Device Porting Walk through, Benjamin Zores, ABS 2013 -
speakerdeck.com/gxben/jelly-bean-device-porting-walkthrough
Zip File with Device Folder - phiinnovations.com/files/bossanova.zip
Phi Innovations - www.phiinnovations.com
53
Q&A*
● Now
● Later
● rafael.coutinho@phiinnovations.com
● @rafaelcoutinho
* possibly there will be an answer
54
Ad

More Related Content

What's hot (20)

Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
Jayanta Ghoshal
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
William Lee
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Opersys inc.
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Opersys inc.
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
Opersys inc.
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
National Cheng Kung University
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
Opersys inc.
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
Opersys inc.
 
Android device driver structure introduction
Android device driver structure introductionAndroid device driver structure introduction
Android device driver structure introduction
William Liang
 
Android Internals
Android InternalsAndroid Internals
Android Internals
Opersys inc.
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
Emertxe Information Technologies Pvt Ltd
 
Init of Android
Init of AndroidInit of Android
Init of Android
Tetsuyuki Kobayashi
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
Emertxe Information Technologies Pvt Ltd
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
Nanik Tolaram
 
Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'
Tetsuyuki Kobayashi
 
A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)
Siji Sunny
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Nanik Tolaram
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
Utkarsh Mankad
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
Linaro
 
How To Build Android for ARM Chip boards
How To Build Android for ARM Chip boardsHow To Build Android for ARM Chip boards
How To Build Android for ARM Chip boards
Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院)
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
Jayanta Ghoshal
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
William Lee
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Opersys inc.
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Opersys inc.
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
Opersys inc.
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
Opersys inc.
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
Opersys inc.
 
Android device driver structure introduction
Android device driver structure introductionAndroid device driver structure introduction
Android device driver structure introduction
William Liang
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
Nanik Tolaram
 
Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'
Tetsuyuki Kobayashi
 
A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)
Siji Sunny
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Nanik Tolaram
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
Utkarsh Mankad
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
Linaro
 

Viewers also liked (10)

Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
ijafrc
 
Aosp+
Aosp+Aosp+
Aosp+
jpuderer
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
Opersys inc.
 
Buildsystem.mk
Buildsystem.mkBuildsystem.mk
Buildsystem.mk
Rémy Gottschalk
 
Kid's Way. Safe discovery! (parental control android launcher). Partners deck.
Kid's Way. Safe discovery! (parental control android launcher). Partners deck. Kid's Way. Safe discovery! (parental control android launcher). Partners deck.
Kid's Way. Safe discovery! (parental control android launcher). Partners deck.
Kid's Way. Safe discovery!
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
Gary Bisson
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
pundiramit
 
Red Bend Software: Optimizing the User Experience with Over-the-Air Updates
Red Bend Software: Optimizing the User Experience with Over-the-Air UpdatesRed Bend Software: Optimizing the User Experience with Over-the-Air Updates
Red Bend Software: Optimizing the User Experience with Over-the-Air Updates
Red Bend Software
 
Project proposal android operating system
Project proposal android operating systemProject proposal android operating system
Project proposal android operating system
Attiq12
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
Chris Simmonds
 
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
ijafrc
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
Opersys inc.
 
Kid's Way. Safe discovery! (parental control android launcher). Partners deck.
Kid's Way. Safe discovery! (parental control android launcher). Partners deck. Kid's Way. Safe discovery! (parental control android launcher). Partners deck.
Kid's Way. Safe discovery! (parental control android launcher). Partners deck.
Kid's Way. Safe discovery!
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
Gary Bisson
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
pundiramit
 
Red Bend Software: Optimizing the User Experience with Over-the-Air Updates
Red Bend Software: Optimizing the User Experience with Over-the-Air UpdatesRed Bend Software: Optimizing the User Experience with Over-the-Air Updates
Red Bend Software: Optimizing the User Experience with Over-the-Air Updates
Red Bend Software
 
Project proposal android operating system
Project proposal android operating systemProject proposal android operating system
Project proposal android operating system
Attiq12
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
Chris Simmonds
 
Ad

Similar to Android open source project build system phi innovations - android summit 2015 (20)

Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
Opersys inc.
 
Autotools
AutotoolsAutotools
Autotools
Vibha Singh
 
The Android Build System - Android Marshmallow
The Android Build System - Android MarshmallowThe Android Build System - Android Marshmallow
The Android Build System - Android Marshmallow
Ron Munitz
 
Embedded linux build systems
Embedded linux build systems  Embedded linux build systems
Embedded linux build systems
Mender.io
 
Don't Fear the Autotools
Don't Fear the AutotoolsDon't Fear the Autotools
Don't Fear the Autotools
Scott Garman
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VI
Opersys inc.
 
Crafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using BuilrootCrafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using Builroot
Sourabh Singh Tomar
 
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VLeveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon V
Opersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
Opersys inc.
 
Android Platform Debugging & Development
Android Platform Debugging & Development Android Platform Debugging & Development
Android Platform Debugging & Development
Qualcomm Developer Network
 
XPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, FujitsuXPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, Fujitsu
The Linux Foundation
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
Opersys inc.
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
Otavio Salvador
 
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Erich Beyrent
 
OpenWRT guide and memo
OpenWRT guide and memoOpenWRT guide and memo
OpenWRT guide and memo
家榮 吳
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
melbats
 
Mesa and Its Debugging
Mesa and Its DebuggingMesa and Its Debugging
Mesa and Its Debugging
GlobalLogic Ukraine
 
tools cli java
tools cli javatools cli java
tools cli java
TiNguyn863920
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
Abid Malik
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
Opersys inc.
 
The Android Build System - Android Marshmallow
The Android Build System - Android MarshmallowThe Android Build System - Android Marshmallow
The Android Build System - Android Marshmallow
Ron Munitz
 
Embedded linux build systems
Embedded linux build systems  Embedded linux build systems
Embedded linux build systems
Mender.io
 
Don't Fear the Autotools
Don't Fear the AutotoolsDon't Fear the Autotools
Don't Fear the Autotools
Scott Garman
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VI
Opersys inc.
 
Crafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using BuilrootCrafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using Builroot
Sourabh Singh Tomar
 
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VLeveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon V
Opersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
Opersys inc.
 
XPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, FujitsuXPDDS18: A dive into kbuild - Cao jin, Fujitsu
XPDDS18: A dive into kbuild - Cao jin, Fujitsu
The Linux Foundation
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
Opersys inc.
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
Otavio Salvador
 
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Erich Beyrent
 
OpenWRT guide and memo
OpenWRT guide and memoOpenWRT guide and memo
OpenWRT guide and memo
家榮 吳
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
melbats
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
Abid Malik
 
Ad

Recently uploaded (20)

Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 

Android open source project build system phi innovations - android summit 2015

  • 1. Building My Product on Android Open Source Project Android Builders Summit 2015 Rafael Coutinho - Software Engineer Phi Innovations 1
  • 2. Agenda ● Motivation ● Build System Overview ● Simple Build ● Product Customization Structure ● Create My Own Products ● Summary ● Q&A 2
  • 3. Motivation ● At work we design hardware, customize the operating system, develop high level applications ● SoCs based on ● Freescale (iMX53, iMX6) ● Texas Instruments (Beaglebones) ● AllWinner (A20) ● FriendlyARM (Tiny210) ● Android basic porting are provided by these vendors ● However usually not in a standard way 3
  • 4. Motivation ● Not in a standard way tricks we have found ● Shell scripts to define the Android variables during build. ● Shell scripts copied to the build that are executed on the init.rc and then set the actual Android environment variables/configurations. ● Manually executed commands during build (like for compiling HALs) ● Provide a pre built tar file with the root file system to be copied over the final build ● Hard time figuring out why our customizations do not go thru the build in each provided AOSP porting 4
  • 5. Motivation ● Looking for AOSP build process documentation we have found it is scarce and what is available is old or cached versions ● build/core/build-system.html - Starts with “Status: Draft (as of May 18, 2006)” ● KAndroid website with cached old version of the Android build ● Embedded Android book from Karim Yaghmour ● Free electrons training ● Some ABS previous presentations ● Usually deep and complete but also complex 5
  • 6. Motivation ● Describe how to customize an AOSP for a target product using the standard AOSP build mechanisms ● Making easier to extend/develop ported AOSPs on customized boards 6
  • 7. Android Build System Build systems are software tools designed to automate the process of program compilation. Google defined a GNU/Make based build system for Android ● Replacing Makefile files with Android.mk ● New imported modules must have it’s Makefiles “translated” ● No tool like menuconfig available by default 7
  • 8. Android Build System Architecture Originals at: www.opersys.com/training/embedded-android 8
  • 9. Simple build Execute the build once (to be fearless) Build combo aosp_arm-eng Simple build for development targeting emulator 9
  • 10. Simple build $ source build/envsetup.sh $ lunch You're building on Linux Lunch menu... pick a combo: 1. aosp_arm-eng 2. aosp_arm64-eng 3. aosp_mips-eng Which would you like? [aosp_arm-eng] $ make -j16 Wait… 10
  • 11. Simple build… envsetup envsetup.sh This script is for setting up the build environment on the current shell ● adding macros ● type hmm to list all macros created ● godir - move to the directory containing a file ● m, mm, mmm - macros to start a build with different args ● cgrep - alias to execute grep on c/c++ files ● jgrep - alias to execute grep on java files 11
  • 12. Simple build… lunch lunch ● It lists all the combos available in the current environment to be built ● By following all vendor/* and device/* folders looking for the vendorsetup.sh files. ● vendorsetup.sh files actually executes the add_lunch_combo with parameters 12
  • 13. Simple build… combos ● A build combo are combination of a product to build and the variant to use. ● product (TARGET_PRODUCT) ● A product defines how the final Android image is, selecting it’s services, initialization, applications to install etc. For example aosp - for emulators. ● build variant (TARGET_BUILD_VARIANT) select the purpose of this build. The options are: ● user: Includes modules tagged user, usually used for final release. ● userdebug: Includes modules tagged user or debug. Usually for platform testing. ● eng: Includes modules tagged user, debug or eng. Usually for development phase. 13
  • 14. Simple build… env variables lunch sets env variables used by the build. PATH $ANDROID_JAVA_TOOLCHAIN:$PATH:$ANDROID_BUILD_PATHS ANDROID_EABI_TOOLCHAIN aosp-root/prebuilt/linux-x86/toolchain/arm- eabi-4.4.3/bin ANDROID_TOOLCHAIN $ANDROID_EABI_TOOLCHAIN ANDROID_BUILD_TOP aosp-root ANDROID_PRODUCT_OUT aosp-root/out/target/product/generic (has an alias OUT) TARGET_BUILD_VARIANT eng,user,userdebug TARGET_BUILD_TYPE debug or release 14
  • 15. Simple build… output The build output is generated in the folder defined by ● ANDROID_PRODUCT_OUT usually aosp/out The output is composed by modules built for the host system and target ones ● The system image is created in target folder under a directory named with the target product name ● aosp/out/target/product/aosp/ 15
  • 16. Simple build… images The following files (among others) are created: ● ramdisk.img ● Contains the root file system of Android, including ● init.* configuration files ● default.prop containing the read only properties of this AOSP build ● /system mounting point ● system.img ● Contains the components generated by the AOSP build, including ● framework, applications, daemons 16
  • 17. Simple build… images ● userdata.img ● Partition to hold the user data. Usually empty after the build ● recovery.img, ramdisk-recovery.img ● basic image partition used to recover user data or even the actual system if anything goes wrong. 17
  • 18. Simple build… emulator ● Open emulator for testing ● Build has set up PATH var to point to an emulator executable. emulator -show-kernel -shell ● Model number ● Build number 18
  • 19. Product customization structure ● The aosp-root/device folder contains the customizations ● Building procedures and extensions for the targeted “Android based product” of this build. ● Devices are grouped by vendor ● Each device have one or more products and boards. 19
  • 20. Product customization structure Product main makefiles: ● AndroidProducts.mk ● full_<product_name>.mk ● Android.mk ● AndroidBoard.mk ● BoardConfig.mk ● device_<board_name>.mk 20
  • 21. Android product makefile ● AndroidProducts.mk list the products of this vendor setting the PRODUCT_MAKEFILES build variable ● For instance the device/generic/qemu/AndroidProducts.mk As reference check build/target/product/AndroidProducts.mk 21
  • 22. Android product makefile ● A product makefile (full_<product_name>.mk) contains the product properties (name, version etc) and extras like modules/programs or prebuilt files to be included in the build. ● It could include/inherit from other predefined mk files from build/target/product/ ● It must define its boards makefile ● device_<board_name>.mk As reference check build/target/product/ 22
  • 23. Android product makefile ● Product properties ● PRODUCT_NAME := aosp_arm ● This is the name that will appear in the lunch combo option. This must match this product folder under devices folder. ● PRODUCT_DEVICE := generic ● This must match the device’s sub directory. TARGET_DEVICE derives from this variable. ● PRODUCT_MODEL := AOSP on ARM Emulator ● The end-user-visible name for the end product. 23
  • 24. Android product makefile ● Product files to copy PRODUCT_COPY_FILES := device/sample/etc/apns-conf_br.xml: system/etc/apns-conf.xml device/ti/panda/media_codecs.xml: system/etc/media_codecs.xml device/ti/panda/init.rc:root/init.rc ● Forces the copy of those files on the final build 24
  • 25. Android product makefile ● Modules to be included PRODUCT_PACKAGES += my_own_service_module CustomGallery lib4mywifi ● Defines which modules, besides any inherited (due to the ‘+’ before the equals), we want to include on the build. ● It could include libs/apps that are only defined under device/<my_company>/<my_product>. 25
  • 26. Android product makefile ● Overriding frameworks/packages config/layout files PRODUCT_PACKAGE_OVERLAYS := device/<my_company>/<my_product>/overlay ● Defines a directory that will override the AOSP sources. ● Avoid changing the frameworks folder directly ● The sub folders must have the same AOSP root structure. device/<my_company>/<my_product>/overlay/frameworks/base/c ore/res/res/values/config.xml 26
  • 27. Android product makefile ● Common overlayed files frameworks/base/core/res/res/values/config.xml ● config_supportAutoRotation ● Enables auto rotation support ● config_longPressOnPowerBehavior ● defines if pressing power button show a global actions menu, only power off or do nothing. ● config_shortPressOnPowerBehavior ● Similar to above but with other options ● “Documented” here: https://github. com/android/platform_frameworks_base/blob/master/core/res/res/values/config.xml 27
  • 28. Android product makefile ● Common overlayed files frameworks/base/core/res/res/drawable- nodpi/default_wallpaper.jpg ● Replaces the default wallpaper with no Wallpaper service customization 28
  • 29. Android product inheritance ● Inherit to reuse $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) ● Inheriting from full_base.mk would define most of the needed base configurations. ● full_base inherits from ● AllAudio.mk ● Importing some audios for the system ● locales_full.mk ● Get lists of supported languages ● generic_no_telephony.mk ● Includes apps like Calendar, Music, Settings ● Besides includes wpa_supplicant 29
  • 30. Android product inheritance ● Makefile inheritance ● In order to have the minimal configuration you need embedded.mk base.mk core_minimal.mk core.mk generic_no_telephony.mk full_base.mk telephony.mk & aosp_base.mk full_base_telephony.mk 30
  • 31. Android product inheritance ● Other important make files ● emulator.mk ● Creates the emulator tools for this build. ● Must be included in the MKs in order to get it created. ● telephony.mk ● Includes Dialer and MMS apps ● Include the rild (radio interface layer daemon) 31
  • 32. Android.mk If there is any module is defined under devices/<my_company>/<my_product> folder to be built, an Android.mk file is needed to call recursively the build on the sub folders. 32
  • 33. AndroidBoard.mk “Binds” the Android to the Board ● Defines the kernel build to use ● device/lge/mako/AndroidBoard.mk 33
  • 34. BoardConfig.mk Configures the board (hardware) related parameters Usually in the same product folder, but could be separated: device/<my_company>/<my_board>/ Defined by the PRODUCT_DEVICE ● Boot args for loading kernel ● Target CPU, CPU variant ● Partitions sizes ● Build compilation flags 34
  • 36. device.mk ● A device makefile (device_<board_name>.mk) contains the board properties ● Same variables used by the product makefile but now more attached to the board ● May define this boards overlays ● DEVICE_PACKAGE_OVERLAYS ● It may include any board specific makefiles As reference check build/target/board/ 36
  • 38. Creating my own product ● Organization “BossaNova” wants to create an Android product called “Girl Of Ipanema” that runs on the “Tom Jobim” board. ● This product basically allows a customer to have a customized Android that has info about Girl Of Ipanema song. ● Create the organization folder under device folder ● Create the device folder where the product and board files are located ● Customize it 38
  • 39. Creating my own product Folders/files structure ● Create bossanova organization folder ● Under bossanova ● Create board mk files ● device_tomjobim.mk (build/target/board/generic/device.mk) ● BoardConfig.mk (build/target/board/generic/BoardConfig.mk) ● AndroidProducts.mk ● full_girlofipanema.mk ● Create script to include this product combo into the lunch menu ● vendorsetup.sh 39
  • 40. Creating my own product Folders/files content ● AndroidProducts.mk PRODUCT_MAKEFILES := $(LOCAL_DIR)/full_girlofipanema.mk ● device_tomjobim.mk Includes Emulator’s make file include $(SRC_TARGET_DIR)/product/emulator.mk Define this devices overlay directory (Just wallpaper replacement) DEVICE_PACKAGE_OVERLAYS := device/bossanova/tomjobim/boardoverlays frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.jpg 40
  • 41. Creating my own product Folders/files content ● BoardConfig.mk ● Pretty much the emulator’s one ● Reducing the size of userdata partition to 256M BOARD_USERDATAIMAGE_PARTITION_SIZE := 268435456 ● vendorsetup.sh ● Added our combos 41
  • 42. Creating my own product Folders/files content ● full_girlofipanema.mk Define products info (model, name, device…) Setting this product overlay defining the launchers wallpaper PRODUCT_PACKAGE_OVERLAYS := device/bossanova/tomjobim/goi_overlays Customized config.xml overlay config_toastDefaultGravity=top|center_horizontal Set the languages to be included in the build PRODUCT_LOCALES := en_US pt_BR 42
  • 43. Creating my own product build Build Girl of Ipanema’s Android for Tom Jobim board $ source build/envsetup.sh $ lunch You're building on Linux Lunch menu... pick a combo: [..] 22. full_girlofipanema-userdebug 23. full_girlofipanema-user 24. full_girlofipanema-eng Which would you like? [aosp_arm-eng] 22 make -j16 43
  • 45. Create a second product ● Organization “BossaNova” wants to create another Android product called “One Note Samba” that runs on the “Tom Jobim” board. ● This product comes with a default prebuilt app to play One Note Samba song repeatedly ● This is not a phone but a tablet ● Target market will be Brazil (so default language is portuguese) ● Change the custom boot animation 45
  • 46. Creating my own product Folders/files structure ● Under bossanova ● Create product mk files ● full_onenotesamba.mk ● Update the following files ● AndroidProducts.mk ● vendorsetup.sh ● Create the custom app folder 46
  • 47. Creating my own product Folders/files content ● AndroidProducts.mk PRODUCT_MAKEFILES := $(LOCAL_DIR)/full_girlofipanema.mk $(LOCAL_DIR)/full_onenotesamba.mk ● vendorsetup.sh Added our combos add_lunch_combo full_onenotesamba-userdebug add_lunch_combo full_onenotesamba-user add_lunch_combo full_onenotesamba-eng 47
  • 48. Creating my own product Folders/files content ● full_onenotesamba.mk Add a new package to be included into the build, set the overlay folder and the tablet characteristic PRODUCT_PACKAGES += OneNoteSambaPlayer PRODUCT_PACKAGE_OVERLAYS := device/bossanova/tomjobim/ons_overlays PRODUCT_CHARACTERISTICS := tablet PRODUCT_COPY_FILES += device/bossanova/tomjobim/bootanimation.zip: system/media/bootanimation.zip 48
  • 49. Creating my own product Folders/files content ● full_onenotesamba.mk Customized config.xml overlay (setting toast to be in the center) config_toastDefaultGravity=center_vertical|center_horizontal Set portuguese to be the default language PRODUCT_LOCALES := pt_BR en_US 49
  • 50. Adding a prebuilt app Create a directory under tomjobim directory devices/bossanova/tomjobim/OneNoteSambaApp Copy the pre built apk file into it Create the Android.mk for describing how to build it 50
  • 51. Adding a prebuilt app Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Module name should match apk name to be installed. LOCAL_MODULE := OneNoteSambaPlayer LOCAL_SRC_FILES := $(LOCAL_MODULE).apk LOCAL_MODULE_CLASS := APPS LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) LOCAL_CERTIFICATE := PRESIGNED include $(BUILD_PREBUILT) 51
  • 52. Summary ● AOSP build system has standards mechanisms to allow customizations ● Following them is important to allow others to expand and customize your device ● However its documentation is mostly by reading the code 52
  • 53. References Embedded Android, Karim J. Yaghmour - www.opersys. com/training/embedded-android Free electrons training - free-electrons.com/training/android Jelly Bean Device Porting Walk through, Benjamin Zores, ABS 2013 - speakerdeck.com/gxben/jelly-bean-device-porting-walkthrough Zip File with Device Folder - phiinnovations.com/files/bossanova.zip Phi Innovations - www.phiinnovations.com 53
  • 54. Q&A* ● Now ● Later ● [email protected] ● @rafaelcoutinho * possibly there will be an answer 54