SlideShare a Scribd company logo
1 of 47
Download to read offline
Build AOSP
AGENDA
01
Fetch sources
02
Building
Configuration
03
Build & flash
04
AOSP puzzle
FETCH SOURCES01
s.android.com
FETCH SOURCES
Get materials
Sources
(git)
Doc &
tutorials
CDD, CTS
repo
FETCH SOURCES
Repo them all
fetch status cmd
# repo init
-u https://android.googlesource.com/platform/manifest
-b android-6.0.0_r3
# repo sync -j8
FETCH SOURCES
fetch & coffee
SOURCES DETAILS
Folders 1/5
repo configuration & data.repo
Google Android libc implementationbionic
Recoverybootable
Build Systembuild
SOURCES DETAILS
Folders 2/5
Compatibility Test Suitects
Virtual Machinedalvik | art
Configuration for each target devicedevice
SOURCES DETAILS
Folders 3/5
source.android.comdocs
boringssl, sqlite, bzip2, ...external
Android Framework -> APIframeworks
Hardware Abstraction Layerhardware
SOURCES DETAILS
Folders 4/5
Java implementation (Apache Harmony)libcore
Native Development Kit Sourcesndk
Results of YOUR compilationsout
base apps/services (sms, photo, Settings, NFC …)packages
SOURCES DETAILS
Folders 5/5
Binaries (toolchain, gdbserver…)prebuilts
Standard Development Kit Sourcessdk
Base : init, netd, vold, toolbox, logcat...system
Vendors directories (libs, apps, overlays)vendor
LINUX KERNEL
Need a pingouin?
As binary (default)
/vendor | /device
As sources (if lucky)
/kernel
BUILDING CONFIGURATION02
HOWTO BUILD
3 basic cmds
# source build/envsetup.sh
# lunch
# make
# source ./build/envsetup.sh
// include all existing vendorsetup.sh in ./device
// and define cmds
...
- lunch: lunch <product_name>-<build_variant>
- croot: Changes directory to the top of the tree.
- m: Makes from the top of the tree.
- mm* : Builds all of the modules in the current/suplied directory, with,
/without their dependencies.
- cgrep: Greps on all local C/C++ files.
- jgrep: Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- sepgrep: Greps on all loacal sepolicy files
...
PREPARE TO BUILD
Set env
PREPARE TO
BUILD
Prepare ingredient
vendorsetup.sh
Lunch entry point
in device/manufacturer/device
TYPE = eng | userdebug | release
AndroidProducts.mk
The first makefile
add_lunch_combo TARGETNAME-TYPE
PRODUCT_MAKEFILES = TARGETNAME.mk
BUILD BASICS
Nexus 9 example
# tail -n1 device/htc/flounder/vendorsetup.sh
add_lunch_combo aosp_flounder-userdebug
# tail -n3 device/htc/flounder/AndroidProducts.mk
PRODUCT_MAKEFILES := 
$(LOCAL_DIR)/aosp_flounder.mk 
$(LOCAL_DIR)/aosp_flounder64.mk 
$(LOCAL_DIR)/aosp_flounder32.mk 
$(LOCAL_DIR)/aosp_flounder_64_only.mk
BUILD BASICS
Reading recipes
Define your
device
software
Heavy use
of
inheritance
No specific
naming
device.mk files family
BUILD BASICS
Reading recipes
# cat device/htc/flounder/aosp_flounder.mk | magic_summarize
PRODUCT_PACKAGES += 
rild 
Launcher3
# Inherit from those products. Most specific first.
$(call inherit-product, device/htc/flounder/product.mk)
$(call inherit-product, device/htc/flounder/device-lte.mk)
$(call inherit-product-if-exists, vendor/htc/flounder_lte/device-vendor.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
PRODUCT_DEVICE := flounder
PRODUCT_MODEL := AOSP on Flounder
PRODUCT_MANUFACTURER := HTC
BUILD BASICS
Reading recipes
# cat device/htc/flounder/device.mk | magic_summarize
LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
PRODUCT_COPY_FILES := 
$(LOCAL_KERNEL):kernel
PRODUCT_COPY_FILES += 
$(LOCAL_PATH)/init.flounder.rc:root/init.flounder.rc 
PRODUCT_CHARACTERISTICS := tablet, nosdcard
PRODUCT_PACKAGES += 
nfc_nci.bcm2079x.default 
NfcNci
PRODUCT_PROPERTY_OVERRIDES := 
wifi.interface=wlan0 
ro.opengles.version=196609
BUILD BASICS
Reading recipes
Define your
device
hardware
Can include
other
BoardConfig.mk
A bunch of
specific
defines
BoardConfig.mk
BUILD BASICS
Reading recipes
# cat device/htc/flounder/BoardConfig.mk | magic_summarize
TARGET_CPU_ABI := arm64-v8a
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv7-a-neon
TARGET_CPU_VARIANT := denver
TARGET_NO_BOOTLOADER := true
BOARD_KERNEL_CMDLINE := androidboot.hardware=flounder
BOARD_USES_ALSA_AUDIO := true
BOARD_HAVE_BLUETOOTH := true
BOARD_HAVE_BLUETOOTH_BCM := true
BOARD_SEPOLICY_DIRS += device/htc/flounder/sepolicy
BUILD03
BUILD SYSTEM
Set env
# source ./build/envsetup.sh
# lunch
You're building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_x86-eng
3. aosp_mips-eng
4. vbox_x86-eng
5. mini_armv7a_neon-userdebug
6. mini_x86-userdebug
7. aosp_hammerhead-userdebug #n5
8. aosp_mako-userdebug #n4
9. aosp_flo-userdebug
10. aosp_manta-userdebug #n10
[...]
BUILD SYSTEM
May the sources be with you
ONLY
NEXUS
BUILD
YOU CAN
And maybe Sony ...
BUILD SYSTEM
Let’s compile
It’s coffee time !
# make -j42
BUILD SYSTEM
AOSP makefiles
Android.mk, Android.mk everywhere
Define a component : binary, apk, lib, ...
AOSP 6.0 : ~ 2900 Android.mk
BUILD SYSTEM
AOSP makefiles : Settings app
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_JAVA_LIBRARIES := bouncycastle conscrypt telephony-common ims-common
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 android-support-v13 jsr305
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_PACKAGE_NAME := Settings
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
include $(BUILD_PACKAGE)
learn more in build/core/clear_vars.mk
BUILD SYSTEM
End of coffee time
[...]
#### make completed successfully (04:11:12 (hh:mm:ss)) ####
BUILD SYSTEM
Output
Compilation
produce
plenty of
images
One .img for each partition:
system, boot, userdata,
recovery, ...
# adb reboot bootloader
# fastboot flashall -w
FLASH SYSTEM
Ready?
# make adb fastboot
# adb reboot bootloader
# fastboot oem unlock
FLASH SYSTEM
Please, let me brick my device
May wipe your data
# fastboot flashall -w
or
# fastboot flashall ./system.img
# fastboot reboot
FLASH SYSTEM
Last call
FLASH SYSTEM
It’s good to fail
Nice try!
But fails to boot / radio doesn’t work
/ there is no sound / ...
AOSP PUZZLE
Missing pieces
04
AOSP PUZZLE
About licensing
Kernel
Framework & App
AOSP PUZZLE
The full Stack
AOSP PUZZLE
Were are missing blobs?
Download them from Google/Sony/...
https://developers.google.com/android/nexus/drivers
http://developer.sonymobile.com/knowledge-base/open-source/
Or get them from official working image
Distributed blobs are sometimes buggy
AOSP PUZZLE
Were are missing blobs?
Copy in /vendor + include in build system
inherited in device.mk
NEW : in vendor partition for some devices
AOSP PUZZLE
Try again
Delete ./out
Rebuild
Reflash
COMPILATION TIME
Tired of coffee break
CCACHE
Android support
The
Gapps
issue
NOT Open source
- gapps not distributed for everybody
- aosp apps != gapps
- Google Mobile Services are getting fat
AOSP PUZZLE
Base apps looks bad!
ANDROID CERTIFICATION
Google approve this build
API &
function
(auto)
CTS
software &
hardware
requirerments
CDD
API &
function
(manual)
CTS
verifier
final tests
Google
SUMMARY
What did he said?
# repo init ...
# repo sync
# [get binaries]
# source ./build/envsetup.sh
# lunch
# make -j42
# [unlock bootloader]
# fastboot flashall
REFERENCES
Links
https://source.android.com
http://elinux.org/Android_Portal
Books
Embedded Android, K. Yaghmour ISBN: 978-1-4493-0829-2
COPYRIGHTS
#
# Copyright (C) 2013 The Android Open-Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
The following copyright have been stripped from all the
examples :
Thank you !
Vercoutère Guillaume
gvercoutere@gmail.com
www.genymobile.com

More Related Content

What's hot

Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security InternalsOpersys inc.
 
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 debuggingUtkarsh Mankad
 
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.
 
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 PlatformsLinaro
 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateLinaro
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System ServerOpersys inc.
 
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 imagesChris Simmonds
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depthChris Simmonds
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
"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 device driver structure introduction
Android device driver structure introductionAndroid device driver structure introduction
Android device driver structure introductionWilliam Liang
 

What's hot (20)

Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
Power Management from Linux Kernel to Android
Power Management from Linux Kernel to AndroidPower Management from Linux Kernel to Android
Power Management from Linux Kernel to Android
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
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
 
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...
 
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
 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack Update
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
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
 
Introduction to Android Window System
Introduction to Android Window SystemIntroduction to Android Window System
Introduction to Android Window System
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android 10
Android 10Android 10
Android 10
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depth
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
"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)
 
Android device driver structure introduction
Android device driver structure introductionAndroid device driver structure introduction
Android device driver structure introduction
 

Similar to Building aosp

ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughBenjamin Zores
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
An Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemAn Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemLinaro
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Cheng-Yi Yu
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidVlatko Kosturjak
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
Alfresco Environment Validation and "Day Zero" Configuration
Alfresco Environment Validation and "Day Zero" ConfigurationAlfresco Environment Validation and "Day Zero" Configuration
Alfresco Environment Validation and "Day Zero" ConfigurationAlfresco Software
 
Android Embedded - Smart Hubs als Schaltzentrale des IoT
Android Embedded - Smart Hubs als Schaltzentrale des IoTAndroid Embedded - Smart Hubs als Schaltzentrale des IoT
Android Embedded - Smart Hubs als Schaltzentrale des IoTinovex GmbH
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made EasyAlon Fliess
 
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클Oracle Korea
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...Paris Open Source Summit
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to androidOwen Hsu
 
Tools that help and speed up RWD dev
Tools that help  and speed up RWD devTools that help  and speed up RWD dev
Tools that help and speed up RWD devMatjaž Korošec
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment TacticsIan Barber
 

Similar to Building aosp (20)

Core Android
Core AndroidCore Android
Core Android
 
Aosp+
Aosp+Aosp+
Aosp+
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting Walkthrough
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Hacking Android OS
Hacking Android OSHacking Android OS
Hacking Android OS
 
An Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemAn Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating System
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to Android
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Alfresco Environment Validation and "Day Zero" Configuration
Alfresco Environment Validation and "Day Zero" ConfigurationAlfresco Environment Validation and "Day Zero" Configuration
Alfresco Environment Validation and "Day Zero" Configuration
 
Android Embedded - Smart Hubs als Schaltzentrale des IoT
Android Embedded - Smart Hubs als Schaltzentrale des IoTAndroid Embedded - Smart Hubs als Schaltzentrale des IoT
Android Embedded - Smart Hubs als Schaltzentrale des IoT
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to android
 
Discover System Facilities inside Your Android Phone
Discover System Facilities inside Your Android Phone Discover System Facilities inside Your Android Phone
Discover System Facilities inside Your Android Phone
 
Tools that help and speed up RWD dev
Tools that help  and speed up RWD devTools that help  and speed up RWD dev
Tools that help and speed up RWD dev
 
My ROS Experience
My ROS ExperienceMy ROS Experience
My ROS Experience
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 

Recently uploaded

5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)861c7ca49a02
 
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证gwhohjj
 
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一Fi sss
 
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /WhatsappsBeautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsappssapnasaifi408
 
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service GayaGaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service Gayasrsj9000
 
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...srsj9000
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一diploma 1
 
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...Authentic No 1 Amil Baba In Pakistan
 
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一ss ss
 
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...Amil baba
 
existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland CultureChloeMeadows1
 
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree 毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree z zzz
 
Presentation.pptxjnfoigneoifnvoeifnvklfnvf
Presentation.pptxjnfoigneoifnvoeifnvklfnvfPresentation.pptxjnfoigneoifnvoeifnvklfnvf
Presentation.pptxjnfoigneoifnvoeifnvklfnvfchapmanellie27
 
萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程1k98h0e1
 
RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作f3774p8b
 
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degreeyuu sss
 
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best ServicesVip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Servicesnajka9823
 
Call Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile serviceCall Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile servicerehmti665
 

Recently uploaded (20)

Low rate Call girls in Delhi Justdial | 9953330565
Low rate Call girls in Delhi Justdial | 9953330565Low rate Call girls in Delhi Justdial | 9953330565
Low rate Call girls in Delhi Justdial | 9953330565
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
 
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
 
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
 
9953330565 Low Rate Call Girls In Jahangirpuri Delhi NCR
9953330565 Low Rate Call Girls In Jahangirpuri  Delhi NCR9953330565 Low Rate Call Girls In Jahangirpuri  Delhi NCR
9953330565 Low Rate Call Girls In Jahangirpuri Delhi NCR
 
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /WhatsappsBeautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
 
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service GayaGaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
 
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
 
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
 
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一
 
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
 
existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland Culture
 
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree 毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
Presentation.pptxjnfoigneoifnvoeifnvklfnvf
Presentation.pptxjnfoigneoifnvoeifnvklfnvfPresentation.pptxjnfoigneoifnvoeifnvklfnvf
Presentation.pptxjnfoigneoifnvoeifnvklfnvf
 
萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程
 
RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作
 
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
 
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best ServicesVip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Vip Udupi Call Girls 7001305949 WhatsApp Number 24x7 Best Services
 
Call Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile serviceCall Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile service
 

Building aosp

  • 5. repo FETCH SOURCES Repo them all fetch status cmd
  • 6. # repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.0_r3 # repo sync -j8 FETCH SOURCES fetch & coffee
  • 7. SOURCES DETAILS Folders 1/5 repo configuration & data.repo Google Android libc implementationbionic Recoverybootable Build Systembuild
  • 8. SOURCES DETAILS Folders 2/5 Compatibility Test Suitects Virtual Machinedalvik | art Configuration for each target devicedevice
  • 9. SOURCES DETAILS Folders 3/5 source.android.comdocs boringssl, sqlite, bzip2, ...external Android Framework -> APIframeworks Hardware Abstraction Layerhardware
  • 10. SOURCES DETAILS Folders 4/5 Java implementation (Apache Harmony)libcore Native Development Kit Sourcesndk Results of YOUR compilationsout base apps/services (sms, photo, Settings, NFC …)packages
  • 11. SOURCES DETAILS Folders 5/5 Binaries (toolchain, gdbserver…)prebuilts Standard Development Kit Sourcessdk Base : init, netd, vold, toolbox, logcat...system Vendors directories (libs, apps, overlays)vendor
  • 12. LINUX KERNEL Need a pingouin? As binary (default) /vendor | /device As sources (if lucky) /kernel
  • 14. HOWTO BUILD 3 basic cmds # source build/envsetup.sh # lunch # make
  • 15. # source ./build/envsetup.sh // include all existing vendorsetup.sh in ./device // and define cmds ... - lunch: lunch <product_name>-<build_variant> - croot: Changes directory to the top of the tree. - m: Makes from the top of the tree. - mm* : Builds all of the modules in the current/suplied directory, with, /without their dependencies. - cgrep: Greps on all local C/C++ files. - jgrep: Greps on all local Java files. - resgrep: Greps on all local res/*.xml files. - sepgrep: Greps on all loacal sepolicy files ... PREPARE TO BUILD Set env
  • 16. PREPARE TO BUILD Prepare ingredient vendorsetup.sh Lunch entry point in device/manufacturer/device TYPE = eng | userdebug | release AndroidProducts.mk The first makefile add_lunch_combo TARGETNAME-TYPE PRODUCT_MAKEFILES = TARGETNAME.mk
  • 17. BUILD BASICS Nexus 9 example # tail -n1 device/htc/flounder/vendorsetup.sh add_lunch_combo aosp_flounder-userdebug # tail -n3 device/htc/flounder/AndroidProducts.mk PRODUCT_MAKEFILES := $(LOCAL_DIR)/aosp_flounder.mk $(LOCAL_DIR)/aosp_flounder64.mk $(LOCAL_DIR)/aosp_flounder32.mk $(LOCAL_DIR)/aosp_flounder_64_only.mk
  • 18. BUILD BASICS Reading recipes Define your device software Heavy use of inheritance No specific naming device.mk files family
  • 19. BUILD BASICS Reading recipes # cat device/htc/flounder/aosp_flounder.mk | magic_summarize PRODUCT_PACKAGES += rild Launcher3 # Inherit from those products. Most specific first. $(call inherit-product, device/htc/flounder/product.mk) $(call inherit-product, device/htc/flounder/device-lte.mk) $(call inherit-product-if-exists, vendor/htc/flounder_lte/device-vendor.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk) PRODUCT_DEVICE := flounder PRODUCT_MODEL := AOSP on Flounder PRODUCT_MANUFACTURER := HTC
  • 20. BUILD BASICS Reading recipes # cat device/htc/flounder/device.mk | magic_summarize LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL) PRODUCT_COPY_FILES := $(LOCAL_KERNEL):kernel PRODUCT_COPY_FILES += $(LOCAL_PATH)/init.flounder.rc:root/init.flounder.rc PRODUCT_CHARACTERISTICS := tablet, nosdcard PRODUCT_PACKAGES += nfc_nci.bcm2079x.default NfcNci PRODUCT_PROPERTY_OVERRIDES := wifi.interface=wlan0 ro.opengles.version=196609
  • 21. BUILD BASICS Reading recipes Define your device hardware Can include other BoardConfig.mk A bunch of specific defines BoardConfig.mk
  • 22. BUILD BASICS Reading recipes # cat device/htc/flounder/BoardConfig.mk | magic_summarize TARGET_CPU_ABI := arm64-v8a TARGET_ARCH := arm64 TARGET_ARCH_VARIANT := armv7-a-neon TARGET_CPU_VARIANT := denver TARGET_NO_BOOTLOADER := true BOARD_KERNEL_CMDLINE := androidboot.hardware=flounder BOARD_USES_ALSA_AUDIO := true BOARD_HAVE_BLUETOOTH := true BOARD_HAVE_BLUETOOTH_BCM := true BOARD_SEPOLICY_DIRS += device/htc/flounder/sepolicy
  • 24. BUILD SYSTEM Set env # source ./build/envsetup.sh # lunch You're building on Linux Lunch menu... pick a combo: 1. aosp_arm-eng 2. aosp_x86-eng 3. aosp_mips-eng 4. vbox_x86-eng 5. mini_armv7a_neon-userdebug 6. mini_x86-userdebug 7. aosp_hammerhead-userdebug #n5 8. aosp_mako-userdebug #n4 9. aosp_flo-userdebug 10. aosp_manta-userdebug #n10 [...]
  • 25. BUILD SYSTEM May the sources be with you ONLY NEXUS BUILD YOU CAN And maybe Sony ...
  • 26. BUILD SYSTEM Let’s compile It’s coffee time ! # make -j42
  • 27. BUILD SYSTEM AOSP makefiles Android.mk, Android.mk everywhere Define a component : binary, apk, lib, ... AOSP 6.0 : ~ 2900 Android.mk
  • 28. BUILD SYSTEM AOSP makefiles : Settings app LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_JAVA_LIBRARIES := bouncycastle conscrypt telephony-common ims-common LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 android-support-v13 jsr305 LOCAL_SRC_FILES := $(call all-java-files-under, src) LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res LOCAL_PACKAGE_NAME := Settings LOCAL_CERTIFICATE := platform LOCAL_PRIVILEGED_MODULE := true LOCAL_PROGUARD_FLAG_FILES := proguard.flags include $(BUILD_PACKAGE) learn more in build/core/clear_vars.mk
  • 29. BUILD SYSTEM End of coffee time [...] #### make completed successfully (04:11:12 (hh:mm:ss)) ####
  • 30. BUILD SYSTEM Output Compilation produce plenty of images One .img for each partition: system, boot, userdata, recovery, ...
  • 31. # adb reboot bootloader # fastboot flashall -w FLASH SYSTEM Ready? # make adb fastboot
  • 32. # adb reboot bootloader # fastboot oem unlock FLASH SYSTEM Please, let me brick my device May wipe your data
  • 33. # fastboot flashall -w or # fastboot flashall ./system.img # fastboot reboot FLASH SYSTEM Last call
  • 34. FLASH SYSTEM It’s good to fail Nice try! But fails to boot / radio doesn’t work / there is no sound / ...
  • 38. AOSP PUZZLE Were are missing blobs? Download them from Google/Sony/... https://developers.google.com/android/nexus/drivers http://developer.sonymobile.com/knowledge-base/open-source/ Or get them from official working image Distributed blobs are sometimes buggy
  • 39. AOSP PUZZLE Were are missing blobs? Copy in /vendor + include in build system inherited in device.mk NEW : in vendor partition for some devices
  • 40. AOSP PUZZLE Try again Delete ./out Rebuild Reflash
  • 41. COMPILATION TIME Tired of coffee break CCACHE Android support
  • 42. The Gapps issue NOT Open source - gapps not distributed for everybody - aosp apps != gapps - Google Mobile Services are getting fat AOSP PUZZLE Base apps looks bad!
  • 43. ANDROID CERTIFICATION Google approve this build API & function (auto) CTS software & hardware requirerments CDD API & function (manual) CTS verifier final tests Google
  • 44. SUMMARY What did he said? # repo init ... # repo sync # [get binaries] # source ./build/envsetup.sh # lunch # make -j42 # [unlock bootloader] # fastboot flashall
  • 46. COPYRIGHTS # # Copyright (C) 2013 The Android Open-Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # The following copyright have been stripped from all the examples :
  • 47. Thank you ! Vercoutère Guillaume gvercoutere@gmail.com www.genymobile.com