1 Tizen Project Guideline
Tizen Project Process 2 Assume that you have done flashing Tizen images. 1. Preparation Install Tizen Development Environments 2. Github 1. Sign in Github 2. Make an Organization and a Repository 3. Upload Initial Source Code 3. Tizen Source Code Workflow 1. Version & Branch Management 2. Package Build 3. Package Install
3 1. Preparation Install Tizen Development Environments
Tizen Development Environment 4 Source Code Management(SCM) Tools Git, Repo, Gerrit Build Tool GBS(Git Build System) Packaging Tools MIC, RPM Tizen Servers Host PC ODROID-U3 Kernel Source Code Kernel Source Code Object File Kernel Image Platform Source Code Clone Source Code Platform Source Code Build Packages Make & Flash Images Platform Images (Git, Repo, Gerrit) (GBS) (MIC, RPM)
Tizen Dev. Environment Install (1/11) 5 1. Git: Install and Configuration 1. Install a git package. 1. $ sudo apt-get install git 2. Configure user information of git. This information will be used for committer information. 1. $ git config --global user.name Your name 2. $ git config --global user.email email@address ex. $ git config --global user.name Gyeonghwan Hong $ git config --global user.email redcarrottt@gmail.com
Tizen Dev. Environment Install (2/11) 6 2. Repo: Install and Configuration 1. Download repo. 1. $ sudo apt-get install curl 2. $ mkdir -p ~/bin 3. $ curl http://commondatastorage.googleapis.com/git-repodownloads/repo > ~/bin/repo 4. $ chmod +x ~/bin/repo 2. Add repo s path to the basic path list. 1. Edit ~/.bashrc 1. $ gedit ~/.bashrc 2. After adding below code to the last line, restart your shell. ~/.bashrc PATH=~/bin:${PATH}
Tizen Dev. Environment Install (3/11) 7 3. GBS, MIC: Install 1. Add Tizen development tool repository to APT repository list. 1. $ sudo gedit /etc/apt/sources.list 2. Add below code 1. XX : Ubuntu s major version (ex. 12, 13, 14) 2. YY : Ubuntu s minor version (ex. 04, 10) deb http://download.tizen.org/tools/latest-release/ubuntu_xx.yy / 3. $ sudo apt-get update 2. Install packages of GBS, MIC. 1. sudo apt-get install gbs mic /etc/apt/sources.list
Tizen Dev. Environment Install (4/11) 8 You should have an access right to review server for accessing Tizen source code. 4. Register a Tizen developer ID 1. Go to developer.tizen.org/ko. 2. You can log in Tizen review server (review.tizen.org).
Tizen Dev. Environment Install (5/11) 9 5. Review Server: Configuration 1. $ gedit ~/.ssh/config Enter your username. Host tizen Hostname review.tizen.org IdentityFile ~/.ssh/id_rsa User username Port 29418 ~/.ssh/config Host review.tizen.org Hostname review.tizen.org IdentityFile ~/.ssh/id_rsa User username Port 29418
Tizen Dev. Environment Install (6/11) 10 5. Review Server: Configuration (Cont d) 2. Run ssh-keygen on a shell. 1. $ ssh-keygen Press enter about every question for using default values. In result, id_rsa, id_rsa.pub files will be created.» id_rsa: private key» id_rsa.pub: public key
Tizen Dev. Environment Install (7/11) 11 5. Review Server: Configuration (Cont d) 3. After log in review.tizen.org, go to settings menu. 4. Enter into SSH Public Keys menu Press Add Key button.
Tizen Dev. Environment Install (8/11) 12 5. Review Server: Configuration (Cont d) 5. Display the contents of public key file. 5. $ cat ~/.ssh/id_rsa.pub 6. Copy the displayed text to below text box. Contents of ~/.ssh/id_rsa.pub
Tizen Dev. Environment Install (9/11) 13 5. Review Server: Configuration (Cont d) 7. Test ssh server connection 1. $ ssh tizen 2. $ ssh review.tizen.org If the connection is successful, below message will be displayed.
Tizen Dev. Environment Install (10/11) 14 Tizen source code is built by pre-built toolchains. 6. Clone Pre-built Toolchain Packages 1. Clone ARM toolchain 1. $ git clone ssh://user@review.tizen.org:29418/pre-built/toolchainarm pre-built/toolchain-arm 2. $ cd pre-built/toolchain-arm 3. $ git checkout origin/tizen_2.2 4. $ cd - 2. Clone x86 toolchain 1. $ git clone ssh://user@review.tizen.org:29418/ pre-built/toolchainx86 pre-built/toolchain-x86 2. $ git pre-built/toolchain-x86 3. $ git checkout origin/tizen_2.2 4. $ cd -
Tizen Dev. Environment Install (11/11) 15 7. Make a GBS configuration file (~/.gbs.conf) Without this file, Tizen source code cannot be built. 1. $ gedit ~/.gbs.conf [general] tmpdir=/var/tmp/ profile=profile.tizen2.2 work_dir=/home/user [repo.tizen2.2] url=http://download.tizen.org/releases/2.2/tizen-2.2/ [repo.tizen2.2_arm] url=${work_dir}/pre-built/toolchain-arm/ [repo.tizen2.2_x86] url=${work_dir}/pre-built/toolchain-x86/ [profile.tizen2.2] repos=repo.tizen2.2_arm, repo.tizen2.2_x86, repo.tizen2.2
16 2. Github 1. Sign in Github 2. Make a New Organization and Repository 3. Upload Initial Source Code
Sign in Github 17 1. Go to http://www.github.com and Sign in.
Create an Organization on Github (1/3) 18 Create one organization by a team on Github. 1. Press + button Click New organization.
Create an Organization on Github (2/3) 19 2. Input organization name and billing email address. Billing email: In the case of private repository, bill will be sent to the address. It will not used in the case of open source repository. 3. Click Create organization button.
Create an Organization on Github (3/3) 20 4. Register IDs of team members. 5. Click Finish button.
Create a Repository on Gitbub (1/2) 21 Make a repository belonged to organization 1. Press + button Click New repository of this organization.
Create a Repository on Gitbub (2/2) 22 2. Input Repository name and specific information.
Upload Initial Source Code (1/7) 23 Initial source code should be uploaded. Case 1. Make a New Git Repository In case that there are no contents at all. In case that there is no.git directory in working directory. Case 2. Use a Existing Git Repository In case that there is.git directory in working directory. In case that you modify existing Tizen platform source code.
Upload Initial Source Code (2/7) 24 Case 1. Make a New Git Repository 1. Make a new Git repository 1. Move to working directory. 2. $ git init 2. Do initial commit 1. $ touch README.md 2. $ git add README.md 3. $ git commit -m initial commit
Upload Initial Source Code (3/7) 25 Case 1. Make a New Git Repository 3. Register Github server s address 3. $ git remote add origin https://github.com/organization/projectname.git ex. $ git remote add origin https://github.com/skku-eslab- Tizen/remote-key-framework-service.git 4. Upload code to Git repository 1. $ git push origin master master branch in local repository is uploaded to master branch in remote repository. 5. Result A new repository with only README.md will be created.
Upload Initial Source Code (4/7) 26 Case 2. Use a Existing Git Repository 1. Clone existing Tizen repository If you have already a repository, skip this process. 1. Log in Tizen review server (review.tizen.org) 2. Enter into Projects List 3. Find a repository that you want to clone Be careful: Packages in Tizen 2.2 and 3.0 are managed in different way, so multiple packages will be displayed on the result. 4. Clone the repository 1. $ git clone ssh://user@review.tizen.or g:29418/project-name
Upload Initial Source Code (5/7) 27 Case 2. Use a Existing Git Repository 1. Clone existing Tizen repository (Cont d) Tizen package repository has several branches by release version. 5. Check branches 1. $ git branch --remote ex. origin/1.0_post origin/2.0alpha origin/head -> origin/master origin/master origin/tizen_2.0 origin/tizen_2.1 origin/tizen_2.2 6. Change branch to target release version 1. $ git checkout <target branch> ex. git checkout origin/tizen_2.2
Upload Initial Source Code (6/7) 28 Case 2. Use a Existing Git Repository 2. Register Github server s address 1. Move to working directory. 2. $ git remote add origin https://github.com/organization/projectname.git ex. $ git remote add origin https://github.com/skku-eslab- Tizen/remote-key-framework-service.git 3. Upload to Git repository 1. $ git push origin master master branch in local repository will be uploaded to master branch in remote repository.
Upload Initial Source Code (7/7) 29 Case 2. Use a Existing Git Repository 4. Result Existing Git repository is uploaded to Github repository. Existing commit log, branch information are preserved.
Clone Github Repository 30 1. Run following command 1. $ git clone https://github.com/organization/project-name.git ex. $ git clone https://github.com/skku-eslab-tizen/remotekey-framework-service.git
31 3. Repository Management and Package Build/Install 1. Version & Branch Management 2. Package Build 3. Package Install
Tizen Source Code Workflow 32 1. Git: manages source code versions 2. GBS: builds source code of git repository makes package file(rpm) 3. Install package file on ODROID-U3 Working Directory hello.c Local PC Github Server (Remote) (Remote) Repository Ver.2 hello.c Ver.1 Push Pull Add Staging Area Commit (Local) Repository Ver.2 hello.c Ver.1 gbs build Package file (rpm) ODROID-U3 Install
Git: Key Concepts 33 Working directory Source code in work add command: adds files/directories to staging area Staging area(index) Source code to be committed commit command: makes a new version in repository Repository(HEAD) Source code already committed Files or directories are stored as content-addressable objects identifiable by hash value. Working Directory hello.c Add Staging Area Commit (Local) Repository Ver.2 hello.c Ver.1
Version Management (1/2) 34 Add a source code, hello.cpp 1. Add hello.c to staging area 1. $ git add hello.c 2. Make a new version 1. $ git commit -m commit message Add all of the source code 1. Add all of the source code 1. $ git add --all 2. Make a new version 1. $ git commit -m commit message Display staging area s status 1. $ git status Working Directory hello.c Add Staging Area Commit (Local) Repository Ver.2 hello.c Ver.1
Version Management (2/2) 35 Display the commit log 1. $ git log Each commit s hash value, author information, date, message commit 783c82ff64eda9f03401834de906eca77d01f691 Author: Gyeonghwan Hong <redcarrottt@gmail.com> Date: Mon Sep 22 10:37:44 2014 +0900 2nd version commit: hello.c is added commit 712943bb31bf85430e1a027abe197e5b88a26110 Author: Gyeonghwan Hong <redcarrottt@gmail.com> Date: Thu Aug 28 12:08:17 2014 +0900 1st version commit: is added Return to a previous version 1. git checkout <commit s hash value> Working Directory hello.c Add Staging Area Commit (Local) Repository Ver.2 hello.c Ver.1 ex. git checkout 712943bb31bf85430e1a027abe197e5b88a26110
Local & Remote Repository (1/2) 36 Commit Make a new version on local repository Push Upload commits in local repository to remote repository Pull Download commits in remote repository to local repository Local PC Working Directory hello.c Add Staging Area Commit (Local) Repository Ver.2 hello.c Ver.1 Push Pull Github Server (Remote) (Remote) Repository Ver.2 hello.c Ver.1
Local & Remote Repository (2/2) 37 Upload to remote repository 1. $ git push <remote name> <remote branch> ex. $ git push origin master Download from remote repository 1. $ git pull Local PC Working Directory hello.c Github Server (Remote) (Remote) Repository Ver.2 hello.c Ver.1 Push Pull Add Staging Area Commit (Local) Repository Ver.2 hello.c Ver.1
Branch Management (1/3) 38 Check the branch list of local repository 1. $ git branch --list Check the branch list of remote repository 1. $ git branch --remote * master feature_x Move to another branch 1. $ git checkout <branch name> ex. $ git checkout feature_x
Branch Management (2/3) 39 Develop a new feature by making a new branch 1. Make a new branch feature_x 1. $ git branch feature_x 2. $ git checkout feature_x 2. Edit and commit source code 3. Merge feature_x branch to original branch 1. $ git checkout master 2. $ git merge feature_x
Branch Management (3/3) 40 Conflict When merging feature_y branch to master branch, in version 2-x and 2-y have different changes each other. This situation is called as conflict. The conflict should be resolved by conflict resolution process. 1. $ git mergetool http://git-scm.com/book/en/v2/git-branching-basic-branching-and- Merging
Required Files in Repository (1/2) 41 Tizen project repository requires following files Red files are files required at least. AUTHORS: Author list LICENSE: License information CMakeLists.txt: cmake configuration file about this directory s build <project-name>.manifest: SMACK manifest file packaging <project-name>.manifest: SMACK manifest file <project-name>.spec: RPM package specification file <sub-directory 1> CMakeLists.txt include Header files src Source code files <sub-directory 2>, <sub-directory 3>,
Required Files in Repository (2/2) 42 ex. Remote Key Framework Service Project (Link) AUTHORS: Author list LICENSE: License information CMakeLists.txt: cmake configuration file about this directory s build remote-key-framework.manifest: SMACK manifest file packaging remote-key-framework.manifest: SMACK manifest file remote-key-framework.spec: RPM package specification file remote-key-framework.service: systemd service configuration file server CMakeLists.txt include common.h: Common header file src main.cpp: Main source code common.cpp: Source code of dlog connector
How to Build Single Tizen Package (1/3) 43 Build the most recent version in Git repository In default, GBS builds the source code of most recent version. 1. Move to the directory of repository. 2. $ gbs build -A armv7l -A <architecture type>: x86, armv7l Local PC Working Directory hello.c Add Staging Area Commit (Local) Repository Ver.2 hello.c Ver.1 gbs build Package file (rpm)
How to Build Single Tizen Package (2/3) 44 Build the working directory Use it in the case of building the source code in work. 1. Move to the directory of repository. 2. $ gbs build -A armv7l --include-all --include-all: option for building working directory Local PC Working Directory hello.c Add Staging Area Commit (Local) Repository Ver.2 hello.c Ver.1 gbs build Package file (rpm)
How to Build Single Tizen Package (3/3) 45 Other GBS Options --threads <# of threads>: the number of build threads --clean: initializes the GBS build root --exclude=<packages>: the list of packages to be excluded Build Result Name: package_name-version.arch.rpm ex. remote-key-framework-1.2.1.armv7l.rpm Located in: ~/GBS-ROOT/local/repos/tizen2.2/armv7l/RPMS/
How to Install Tizen Package (1/2) 46 Install package files(*.rpm) on target board Send package files to target board through SDB Install the packages by RPM tool Local PC Working Directory hello.c Add Staging Area Commit gbs build --include-all Package file (rpm) Install (Local) Repository Ver.2 hello.c Ver.1 gbs build Package file (rpm) ODROID-U3 Install
How to Install Tizen Package (2/2) 1. Connect to ODROID-U3 via USB How to check connection: $ sdb devices Caution: If you are using VMWare, check the connection of removable device 2. Enter to SDB root mode 1. $ sdb root on 3. Send package file to target board through SDB 1. $ sdb push package_name-version.arch.rpm / 4. Install the package 1. $ sdb shell rpm -ivh --nodeps --force package_nameversion.arch.rpm 5. Reboot your target board 1. $ adb shell sync; sdb shell reboot -f