SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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 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
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
 

Tendances (20)

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)
 
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
 
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...
 
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...
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
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
 
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...
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
 
Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
 

Similaire à Building aosp

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
 

Similaire à 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 Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
My ROS Experience
My ROS ExperienceMy ROS Experience
My ROS Experience
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 

Dernier

一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
wpkuukw
 
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
wpkuukw
 
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
tufbav
 
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pillsIn Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
Abortion pills in Riyadh +966572737505 get cytotec
 
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
Abortion pills in Dammam +966572737505 Buy Cytotec
Abortion pills in Dammam +966572737505 Buy CytotecAbortion pills in Dammam +966572737505 Buy Cytotec
Abortion pills in Dammam +966572737505 Buy Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
ehyxf
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
ehyxf
 
一比一原版(CSUEB毕业证书)东湾分校毕业证原件一模一样
一比一原版(CSUEB毕业证书)东湾分校毕业证原件一模一样一比一原版(CSUEB毕业证书)东湾分校毕业证原件一模一样
一比一原版(CSUEB毕业证书)东湾分校毕业证原件一模一样
ayoqf
 
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
gajnagarg
 
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
uodye
 
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
ehyxf
 
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
oopacde
 

Dernier (20)

Hilti's Latest Battery - Hire Depot.pptx
Hilti's Latest Battery - Hire Depot.pptxHilti's Latest Battery - Hire Depot.pptx
Hilti's Latest Battery - Hire Depot.pptx
 
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
 
Call Girls Amethi 9332606886 HOT & SEXY Models beautiful and charming call g...
Call Girls Amethi  9332606886 HOT & SEXY Models beautiful and charming call g...Call Girls Amethi  9332606886 HOT & SEXY Models beautiful and charming call g...
Call Girls Amethi 9332606886 HOT & SEXY Models beautiful and charming call g...
 
🌹Patia⬅️ Vip Call Girls Bhubaneswar 📱9777949614 Book Well Trand Call Girls In...
🌹Patia⬅️ Vip Call Girls Bhubaneswar 📱9777949614 Book Well Trand Call Girls In...🌹Patia⬅️ Vip Call Girls Bhubaneswar 📱9777949614 Book Well Trand Call Girls In...
🌹Patia⬅️ Vip Call Girls Bhubaneswar 📱9777949614 Book Well Trand Call Girls In...
 
Low Cost Patna Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gi...
Low Cost Patna Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gi...Low Cost Patna Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gi...
Low Cost Patna Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gi...
 
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
 
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
 
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pillsIn Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
 
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
 
Abortion pills in Dammam +966572737505 Buy Cytotec
Abortion pills in Dammam +966572737505 Buy CytotecAbortion pills in Dammam +966572737505 Buy Cytotec
Abortion pills in Dammam +966572737505 Buy Cytotec
 
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
怎样办理昆士兰大学毕业证(UQ毕业证书)成绩单留信认证
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
 
一比一原版(CSUEB毕业证书)东湾分校毕业证原件一模一样
一比一原版(CSUEB毕业证书)东湾分校毕业证原件一模一样一比一原版(CSUEB毕业证书)东湾分校毕业证原件一模一样
一比一原版(CSUEB毕业证书)东湾分校毕业证原件一模一样
 
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
 
Point of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratoryPoint of Care Testing in clinical laboratory
Point of Care Testing in clinical laboratory
 
Vashi Affordable Call Girls ,07506202331,Vasai Virar Charming Call Girl
Vashi Affordable Call Girls ,07506202331,Vasai Virar Charming Call GirlVashi Affordable Call Girls ,07506202331,Vasai Virar Charming Call Girl
Vashi Affordable Call Girls ,07506202331,Vasai Virar Charming Call Girl
 
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Jeddah +966572737505 <> buy cytotec <> unwanted kit Saudi A...
 
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
 
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
 
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
在线办理(scu毕业证)南十字星大学毕业证电子版学位证书注册证明信
 

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