19.Day2.1.Hongkong.workshop.overview.porting.git.20091031

48
Android Workshop Understanding Android Platform 2009.11.20 (Fri) SAMSUNG Electronics GeunSik Lim [email protected] htt //bl /i i/ 1/48 http://blog.naver.com/invain/

description

19.Day2.1.Hongkong.workshop.overview.porting.git.20091031

Transcript of 19.Day2.1.Hongkong.workshop.overview.porting.git.20091031

Android Workshop

Understanding Android Platform

2009.11.20 (Fri)

SAMSUNG Electronics GeunSik Lim

[email protected] //bl /i i /

1/48

http://blog.naver.com/invain/

Contents

1. Android Internals

2 Android Porting2.  Android Porting

3.  Git to Manage Android Full Source (Practice)

2/48

1. Android Internals

1. Android History2. Android Philosophy3. Android Layout4. Android Kernel Features5. Android Toolchain6 M i t f A d id K l6. Maintenance of Android Kernel

3/48

Topic 1 Opensource based Mobile Platform History

4/48

Android Overview – TimeLine 1/2Android Overview – TimeLine 1/2

Date Description2005 08 G l i d A d id I2005.08 Google acquired Android Inc. 

(Adny Rubin ‐ http://carmen.sourceforge.net/ )

2005.11 Google Bought Skia 2D Graphic Solution.GPL

2007.10 Google acquired Jaiku Inc.

2007.11 Open Handset Alliance (OHA) appointed open standard development abou t Mobile Device.

2007.11.12 Android SDK(Software Development Kit) Release http://code.google.com/p/android/downloads/listp // g g /p/ / /

Android Developer Challenge ($10 million )                            Linux 2.6.23 

2008 01 24 U it d St t 700 MH FCC i l t (5Bl k ) ti2008.01.24 United States 700 MHz FCC wireless spectrum (5Blocks) auction

2008.01.28 Google extended the deadline for the first round in the Android Developer Challenge to April 14 2008

5/48

Android Overview – TimeLine 2/2Android Overview – TimeLine 2/2

Date Description

2008.02.13 Android SDK Updated to m5‐rc14

2008.03.05 Android SDK Updated to m5‐rc15

2008.04.14 Android Developer Challenge I Deadline

2008.05.28 Google I/O (A two day developer gathering in San Francisco.)

2008 11 22 A d id B d fi t bil Ph (G1 Ph b T bil )2008.11.22 Android  Based first mobile Phone (G1 Phone by T‐mobile ) http://www.android.com/market/

2008.11.23 Apache License based Full Open Source  http://source.android.comLinux 2.6.25

2009. 2Q Unveild another Android phone based on the Linux( e.g: by HTC , by Samsung , by Motorola )( g y , y g , y )

6/48

Android’s SWOT AnalysisAndroid’s SWOT Analysis

Internal Potential PowerInternal Potential Power

• Still Vaporware in market• Lack of Vertical Integration

•Google is a content provider•Partnerships (OHA 47 companies) •Mind‐Share

•Proprietary clones•Proprietary clones (License Inheritance) •Advertising competition

•Social networking applications•Developing markets

External EnvironmentsExternal Environments7/48

Open Access ModelOpen Access Model

T-Mobile

Open Open

T-Mobile

Open Devices

Open Networks

Open Access

O

700Mhzp

Open ApplicationsOpen

Services

Reseller

8/48

Android Overview ‐ Emulator(SDK) VS. RealTargetAndroid Overview ‐ Emulator(SDK) VS. RealTarget

Real TargetReal TargetWebBrowserGoogleMAPMail ・・・

Emulator(SDK)Emulator(SDK)

/tools/lib/images/skins (-skin)

l hJava Virtual Machine

Misc Applications

l hJava Virtual Machine

Misc Applications JavaCode

JavaCode

Misc Middleware

(Dalvik VM)Java Virtual Machine 

(Dalvik VM)

ARM Misc Middleware

(Dalvik VM)Java Virtual Machine

(Dalvik VM)

ARM

Linux Kernel (2.6.23/25)

Misc MiddlewareCode

Linux Kernel (2.6.23/25)

Misc MiddlewareCode

QEMU Based Emulator

ARM

Handset Hardware(i.MX 31L , PXA 310) Target

ARM CPUEmulator

Goldfish(Virtual H/W)Hardware Emulator

Fedoar 9 (Host)X86

ARM &

X86

(ARM)libc

WebkitSQLiteopenGLopenGL ・・・

9/48

Android Overview ‐ Android LayerAndroid Overview ‐ Android Layer

Android Debug Bridge(ADB)

Applicationshttp://source.android.com

Java

X86 Linux Desktop

IM Photo Album Calculator Clock Media Player Calendar

(ADB)

Android Development Tool (ADT)

Home Contacts Phone Browser GoogleMap

Activity Windows Content View Notification

Applications Framework

. . . .Java

Dalvik Debug Monitor Service(DDMS) )

AndroidAsset Packaging Tool

Activity Manager

Windows Manager

Content Providers

ViewSystem

Notification Manager

Package Manager

Telephony Manager

Resource Manager

Location Manager

XMPP Service

Java

Mksdcard

Android Interface efinition Language(AIDL)

System Libraries

Surface manager

Media Framework

SQLite OpenGL/ES Core Libraries

C/C++

Android Runtime(Functional libraries)

Mksdcard

Class File Convertor

manager Framework

FreeType Webkit SGL SSL Bionic Libc(53 pthread)

Dalvik VM

C/C

HAL(Hardware Abstraction Layer)

Emulator(QEMU, GoldFish)

Linux C

Linux (2.6.23/25)

HAL(Hardware Abstraction Layer)Graphics Audio Radio(RIL)G P SCamera BlueTooth WiFi . . . . .

10/18

Distribution(X86)DisplayDriver BluetoothDriver Flash Driver

Binder Driver USB Driver Keypad Driver

CameraDriver

WiFi Driver Audio Driver

Power M/MC

10/48

Android  Emulator (QEMU Base) for App DevelopersAndroid

Emulator

Eclipse’s Debuggin

Emulator

HelloWorld

(Eclipse)

Snake Game

E l t ’

Snake Game

Emulator Demo App

Emulator’s Network Source

11/48

Demo App

Emulator Limitations

In official release, the limitations of the emulator include:•No support for placing or receiving actual phone calls. You can simulate phone calls (placed and received) through the emulator (p ) gconsole, however. •No support for USB connections •No support for camera/video capture (input).No support for camera/video capture (input). •No support for audio input (capture). Output (playback) is supported. •No support for device-attached headphones•No support for device-attached headphones •No support for determining connected state •No support for determining battery charge level and AC charging stateand AC charging state •No support for determining SD card insert/eject •No support for Bluetooth

12/48

What is Android’s License?

Android Overview – License IssuesAndroid Overview – License Issues

OpenSource License

Linux Kernel GPL2

YAFFS2 GPL

•What is Android’s License? •Currently, Android Platform is open source completely. The Android mobile OS

will be released under Apache License. This means that anyone can customize the android platform and then keep it proprietary.

QemuOpenbinder

QEMU GPL

QEMU Accelerator GPL2

Dalvik (JVM) Apache

O Bi d (C ) GPL2Yaffs2

Sqlite3

OpenSSL

OpenBinder (Core) GPL2

SQLite GPL2

Python Python

ant Apache

Yaffs2

LinuxDalvik

BSD Libc

OpenGLSDL LGPL

OpenGLSGI OpenGL (BSD/MPL)

Bionic C Library BSD

Ant

(=bionic)

OpenGLKHTML

Python

WebkitBSD (including LGPL)

WebCore LGPL

KJS LGPL

D‐BUS

SDLExpat

Python

zlib Openbinder System

KJS LGPL

KHTML GPL+BSD

DBUS GPL2

Expat MIT

SGL Apache

13/48

Android Platform License IssuesAndroid

14/48

Android Application License Issues

The 18 to 20 devices Google knows about will be made by eight or nine different manufacturers – by Andy Rubin (2009.05.27 Google i/o)

1. The obligation-free option:- Manufacturers can download a free version of Android.

Th f t t l d l G gl li ti – The manufacturers cannot preload popular Google applications, like Gmail or Google calendar.

2 Th ll t i g ti 2. The small strings option: – manufacturers sign a distribution agreement to include Google

applications on the phone. 12 to 14 subscribe to this option (18 20 devices in 2009 )– 12 to 14 subscribe to this option (18 ~ 20 devices in 2009 ).

3 The bigger strings option or the no-censorship version:3. The bigger strings option or the no-censorship version:– They are physically distinguishable by the “Google” logo on the phone.– We want to abide by the law, but not rule with an open fist

15/48

Kernel Features for Android 1/2Android

Kernel Features Requirement

ARM EABI ( ARM Embedded Application Binary Interface ) O

Frame Buffer (Device Driver)  /dev/fb0  or /dev/graphics/fb0 O

Keypad Device drivers  /dev/input/event0 △

Touch‐Screen Device drivers  /dev/input/event1 △/ / p /

EmulatorGoldFish (Virtual Machine for QEMU based Emulator ) O

i it f ( R /i it E t bl Liki F t ) Oinit ramfs source ( Run /init ‐ Exectuable  Liking Format ) O

16/48

Kernel Features for Android 2/2Android

Kernel Features Requirement

Low Memory Killer ( To Kill process When Memory is low) O

☞ Surface flinger uses double-buffering using page-flips.

Low Memory Killer ( To Kill process When Memory is low) O

Binder For IPC  /dev/binder (251~253 or 10~11)     O

Kernel Debugger ( Using kdbg structure + sysrq ) △

A

N

gg ( g g y q )

PMEM ( Process’s Memory Allocator – map,unmap,getsize,gettotalsize,allocate,etc ) ‐Deprecated -

Android Log Driver (To display log messages like logcat)D

R

Android Log Driver (To display log messages like logcat)/dev/log/{main:log:event} △

Android Power Management (for PM of goldfish) /dev/android_power △

O

I

Android USB Gadget ( Gadget based Android USB Driver )  /dev/usb △

Android Alarm Driver  △

DAndroid  RAM Buffer Console ( for goldfish's audio ) △

Product

Android Paranoid Network (Only allow certain groups to create sockets) -

Ashmem (Android Shared Memory for Memory Manager) O(Porting) Ashmem (Android Shared Memory for Memory Manager) O

Android timed GPIO driver -

17/48

Android Difference among Android Kernel Versions

OOOBi d2OOOEABI1

2.6.292.6.252.6.23FeatureNo 2.6.27

OO

OOOAndroid Power Management4OOOLow Memory Killer3OOOBinder2

OOO

OOOAndroid USB Gadget7OOOAlarm Driver6OOOLog sub system5

OOO

OOXASHMEM10OOOAndroid Kernel Debugger9OOOYaffs28

g

OOO

OXXBasic X86 Support12OXXPMEM11OOXASHMEM10

OOO

OXX/d i / t i /A d id/12 X☞ http://Android.googlecode.com/files/linux-2.6.23-Android-m5-rc14.tar.gz☞ http://Android.googlecode.com/files/linux-2.6.25-Android-1.0_r1.tar.gz☞ http://Android git kernel org/?p=kernel/common git;a=shortlog;h=refs/heads/Android 2 6 27

OXX./drivers/staging/Android/12 X

18/48

☞ http://Android.git.kernel.org/?p=kernel/common.git;a=shortlog;h=refs/heads/Android-2.6.27☞ http://Android.git.kernel.org/?p=kernel/common.git;a=shortlog;h=refs/heads/Android-2.6.29

Part 1 Android Toolchain to Build Full Source

Android Toolchain does not include bionic.

• GCC Version : 4.2.1 (GPL2) • Android Toolchain Sources:

Ref: GCC 4.2.2+  GPL3Glibc 2.6.1+   GPL3/LGPL3

http://gplv3.fsf.org• Android Toolchain Sources: http://Android.git.kernel.org/pub/android-toolchain-20081019.tar.bz2 (70M)   GCC 4.2.1 , Binutils 2.17 , GDB 6.6

http //gplv3.fsf.org

(2008.10.21)

• Architecture: ARMV5te Plus • C Library : Bionic ( Modified BSD C Library)• C Library : Bionic ( Modified BSD C Library)• Target: arm-eabi• ABI Convention: EABI , AAPCS,• Supported Language: C, C++• Floating Point : Soft Floating Point ( --with-float=soft --with-fpu=vfp )

Th d M d l Si l ( bl h d )19/48

• Thread Model: Single (--enable-threads)

Part 1 Cross Compiler to Build S3C6410 Kernel

Korea Android Toolchain for ARM v6 (arm1176) • A development tool to build Android kernel GNU C Library

• Developed for www.kandroid.org members.• Download: http://code.google.com/p/Android-group-korea/downloads/list• Current version: 1.1.2.1 (May 30, 2008)

Detailed Information• GCC version : 4.2.3• libc : Glibc (GNU C Library) 2.7• binutils version : 2.18.50.0.6• kernel headers : 2.6.18• threading model : NPTL(Native Posix Thread Library) • float support : soft-float

lti l i i• multiple-precision:. GMP : Gnu Multiple Precision arithmetic library ( http://gmplib.org/manual/ ). MPFR : C library for multiple-precision floating-point computations with correct rounding(http://mpfr.org/)

• misc : GDB 6.6, strace 4.5.16 , DUMA 2.5.12

20/48

, ,(Use the options -mfpu=vfp -mfloat-abi=softfp to enable VFP instructions. )

Linux Mailing List for Android KernelAndroid

Current efforts to merge android kernel features to vanilla kernel

21/48

Vanilla Kernel’s Maintenance for AndroidAndroid

Total Number of Kernel Developers# Developers

○ Linux = Vanilla Kernel = Linus Tovalds’s Tademark

'09.04.09Android Kernel’s Release Date based on Vanilla

'08 12 01

'07.11.12

'08.11.23

08.12.01

07.11.12

Version

22/48• http://gitstat.sf.net : web-based statistics and monitoring system.

Version

Vanilla Kernel’s Maintenance for AndroidVanilla Kernel’s Maintenance for Android

○ Linux = Vanilla Kernel = Linus Tovalds’s Tademark○ Linux = Vanilla Kernel = Linus Tovalds s Tademark

http://gitstat.sourceforge.net/

23/48

Part 1 Efforts to Merge Android Kernel Features into Vanilla

• Drivers for Android framework were added to the staging/ directory • Currently experimental, unstable and user-unfriendly.- http://www.kroah.com/log/linux/linux-staging-update.html- git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6

Ashmem, wakelock(PM), Android kernel debugger, and yaffs2 are not still merged.

2.6.29 Staging Drivers

Rebecca Schultz Zavin <[email protected]>Arve Hjønnevåg <[email protected]>

Brian Swetland <swetland@google com>Brian Swetland <[email protected]>Robert Love <[email protected]>

Greg Kroah-Hartman <[email protected]>

24/48Systems & Kernel Engineers for the Android Project.

Linux Kernel for Android

• Android is built on the Linux kernel, but Android is not LinuxLinux.

• No native windowing system.No glibc support• No glibc support.

• Does not include the full set of standard Linux utilities.Standard Linux 2 6 XX Kernel• Standard Linux 2.6.XX Kernel.

• Patch of “kernel enhancements” to support Android.

25/48

Why Linux Kernel?Android

• Great memory and process management• Permissions-based security model• Proven driver model• Proven driver model• Support for shared libraries• It's already open source!

26/48

Dalvik VMDalvik Virtual MachineAndroid

• Designed for embedded environment

• Supports multiple virtual machine processes per devicedevice

• Highly CPU-optimized bytecode interpreter

• Uses runtime memory very efficiently

• Convert Java byte code to Register based Dalvik byte codecode

To avoid license issue from “Byte Code Verifier” patent of Sun Microsystems, Inc.

27/48

Android RootFS InformationAndroid

ramfsRoot Folder

proc/ data/ dev/ etc/ init sbin/ sys/ system/ tmp/ var/

yaffs2

reaable/writable file system

RAM diskread only file system

/ F ld

yaffs2

yaffs2

app/ bin/ build.prop etc/ fonts/ framework/ lib/ lost+found/ media/ sounds/ usr/

/system Folder

Toolbox (similar to busybox)

Java Applications (*.apk )

Java class libraries(*.jar)

Native shared libraries; (*.so )

28/48

Android’s System LibrariesAndroid

29/48

Websites to Maintain Android Platform

Android.git.kernel.orgGIT-based source control management for Android(git clone git://Android.git.kernel.org/ + project path. )

A d id

User Space

Bug repor, code contribution, mailing list, documentation , roadmap, …

source.Android.comAndroid Market

Space

code.google.com/Android/ www.android.com/market/

T h l d l li ti ff i th A d id SDK f t dTo help develop new applications, offering the Android SDK, featured videos.

developer.Android.comGoogle I/O, SDK, developer's guide, reference, blog , community

30/48

, y

31/48

2. Android Porting

Android Porting on Real Target (Target Device Prototyping)

32/48

Android Project LayoutAndroid Project LayoutAndroid Project LayoutAndroid Project Layout

☞ Info : http://source android com/projects

The Android platform consists of several projects already in progress. These projects can be

☞ Info : http://source.android.com/projects

The Android platform consists of several projects already in progress. These projects can be divided into three categories

1) Core projects: These projects make up the foundation of the Android

l tfplatform.( bionic, bootloader/legacy, build , dalvik, development, frameworks/base , hardware<libhardware/ril> , kernel , prebuild , recovery, system<bluetooth,coe,extras,ti-wlan)

.2) External projects: The Android Open Source Project makes use of many

other open source projects. ( aes, apache-http, asm, bluez, ccache, clearsilver, dbus, dhcpcd, dropbear, eclipse, elfcopy, elfutils embunit emma esd expat fdlibm flex freetype gdata diflib googleclient icu4celfutils, embunit, emma, esd, expat, fdlibm, flex, freetype, gdata, diflib, googleclient, icu4c, iptables, jdiff, jfreechart, jpeg, kxml2, libffi, an so on)

3) Packages: These projects are standard Android applications and services3.1) Application Project: alarmclock, browser, calculator, calendar, camera, Contacts, email,

googlesearch, html viewer,IM , Launcher, MMS, Music, an so on 3.2) Provider Project: CalendarProvider, ContactsProvider, DownloadProvider,DrmProvider,

GoogleContactsProvider, GoogleSubscribedFeedsProvider, ImProvider,MediaProvider,SettingsProvider, SubscribedFeedsProvider, TelephonyProvider

33/48

Android Help BookAndroid Help BookAndroid Help BookAndroid Help Book

No Subject Location

S G d f bl h / / / /d /f k/ d h l1 SDK , Dev Guide , Reference , Publish , Etc

./out/target/common/docs/framework/index.html

2 Bugzilla GUide 2.20.1 ./external/webkit/BugsSite/docs/html/index.html

3 Webkit Open Source Project ./external/webkit/WebKitSite/index.htmlp j / / / /

4 SGL Doc by doxygen 1.4.0 ./external/skia/sgl_doxygen/html/index.html

5 TinyXML 2.4.0 ./external/tinyxml/docs/index.html

6 Tremioor DOcumentation ./external/tremor/Tremor/doc/index.html.(http://www.xiph.org/vorbis/)

7 Fdlibm (Network Library) ./external/fdlibm/index.

8 Addition and Subtraction ./external/dropbear/libtommath/logs/index.html

API D /d l / l /A iD / i d h l9 API Demo ./development/samples/ApiDemos/_index.html

10 Lunar Lander Program ./development/samples/LunarLander/_index.html

11 Note Pad Program ./development/samples/NotePad/_index.html

12 Update Site for Android Dev Toolkit /development/tools/eclipse/sites/external/index h12 Update Site for Android Dev Toolkit ./development/tools/eclipse/sites/external/index.html

13 Update Site for Android Dev Toolkit ./development/tools/eclipse/sites/internal/index.html

After “#>repo sync”

14 Porting Guide 0.3(2008-Jun-09) ./development/pdk/docs/index.html

34/48

How do you do Thouble Shooting?How do you do Thouble Shooting?How do you do Thouble Shooting?How do you do Thouble Shooting?

3. IRC(Internet Relay Chatting)

irc.freenode.net (#android)

1. Google Groups

http://groups.google.com/group/android-developers

2. Korea Android Website

http://www kandroid orghttp://www.kandroid.org

35/48

Android /init Running SequenceAndroid /init Running SequenceAndroid /init Running SequenceAndroid /init Running Sequence#> chroot /root/androidrootfs /strace -f -ff -tt -s 200 /init

Environment Variables Settingexport PATH=/sbin:/system/sbin:/system/bin:$PATHexport LD_LIBRARY_PATH=/system/libexport ANDROID_ROOT=/systeme port ANDROID ASSETS /s stem/app

Loading OpenBinder Moduletarget#> insmod  binderdev.kotarget#> lsmodModule                  Size      Used      by  Not taintedBinderdev 63152 0 ‐ Live 0xbf000000

①export ANDROID_ASSETS=/system/appexport ANDROID_DATA=/dataexport EXTERNAL_STORAGE=/sdcardexport DRM_CONTENT=/data/drm/content

Binderdev             63152        0      ‐ Live 0xbf000000target#> mknod /dev/binder c 10 0target#> /bin/chmod ‐R a+rw /dev/binder  

Run Zygote Process

Create Temp FStarget#> umask 000target#> /bin/chmod ‐R a+rw  /tmp/ 

target#> /system/bin/app_process ‐Xzygote /system/bin ‐‐zygote &target#> strace ‐ff ‐F ‐tt ‐s 200 ‐o /tmp/log/zygote \/system/bin/app_process ‐Xzygote /system/bin ‐‐zygote & 

② ⑦

System Property’s Permissiontarget#> /bin/chmod ‐R a+rw /data/ /database/ 

Mount FIleSYstemtarget#> mount ‐t tmpfs tmpfs /tmp

Start D-bus Daemonarget#> /system/bin/dbus‐daemon ‐‐system ‐‐nofork &  

Start Runtime Processtarget#> /system/bin/runtime

③ ⑧

⑨target#> mount  t tmpfs tmpfs /tmptarget#> mount ‐t proc proc /proctarget#> mount ‐t sysfs sysfs /sys  

Log Sub System (Device Node)

target#> /system/bin/runtime target#> strace ‐f ‐ff ‐tt ‐s 200 ‐o /tmp/runtimetrace /system/bin/runtime 

Network Setting#!/system/bin/shexport PATH=/sbin:/bin:/usr/bin:/system/bin

④⑨

g y ( )target#> /bin/rm ‐r /dev/logtarget#> cd /devtarget#> /bin/ln ‐s /var/tmp/log logtarget#> /bin/rm ‐f log/*target#> /bin/touch log/main

export PATH=/sbin:/bin:/usr/bin:/system/binLOCALIP=`192.168.1.21`DNS1=`208.67.222.222`DNS2=`208.67.220.222`GATEWAY=`192.168.1.1`ifconfig eth0 $LOCALIP netmask 255.255.255.0 uproute add default gw $GATEWAY dev eth0/system/bin/setprop net eth0 dns1 $DNS1

36/18

target#> /bin/touch log/maintarget#> /bin/touch log/eventstarget#> /bin/touch log/radiotarget#>  cd / 

/system/bin/setprop net.eth0.dns1 $DNS1/system/bin/setprop net.eth0.dns2 $DNS2/system/bin/setprop net.gprs.local‐ip $LOCALIP/system/bin/setprop ro.radio.use‐ppp no

/system/bin/setprop ro.config.nocheckin yes

36/48⑩

Analysis of BootingAnalysis of Booting SequenceSequenceAnalysis of BootingAnalysis of Booting SequenceSequence

☞ Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process☞ Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process

www.bootchart.org37/48

Android Porting 8 Android Porting 8 -- S3C6410 (ARM1176S3C6410 (ARM1176)

http://www.youtube.com/watch?v=13Gt7t4kRCchttp://www.youtube.com/watch?v=NsBuZT6r9Mo

A 1136/1176 htt // kA d id /d t l /kA d id 1 1 2 1 20080530 lib t

38/48

• Arm1136/1176 http://www.kAndroid.org/devtools/kAndroid-1.1.2.1-20080530.glibc.tgz• Arm-Xscale http://www.kAndroid.org/devtools/kAndroid-1.1.2.3-20080623.glibc.tgz

Odroid(Game Palyer) with S3C6410 Topic 1

http://www.youtube.com/watch?v=yM7N3JDnX4k&feature=related

Music Playery

HD TV OUT

http://www.youtube.com/watch?v=q9nUKktK3-w&feature=related

39/48

3.  Git to manage android full source

1. What is repo/git?2. Git flow3. How to use git4. Android full source based on git

40/48

Can we control scalable project ?Can we control scalable project ?

It’s hard enough to control everything when you know where it all came from add packages to a variety of platforms ...

41/48

What is Git?What is Git?

• Git manages changes to tree of files over time.

• Git is optimized for:Di t ib t d D l tDistributed DevelopmentLarge files setComplex mergesMaking trial branchesBeing very fastBeing robust

http://git-scm.com/

(Before → http://git.or.cz) g

• Git is not optimized for:Tracking file permissions and ownershipTracking file permissions and ownershipTrack individual filles with separate history

42/48

FlowFlow

43/48

Git’s componentsGit’s componentsGit has many component program, the following is an unabridged list of the them as of git version 1.6.2.

git git-convert-objects git-init git-mktree git-revert git-update-ref

git add git count objects git init db git mv git rev list git update server infogit-add git-count-objects git-init-db git-mv git-rev-list git-update-server-infogit-add--interactive git-daemon git-instaweb git-name-rev git-rev-parse git-upload-archivegit-am git-describe git-local-fetch git-pack-objects git-rm git-upload-packgit-annotate git-diff git-log git-pack-redundant git-runstatus git-vargit-apply git-diff-files git-lost-found git-pack-refs git-send-pack git-verify-packgit apply git diff files git lost found git pack refs git send pack git verify packgit-applymbox git-diff-index git-ls-files git-parse-remote git-shell git-verify-taggit-applypatch git-diff-tree git-ls-remote git-patch-id git-shortlog git-whatchangedgit-archive git-fast-import git-ls-tree git-peek-remote git-show git-write-treegit-bisect git-fetch git-mailinfo git-prune git-show-branchgit bisect git fetch git mailinfo git prune git show branchgit-blame git-fetch-pack git-mailsplit git-prune-packed git-show-index

git-branch git-fetch--tool git-merge git-pull git-show-refgit-bundle git-fmt-merge-msg git-merge-base git-push git-sh-setup

git-cat-file git-for-each-ref git-merge-file git-quiltimport git-ssh-fetchg g g g g q p ggit-check-attr git-format-patch git-merge-index git-read-tree git-ssh-pullgit-checkout git-fsck git-merge-octopus git-rebase git-ssh-pushgit-checkout-index git-fsck-objects git-merge-one-file git-receive-pack git-ssh-uploadgit-check-ref-format git-gc git-merge-ours git-reflog git-statusgit-cherry git-get-tar-commit-id git-merge-recursive git-relink git-stripspace

git-cherry-pick git-grep git-merge-resolve git-remote git-symbolic-refgit-clean git-hash-object git-merge-stupid git-repack git-tag

git-clone git-http-fetch git-merge-subtree git-repo-config git-tar-treegit-commit git-http-push git-mergetool git-request-pull git-unpack-file

git-commit-tree git-imap-send git-merge-tree git-rerere git-unpack-objectsgit-config git-index-pack git-mktag git-reset git-update-index

44/48

Git Quick HowtoGit Quick Howto

Summary: basic commands

• yum install git ( apt-get isntall git git-core gigglei it/ l• init/clone

• pulll / i k

$ git init$ git clone <some/where/else>• log/gitk

• add/commit

$ git clone <some/where/else>$ git pull <origin> <master>$ git log$ gitk

• push$ gitk$ git add <./kernel/sched.c>$ git commit$ git push <origin> <head>$ g p g

45/48

Repo Command on Android Git treesRepo Command on Android Git trees

• What is “Repo”(The Multiple Git Repository Tool ) Script?Repo is a tool that we built on top of Git. Repo helps us manage the many Git repositories. Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android.

• Installing Repo $ curl(or wget) http://android.git.kernel.org/repo >~/bin/repo $ chmod a+x ~/bin/repo$ p$ mkdir mydroid ← working-directory-name$ cd mydroid $ repo init -u git://android.git.kernel.org/platform/manifest.gitp g g g p g

• Synchronizing your client To synchronize the files for all available projects:y p j$ repo sync

To synchronize the files for selected projects:$ repo sync project1 project2 ...

46/48

Android

THANKSTHANKS

Open Mind , Share Mind , This is Our Future!

47/48

Coffee BreakCoffee Break

48/48