3 rd korea android seminar 27-mar(fri), 2009 lim,geunsik ([email protected], [email protected]) os...
TRANSCRIPT
3rd Korea Android Seminar
27-Mar(Fri) , 200927-Mar(Fri) , 2009
Lim,GeunSik Lim,GeunSik ([email protected] , [email protected])([email protected] , [email protected])
http://blog.naver.com/invainhttp://blog.naver.com/invainOS Group, SAIT, Samsung ElectronicsOS Group, SAIT, Samsung Electronics
1/51
33rdrd Korea Android Seminar Korea Android Seminar
Using Repo to maintain AndroidUsing Repo to maintain Android
3rd Korea Android Seminar
AgendaAgenda
2/51
01. History01. History02. Repo on android opensource project (AOSP)02. Repo on android opensource project (AOSP)03. git Brief overview 03. git Brief overview 04. How to use git ( installation and Practice )04. How to use git ( installation and Practice )05. Commands (Tutorial)05. Commands (Tutorial)06. Contribution Workflow for AOSP 06. Contribution Workflow for AOSP 07. Opensource tools to help git07. Opensource tools to help git08. Quick Reference08. Quick Reference09. X86 android using git tree09. X86 android using git tree10. X86 Android Platform on VirtualBox10. X86 Android Platform on VirtualBox
3rd Korea Android Seminar
Why do I prepare Repo(Git) as SCM?Why do I prepare Repo(Git) as SCM?
•Proprietary clones (License Inheritance)•Advertising competition
• Still Vaporware in market• Lack of Vertical Integration
•Social networking applications•Developing markets
•Google is a content provider•Partnerships (OHA 47 companies)•Mind-Share
External Environments
External Environments
Internal Potential Power
Internal Potential Power
3/51
SCMOf
Android
* SCM : Source Code Management
01. History
Android’s SWOT AnalysisAndroid’s SWOT Analysis
3rd Korea Android Seminar
Location of SCM in FOSS WorldLocation of SCM in FOSS World01. History
4/51
3rd Korea Android Seminar
Have we addressed everyting?Have we addressed everyting?
test
maintenance
deployment
requirements How to glue all together?
How to glue all together?
Tools?Tools?
What package version?
Dependencies?
What package version?
Dependencies?
What packages to use?What packages to use?
How to design Linux?
How to design Linux?
Design
Implement
integrate
01. History
5/51
3rd Korea Android Seminar
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 ...
01. History
6/51
3rd Korea Android Seminar
What do you like Version Control System?What do you like Version Control System?
7/51
01. History
3rd Korea Android Seminar
Repo Command on Android Git treesRepo Command on Android Git trees
8/51
• Installing Repo $ curl(or wget) http://android.git.kernel.org/repo >~/bin/repo $ chmod a+x ~/bin/repo $ mkdir mydroid ← working-directory-name $ cd mydroid $ repo init -u git://android.git.kernel.org/platform/manifest.git
• Synchronizing your client To synchronize the files for all available projects: $ repo sync
To synchronize the files for selected projects: $ repo sync project1 project2 ...
• 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.
02. Repo on aosp
3rd Korea Android Seminar
Repo Command on Android Git treesRepo Command on Android Git trees
9/51
• Creating topic branchesTo start a topic branch using Repo:$ repo start branchname
To verify that your new branch was created:$ repo status
• Using topic branchesTo assign the branch to a particular project: $ repo start branchname project
To switch back and forth among branches that you have created in your local work environment:$ git checkout branchname
To see a list of existing branches:$ git branch
The name of the current branch will be preceded by an asterisk.
02. Repo on aosp
3rd Korea Android Seminar
Repo Command on Android Git treesRepo Command on Android Git trees
10/51
• Viewing client statusTo list the state of your files:$ repo status
To see uncommitted edits:$ repo diff
The repo diff command shows every local edit that you have made that would not go into the commit, if you were to commit right now.
To see every edit that would go into the commit if you were to commit right now, you need a Git command, git diff. Before running it, be sure you are down in the project directory:$ cd ~/workingdirectory/project$ git diff --cached
02. Repo on aosp
3rd Korea Android Seminar
Repo Command on Android Git treesRepo Command on Android Git trees
11/51
• Recovering sync conflicts If a repo sync shows sync conflicts:
View the files that are unmerged (status code = U). Edit the conflict regions as necessary. Change into the relevant project directory, run git add and git commit for the files in question, and then "rebase" the changes. For example:$ cd bionic$ git add bionic/*$ git commit$ git rebase --continue
When the rebase is complete start the entire sync again:$ repo sync bionic proj2 proj3 ... projN
02. Repo on aosp
3rd Korea Android Seminar
Repo Command on Android Git treesRepo Command on Android Git trees
12/51
• Cleaning up your client filesTo update your local working directory after changes are merged in Gerrit:$ repo sync
To safely remove stale topic branches: $ repo prune
• Deleting a clientDeleting a client will permanently delete any changes you have not yet uploaded for review. Because all state information is stored in your client, you only need to delete the directory from your filesystem: $ cd ~ $ rm -rf working-directory-name
02. Repo on aosp
3rd Korea Android Seminar
Repo Command on Android Git treeRepo Command on Android Git tree
13/51
• Scripting common tasksYou can use Repo to run the same program across all projects:$ repo forall [ proj1 proj2 ... projN ] -c 'echo $REPO_PROJECT $@' [ arg1 arg2 ... argN ]
The -c argument is evaluated through /bin/sh and any arguments after it are passed through as shell positional parameters.
• Repo command reference (init, sync, upload, download, forall, help, prune, start, status)
Repo usage takes the following form: $ repo command options
Optional elements are shown in brackets [ ]. Once Repo is installed, you can get information about any command by running $ repo help command
02. Repo on aosp
3rd Korea Android Seminar
History of GitHistory of Git
14/51
• Started in 2005 to replace BitKeeper(http://www.bitkeeper.com/.)
• Designed to support the kernel development. (2.6.12 ~ ) http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary
• Multi-platform: Mac OS X, Windows, Linux and Unix
• GPL v2 & Originally written by Linus Torvalds http://git.or.cz/gitwiki/LinusTalk200705Transcript
• Git is currently maintained by Junio C Hamano
03. git Brief overview
3rd Korea Android Seminar
Projects that use Git for their SCMProjects that use Git for their SCM
15/51
• Android (http://android.git.kernel.org ) ,
• Moblin (http://git.moblin.org) ,
• OLPC (http://dev.laptop.org/git )) ,
• Linux (http://git.kernel.org , from 2.6.12 on 17 Jun 2005 ) ,
• GCC (http://gcc.gnu.org/git/),
• Glibc (http://sourceware.org/git/),
• Fedora(http://git.fedoraproject.org/) ,
• Gnome (http://git.gnome.org ),
• Wine (http://source.winehq.org/git/) ,
• Samba (http://gitweb.samba.org/) ,
• FreeDesktop.org (http://cgit.freedesktop.org/ X.org,Cairo) ,
• Perl (http://perl5.git.perl.org/) ,
• Ruby on Rails, VLC, yum, OpenVZ, Udev, ALSA, mtd-utils, DragonFly BSD, Compiz-Fusion, GNU AutoConf/Automake, U-Boot, X264, etc …
• Used widely
03. git Brief overview
Glibc
3rd Korea Android Seminar
• Git manages changes to tree of files over time.
• Git is optimized for: Distributed Development Large files set Complex merges Making trial branches Being very fast Being robust
• Git is not optimized for: Tracking file permissions and ownership Track individual filles with separate history
What is Git?What is Git?
16/51
http://git-scm.com/
(Before → http://git.or.cz)
03. git Brief overview
3rd Korea Android Seminar
Git HomepageGit Homepage
17/51
What is Git?
Manual
(http://book.git-scm.com)
SourceCode
Quick Guide
03. git Brief overview
3rd Korea Android Seminar
The nameThe name
18/51
"I'm an egotistical bastard, and I name all myprojects after myself. First 'Linux', now 'git' " -Linus Torvald
git is British slang for "silly, stupid, or worthless person"
03. git Brief overview
3rd Korea Android Seminar
The nameThe name
19/51
Alternatively, Linus said: that "git" can mean anything, depending on your mood:
• Random three-letter combination that is pronounceable, and not actually used by any common UNIX command.
• Stupid. Contemptible and despicable. Simple.
• Global information tracker if you're in a good mood, and it actually works for you.
• Goddamn idiotic truckload of sh*t when it breaks
03. git Brief overview
3rd Korea Android Seminar
Linus’s Core Goal Linus’s Core Goal
20/51
• It must be distributed
• Disconnected mode of operation
• "Trusted Lieutenants" concept
• Very strong safeguards against corruption,
either accidental or malicious
• Fast merge and search
• "Take CVS as an example of what not to do; if
in doubt, make the exact opposite decision." -
Linus
03. git Brief overview
3rd Korea Android Seminar
Usage ConceptsUsage Concepts
21/51
•Everyone has the commit bit.
•Send the patch or publish repository.
•Multi protocols: git, HTTP and SSH.
•Everyone has the entire "repository". (Disks are cheap)
•Every ID is based on SHA-1
sha-1 is 160 bits long
03. git Brief overview
3rd Korea Android Seminar
FactsFacts
•The overall design is heavily based on pipeline
of tools"
•UNIX philosophy.
•Mostly written in C, with higher level UI in
POSIX shell and some Perl/Python/Wish
mixture.
•Every git command is a git-XXXX application.
•Currently more than 140+ commands are
available.
•Git doesn't have a specialized built-in help
system.
2009-03-04
03. git Brief overview
3rd Korea Android Seminar
ConceptsConcepts
•Repository:an archive of what the working tree looked like at different
times in the past
•Working tree: The tree of actual checked out files. Contains a .git
directory.
•Branch: a new development tree, which is disjoint from the other
you've just cloned.
•Master repository:The mainline of development in most repositories
is done on a branch master called “master".
•Tag: a link to a commit ID.
•Head: HEAD refers to the most recent commit of the lastbranch you checked out.
•Merge: Consolidate work
•Index: Git does not commit changes directly from the working tree into
the repository. Instead, changes are rst registered in something called
the index.
03. git Brief overview
3rd Korea Android Seminar
FlowFlow03. git Brief overview
3rd Korea Android Seminar
How to install gitHow to install git
25/51
Fedora 9:sudo yum install git
Ubuntu 8.XX:sudo apt-get install git git-core giggle
If you want to install full components, use asterrisk character like git*.
giggle is a GUI tool, others are gitk git-gui
04. How to use git
3rd Korea Android Seminar
Git’s componentsGit’s components
Git 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- - 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- 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- blame git- fetch- pack git- mailsplit git- prune- packed git- show- indexgit- branch git- fetch- - tool git- merge git- pull git- show- refgit- bundle git- fmt- merge- msg git- merge- base git- push git- sh- setupgit- cat- file git- for- each- ref git- merge- file git- quiltimport git- ssh- fetchgit- 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- stripspacegit- cherry- pick git- grep git- merge- resolve git- remote git- symbolic- refgit- clean git- hash- object git- merge- stupid git- repack git- taggit- clone git- http- fetch git- merge- subtree git- repo- config git- tar- treegit- commit git- http- push git- mergetool git- request- pull git- unpack- filegit- commit- tree git- imap- send git- merge- tree git- rerere git- unpack- objectsgit- config git- index- pack git- mktag git- reset git- update- index
140+ Commands
05. Commands (Tutorial)
3rd Korea Android Seminar
Summary: basic commands
• init/clone• pull• log/gitk• add/commit• push
05. Commands (Tutorial)
Git Quick HowtoGit Quick Howto
$ git init$ git clone <some/where/else>$ git pull <origin> <master>$ git log$ gitk$ git add <./kernel/sched.c>$ git commit$ git push <origin> <head>
3rd Korea Android Seminar
Contribution Workflow for AOSP 1/2Contribution Workflow for AOSP 1/2
28/51
If you are interested in developing applications for Android, visit the Android application developer site.
Continue
06. Contribution Workflow for AOSP
3rd Korea Android Seminar
Contribution Workflow for AOSP 2/2Contribution Workflow for AOSP 2/2
29/51
06. Contribution Workflow for AOSP
3rd Korea Android Seminar
Front Ends - gitkFront Ends - gitk
GITK is Generalized Interface Toolkit. The aim of the GITK project is to provide a solution, which will dramatically improve the adaptivity of software. The vision is to get "user interfaces for all" and even more.
http://gitk.sourceforge.net/
30/51
07. Opensource tools to help git
3rd Korea Android Seminar 31/51
Front Ends - Git-guiFront Ends - Git-gui
http://www.kernel.org/pub/software/scm/git/docs/git-gui.htmlA Tcl/Tk based portable graphical user interface to Git. git-gui focuses on allowing users to make changes to their repository
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - Git-webFront Ends - Git-web
Gitweb is a Git web interface, the one working on http://www.kernel.org/git/. It is written in Perl, and can be used as a CGI script, or as a mod_perl legacy script (run by ModPerl::Registry handler). It allows browsing a git repository (or a set of git repositories) using a web browser.
32/51
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - Git-phpFront Ends - Git-php
The goal of git-php is a robust PHP web interface to git repositories. It is meant to be easily customizable through styles and the ability to be embedded into any PHP page. For example, creating a git repository viewer plug-in for your favorite PHP based cms should be easy with git-php.http://code.google.com/p/git-php/
33/51
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - TigFront Ends - Tig
Tig is a git repository browser that additionally can act as a pager for output from various git commands. http://jonas.nitro.dk/tig/ * Examples: The blame view, The diff view, The log view, The main and diff view, The main view, The revision graph rendering, Browsing the commit tree
34/51
The revision graph rendering
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - MsysgitFront Ends - Msysgit
Git on Windows was only officially supported using Cygwin. To help make a native Windows version, this project was started, based on the fork. This project tries to provide a repository containing everything needed to compile MinGW Git from scratch, on Windows. http://code.google.com/p/msysgit/
35/51
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - GitHubFront Ends - GitHub
GitHub(Online project hosting using Git.) is the easiest and prettiest way to participate in that collaboration: fork projects, send pull requests, monitor development, all with ease.GitHub was written for public, open source projects and private, proprietary codes — if you use Git, GitHub is for you.
36/51
Free!• Unlimited Public Repositories • Unlimited Public Collaborators • 300 MB Disk Space
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - cgitFront Ends - cgit
Cgit is a cgi application implemented in C: it's basically (yet) another git command, used to generate html. it is licensed under GPL v2. All git operations are performed by linking with libgit.a http://hjemli.net/git/cgit/
37/51
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - gitstatFront Ends - gitstat
Gitstat is an Open Source, web-based git statistics interface. You can browse up-to-date statistics information, search and view changesets(patchs) status, monitor git tree. ... http://sourceforge.net/projects/gitstat/
38/51
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - QgitFront Ends - Qgit
•QGit is a git GUI viewer built on Qt/C++. Qgit implements a GUI for the most common StGIT commands like push/pop and apply/format patches.•With qgit you will be able to browse revisions history, view patch content and changed files, graphically following different development branches. http://digilander.libero.it/mcostalba/
39/51
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - TortoiseGit Front Ends - TortoiseGit
• It is porting TortoiseSVN to TortoiseGit The latest release 0.4.2.0 This release can complete regular task, such commit, show log, diff two version, create branch and tag, Create patch and so on. http://code.google.com/p/tortoisegit/
40/51
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - Git Extensions Front Ends - Git Extensions
• Git Extensions is a toolkit to make working with Git under Windows more intuitive. The shell extension will intergrate in Windows Explorer and presents a context menu on files and directories. There is also a Visual Studio plugin to use git from Visual Studio. Sourcecode: http://github.com/spdr870/gitextensions/tree/master
41/51
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - GerritFront Ends - Gerrit
• Gerrit is a web based code review system, facilitating online code reviews for projects using the Git version control system. • http://code.google.com/p/gerrit/
42/51
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - Jgit/EgitFront Ends - Jgit/Egit
• JGit/EGit is an Eclipse plugin for working with Git repositories. JGit and EGit are implementations of the Git SCM (by King Penguin) in Java. •It consists of a generic package for reading and writing to a Git repository, plus an Eclipse-specific plugin. •EGit is an Eclipse Team provider for Git. http://code.google.com/p/egit/•JGit is a 100% pure Java implementation of Git. EGit relies upon JGit for the bulk of its implementation. http://www.jgit.org/
43/51
07. Opensource tools to help git
3rd Korea Android Seminar
Front Ends - StGitFront Ends - StGit
StGit is a Python application providing similar functionality to Quilt (i.e. pushing/popping patches to/from a stack) on top of Git.
These operations are performed using Git commands and the patches are stored as Git commit objects, allowing easy merging of the StGit patches into other repositories using standard Git functionality. http://www.procode.org/stgit/
44/51
*Help• For a full list of StGit commands: $ stg helpFor • quick help on individual subcommands: $ stg help <cmd>• For more extensive help on a subcommand: $ man stg-<cmd> (The documentation is also available in HTML format.)
Ref) Quilt originally was based on Andrew Morton's patch scripts found at http://www.zip.com.au/~akpm/linux/patches/
07. Opensource tools to help git
3rd Korea Android Seminar
Git OverviewGit Overview
45/51
08. Quick Reference
3rd Korea Android Seminar
Git Cheat Sheet 1/2Git Cheat Sheet 1/2
46/51
08. Quick Reference
3rd Korea Android Seminar
Git and Repo Cheat SheetGit and Repo Cheat Sheet
47/51
08. Quick Reference
3rd Korea Android Seminar
ASUS EEE701 Netbook’s Git treeASUS EEE701 Netbook’s Git tree
48/51
09. X86 android using git tree
* Config file for X86 Netbook http://android.git.kernel.org/?p=platform/vendor/asus/eee_701.git;a=blob;f=kernel.config;h=181bdcff0ee5996c4c9d93deb9f2666db2f9f473;hb=3d3a44ef8809c999ffb5d1e18d0178e7c13cf49b
Dima Zavin <[email protected]>
Dima Zavin <[email protected]>
3rd Korea Android Seminar
ASUS EEE701 Netbook’s Git treeASUS EEE701 Netbook’s Git tree
49/51
09. X86 android using git tree
1. kernel 2. kernel.config3. kernel.version4. modules/atl2.ko5. modules/bitblit.ko 6. modules/cfbcopyarea.ko 7. modules/cfbfillrect.ko 8. modules/cfbimgblt.ko 9. modules/drm-patches/0001-intelfb-Force-color-depth-changes-to-be-applied-
to.patch10.modules/drm-patches/0002-intelfb-Also-fail-check_var-if-the-virtual-screen-
d.patch11.modules/drm-patches/0003-intel_fb-pan_display-should-call-mode_set_base-
and.patch 12.modules/drm-patches/0004-intel_fb-Add-a-hack-to-allocate-the-virtual-
screen.patch 13.modules/drm.ko 14.modules/fbcon.ko 15.modules/font.ko16.modules/i915.ko17.modules/module.versions18.modules/softcursor.ko19.system.prop
20.AT_Translated_Set_2_keyboard.kcm21.AT_Translated_Set_2_keyboard.kl22.Android.mk 23.AndroidProducts.mk 24.BoardConfig.mk25.disk_layout.conf26.eee_701.mk27.init.eee_701.rc28.init.eee_701.sh29.init.rc
3rd Korea Android Seminar
X86 Android Platform on VirtualboxX86 Android Platform on Virtualbox
50/51
10. X86 Android Platform on VirtualBox
http://www.youtube.com/watch?v=y3dnFD9CBOk
3rd Korea Android Seminar
Thanks
51/5151/51
3rd Korea Android Seminar
Git Workflow for Linux Kernel 1/2Git Workflow for Linux Kernel 1/2
52/51
3rd Korea Android Seminar
Git Workflow for Linux Kernel 2/2Git Workflow for Linux Kernel 2/2
53/51