+ All Categories
Home > Documents > SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3...

SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3...

Date post: 12-Jan-2016
Category:
Upload: camilla-woods
View: 226 times
Download: 0 times
Share this document with a friend
60
SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build
Transcript
Page 1: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

1

SKKU Embedded Software Lab.

Development Environmentand Tizen v2.3 Platform Build

Page 2: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

2

SKKU Embedded Software Lab.

• Tizen v2.3 Development Environment– Tizen v2.3 Development Overview– Installation– Tizen Source Code Management

• Building a Tizen v2.3 Platform Project• Making Tizen v2.3 Platform Image

Contents

Page 3: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

3

SKKU Embedded Software Lab.

A. Tizen v2.3 Development Overview

B. InstallationC. Tizen v2.3 Source Code

Management

1. Tizen v2.3 Development Environment

Page 4: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

4

SKKU Embedded Software Lab.

• Hundreds of 'Open Source' Projects• Source code repository

– Each project has its source code repository.– Developers can clone, edit and build its source code.– Git: source code management tool

Tizen v2.3 Development Overview (1/2)

Page 5: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

5

SKKU Embedded Software Lab.

• Centralized Source Code Management– Tizen source code is reviewed

and submitted on centralized review server.• http://review.tizen.org

– GBS(Git Build System): a tool for centralized source code management

– All the repositories are managed on Tizen servers; Gerrit and OBS.

Tizen v2.3 Development Overview (2/2)

Page 6: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

6

SKKU Embedded Software Lab.

Tizen v2.3 Development Workflow (1/3)

• From local coding to final release

Page 7: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

7

SKKU Embedded Software Lab.

1. Local works by Developers– It will be covered in “Section 1-C. Tizen Source Code

Management”.1. Setting up Tizen development environment2. Cloning the source code3. Changing and verifying local source code through local build

2. Submit & Review1.Submission: Developer submits patches to review server

for stakeholders to review2.Verification: Tizen backend service and reviewers verify

the patches through testing process and then vote based on the quality of the patches.

3.Approval and Merge: Maintainers approve the patches and then merge code changes to the review server’s repository.

Tizen v2.3 Development Workflow (2/3)

Page 8: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

8

SKKU Embedded Software Lab.

3. Release– Tizen backend service activates pre-release and

normal release processes at the same time.1. Submission on OBS: Maintainers/Developers submit

packages to the OBS by using gbs submit command.2. Pre-release: Tizen images that incorporates specific

packages are created and submitted to release engineers to review.

3. Final review: Release engineers accept or reject submissions based on the quality of the packages. Accepted source code is merged into the OBS repository.

4. Release: the normal release process takes over and publishes repos together with Tizen images.

Tizen v2.3 Development Workflow (3/3)

Page 9: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

9

SKKU Embedded Software Lab.

• A revision control and source management tool

• Features– Free and open source(GNU GPL v2)– Smaller and faster than other SCM tools– Distributed– Branching and merging– Data assurance– Staging area

• Git in Tizen– All source code repositories of Tizen packages are

managed by git.

SCM Tools (1/3): Git

Page 10: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

10

SKKU Embedded Software Lab.

• Repository management tool built on top of Git– Originally used in Android project– Used for managing many git repositories– Automate parts of development workflow

• Repo in Tizen– Tizen platform is composed of the hundreds of projects.– Each projects are managed as a git repository.– Repo is used for managing Tizen platform repositories in

batched manner.• ex. Cloning git repositories of entire Tizen platform packages

SCM Tools (2/3): Repo

Page 11: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

11

SKKU Embedded Software Lab.

• Git Build System• A developer command line tool that

supports Tizen package development• Functions

– Builds a repository or repositories and make package files(*.rpm)

– Generates tarballs based on Git repositories– Does local test buildings– Submits source code to OBS(Tizen’s main build service)

SCM Tools (3/3): GBS

Page 12: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

12

SKKU Embedded Software Lab.

• Gerrit (review.tizen.org)– A Web-based code review system

• OBS(Open Build System; build.tizen.org)– A distributed development platform that makes developers

to easily release open source software for various Linux distributions on different hardware architectures.

Centralized SCM System

Page 13: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

13

SKKU Embedded Software Lab.

• RPM(Red Hat Package Manager)– A tool to manage software packages

• build, install, query, verify, update and erase software packages

– RPM in Tizen• Each Tizen platform package is represented in *.rpm form and

managed by RPM.

• MIC(Moblin Image Creator)– A tool to create platform images to be flashed on target

device’s storage– Requires:

• Tizen platform packages (*.rpm)• Kickstart file: it defines how to make image of target device

– Output: platform images(system.img, userdata.img, ums.img)

Packaging Tools: RPM and MIC

Page 14: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

14

SKKU Embedded Software Lab.

A. Tizen v2.3 Development OverviewB. Installation

C. Tizen v2.3 Source Code Management

1. Tizen v2.3 Development Environment

Page 15: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

15

SKKU Embedded Software Lab.

Tizen v2.3 Dev. Environment Install (1/10)

• We will cover an environment based on Ubuntu.

1.Git: Install and Configuration1. 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 [email protected]

Page 16: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

16

SKKU Embedded Software Lab.

Tizen v2.3 Dev. Environment Install (2/10)

PATH=~/bin:${PATH}

~/.bashrc

~/.bashrc

2. Repo: Install and Configuration1. Download repo.

1.$ sudo apt-get install curl2.$ mkdir -p ~/bin3.$ curl http://commondatastorage.googleapis.com/git-repo-

downloads/repo > ~/bin/repo4.$ chmod +x ~/bin/repo

2. Add repo’s path to the basic path list.1.Edit ~/.bashrc

1. $ gedit ~/.bashrc2. After adding below code to the last line, restart your shell.

Page 17: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

17

SKKU Embedded Software Lab.

3. GBS, MIC: Install1. Add Tizen development tool repository to APT repository

list.1. $ sudo gedit /etc/apt/sources.list

2. Add below code– Check your Ubuntu version.

» $ cat /etc/issue

Tizen v2.3 Dev. Environment Install (3/10)

deb http://download.tizen.org/tools/pre-release/Ubuntu_13.10 /

/etc/apt/sources.list

/etc/apt/sources.list

3. $ sudo apt-get update

2. Install packages of GBS, MIC.1. $ sudo apt-get install gbs mic

Page 18: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

18

SKKU Embedded Software Lab.

• You should have an access right to review server for accessing Tizen source code.

4. Register a Tizen developer ID1. Go to developer.tizen.org/ko.

Tizen v2.3 Dev. Environment Install (4/10)

2. You can log in Tizen review server (review.tizen.org).

Page 19: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

19

SKKU Embedded Software Lab.

5. Review Server: Configuration1. $ gedit ~/.ssh/config– Enter your Gerrit ID.

Tizen v2.3 Dev. Environment Install (5/10)

Host tizen Hostname review.tizen.org IdentityFile ~/.ssh/id_rsa User GerritID Port 29418

Host review.tizen.org Hostname review.tizen.org IdentityFile ~/.ssh/id_rsa User GerritID Port 29418

~/.ssh/config~/.ssh/config

Page 20: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

20

SKKU Embedded Software Lab.

5. Review Server: Configuration (Cont’d)2. Run “ssh-keygen” on a shell.

1. $ ssh-keygen

Tizen v2.3 Dev. Environment Install (6/10)

– Press just enter about every question for using default values.

– Finally, id_rsa, id_rsa.pub files will be created.» id_rsa: private key» id_rsa.pub: public key

Page 21: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

21

SKKU Embedded Software Lab.

5. Review Server: Configuration (Cont’d)3. After log in review.tizen.org, go to ‘settings’ menu.

Tizen v2.3 Dev. Environment Install (7/10)

4. Enter into “SSH Public Keys” menu → Press “Add Key …” button.

Page 22: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

22

SKKU Embedded Software Lab.

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.

Tizen v2.3 Dev. Environment Install (8/10)

Contents of ‘~/.ssh/id_rsa.pub’

Page 23: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

23

SKKU Embedded Software Lab.

5. Review Server: Configuration (Cont’d)7. Test ssh server connection

1. $ ssh tizen2. $ ssh review.tizen.org• If the connection is successful, below message will be

displayed.

Tizen v2.3 Dev. Environment Install (9/10)

Page 24: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

24

SKKU Embedded Software Lab.

6. Make a GBS configuration file (~/.gbs.conf)– Without this file, Tizen source code cannot be built.1. $ gedit ~/.gbs.conf

• Check whether repo.tizen2.3 is vaild or not. Repository’s URL can be changed if new version of Tizen is released.

Tizen v2.3 Dev. Environment Install (10/10)

[general]tmpdir=/var/tmp/profile=profile.tizen2.3

[repo.tizen2.3]url=http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-mobile_20150311.3/repos/target/packages

[profile.tizen2.3]repos=repo.tizen2.3

Page 25: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

25

SKKU Embedded Software Lab.

A. Tizen v2.3 Development OverviewB. Installation

C. Tizen v2.3 Source Code Management

1. Tizen v2.3 Development Environment

Page 26: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

26

SKKU Embedded Software Lab.

• All Process before submission1.Git: manages source code versions2.GBS: builds source code of git repository

→ makes package file(RPM)3.Install package file on target board

Tizen v2.3 Local Work Flow

Page 27: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

27

SKKU Embedded Software Lab.

• 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(SHA-1).

Git: Key Concepts

Working Directory

hello.c hello.h

(Local) Repository

Staging Area

Ver.1hello.h

Ver.2hello.c hello.h

Commit

Add

Page 28: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

28

SKKU Embedded Software Lab.

• Add a source code, ‘hello.cpp’1. Add hello.c to staging area

1. $ git add hello.c

2. Make a new version1. $ git commit -m “commit message”

• Add all of the source code1. Add all of the source code

1. $ git add --all

2. Make a new version1. $ git commit -m “commit message”

• Display staging area’s status1. $ git status

Version Management (1/2)

Working Directory

hello.c hello.h

(Local) Repository

Staging Area

Ver.1hello.h

Ver.2hello.c hello.h

Commit

Add

Page 29: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

29

SKKU Embedded Software Lab.

• Display the commit log1. $ git log– Each commit’s hash value, author

information, date, message

Version Management (2/2)

commit 783c82ff64eda9f03401834de906eca77d01f691Author: Gyeonghwan Hong <[email protected]>Date: Mon Sep 22 10:37:44 2014 +0900 2nd version commit: hello.c is added

commit 712943bb31bf85430e1a027abe197e5b88a26110Author: Gyeonghwan Hong <[email protected]>Date: Thu Aug 28 12:08:17 2014 +0900 1st version commit: hello.h is added

• Return to a previous version1. $ git checkout <commit’s hash

value>

Working Directory

hello.c hello.h

(Local) Repository

Staging Area

Ver.1hello.h

Ver.2hello.c hello.h

Commit

Add

– ex. Return to “1st version commit”$ git checkout 712943bb31bf85430e1a027abe197e5b88a26110

Page 30: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

30

SKKU Embedded Software Lab.

• “Commit”– Make a new version on local repository

• “Push”– Upload commits in local repository to remote repository

Local & Remote Repository (1/2)

• “Pull”– Download commits

in remote repository to local repository

Local PC

Working Directory

hello.c hello.h

(Local) Repository

Staging Area

Ver.1hello.h

Ver.2hello.c hello.h

Github Server (Remote)

(Remote) Repository

Ver.1hello.h

Ver.2hello.c hello.h

Pull

Push

Commit

Add

Page 31: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

31

SKKU Embedded Software Lab.

• Upload to remote repository1. $ git push <remote name> <remote branch>– ex. $ git push origin master

Local & Remote Repository (2/2)

Local PC

Working Directory

hello.c hello.h

(Local) Repository

Staging Area

Ver.1hello.h

Ver.2hello.c hello.h

Github Server (Remote)

(Remote) Repository

Ver.1hello.h

Ver.2hello.c hello.h

Pull

Push

Commit

Add

• Download from remote repository1. $ git pull <remote name> <remote

branch>

– ex. $ git pull origin master

Page 32: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

32

SKKU Embedded Software Lab.

• Check the branch list of local repository1. $ git branch --list

• Check the branch list of remote repository1. $ git branch --remote

Branch Management (1/3)

* master feature_x

• Move to another branch1. $ git checkout <branch

name>– ex. $ git checkout feature_x– You should commit all the local

change before checkout. If not, it makes an error.

– If you want to checkout without making a new commit, use flag “-f”.• $ git checkout -f <branch name>

Page 33: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

33

SKKU Embedded Software Lab.

• Develop a new feature by making a new branch1.Make a new branch ‘feature_x’

1. $ git branch feature_x

2.Checkout to the new branch2. $ git branch feature_x

3.Edit and commit source code4.Merge the ‘feature_x’ branch to original branch

1. $ git checkout master2. $ git merge feature_x

Branch Management (2/3)

Page 34: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

34

SKKU Embedded Software Lab.

• Conflict– When merging feature_y branch to master branch, ‘hello.h’

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

Branch Management (3/3)

Page 35: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

35

SKKU Embedded Software Lab.

2. Building a Tizen v2.3 Platform Project

Page 36: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

36

SKKU Embedded Software Lab.

• Assume that Tizen v2.3 is running on target board• Example: build and install package A

Tizen v2.3 Platform Project Build Process (1/2)

Page 37: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

37

SKKU Embedded Software Lab.

1. Clone the Source Code of a Tizen Project– Download source code of a Tizen project from Tizen

review server.

2. Build the Tizen Project– Build the source code of the project with GBS, and

make package files(*.rpm).

3. Install the Packages– Install the package files(*.rpm) to the target board with

SDB.

Tizen v2.3 Platform Project Build Process (2/2)

Page 38: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

38

SKKU Embedded Software Lab.

• Tizen v2.3 project repository requires following files– Red files are required at least.

Required Files in Repository (1/2)

• 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>, …

Page 39: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

39

SKKU Embedded Software Lab.

• ex. Remote Key Framework Service Project (Link)

Required Files in Repository (2/2)

• 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

Page 40: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

40

SKKU Embedded Software Lab.

1. Log in Tizen review server (review.tizen.org)2. Enter into “Projects” → “List”3. Find a repository that you want to clone

– Caution: Packages in Tizen 2.3 and 3.0 are managed in different way, so multiple packages will be displayed on the result.

4. Clone the repository1. $ git clone ssh://[email protected]:29418/project-

name

Clone the Source Code of Tizen v2.3 Project (1/2)

Page 41: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

41

SKKU Embedded Software Lab.

Clone the Source Code of Tizen v2.3 Project (2/2)

• Tizen project source code has several branches by release version.

5.Check branches1. $ git branch --remote

• ex. origin/1.0_postorigin/2.0alphaorigin/HEAD -> origin/masterorigin/masterorigin/tizen_2.0origin/tizen_2.1origin/tizen_2.2origin/tizen_2.3

6. Change branch to target release version1. $ git checkout <target branch>

• ex. git checkout origin/tizen_2.3

Page 42: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

42

SKKU Embedded Software Lab.

• 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>: i586, x86_64, armv7l

Build the Tizen v2.3 Project (1/3)

Page 43: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

43

SKKU Embedded Software Lab.

• 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

Build the Tizen v2.3 Project (2/3)

Page 44: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

44

SKKU Embedded Software Lab.

• GBS downloads dependent packages from Tizen download server on demand.– ex. wrt(Web Runtime) package depends on ewebkit2(WebKitEFL)

package, so ewebkit2 is downloaded when building wrt.

• 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(Package Files; *.rpm)– The name of package file is dependent on the project’s RPM spec.– Typically package file is named as ‘package_name-

version.arch.rpm’.• ex. remote-key-framework-1.2.1.armv7l.rpm

– Located in: ~/GBS-ROOT/local/repos/tizen2.3/armv7l/RPMS/

Build the Tizen v2.3 Project (3/3)

Page 45: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

45

SKKU Embedded Software Lab.

• Install package files(*.rpm) on target board– Send package files to target board through SDB– Install the packages by RPM tool

Install the Packages (1/2)

Page 46: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

46

SKKU Embedded Software Lab.

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 mode1. $ sdb root on

3. Send package file to target board through SDB1. $ sdb push <package file> /

4. Install the package1. $ sdb shell rpm -ivh --nodeps --force <package file>

5. Reboot your target board1. $ sdb shell sync; sdb shell reboot -f

Install the Packages (2/2)

Page 47: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

47

SKKU Embedded Software Lab.

3. Making Tizen v2.3 Platform Image

Page 48: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

48

SKKU Embedded Software Lab.

• MIC makes images using Tizen v2.3 packages.

Process of Making Tizen v2.3 Platform Images

– MIC downloads pre-built packages from download server, which do not exist in local repository.

• Requirements– Tizen packages

• in local• in download

server

– Kickstart file

Page 49: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

49

SKKU Embedded Software Lab.

• A file that defines how to make image of target device

• Structure– Default locale, keyboard language, timezone– Partition configurations, root user, default user to login– Repository path

• Path of repository that contains Tizen packages

– Required package groups• List of package groups to be included in image

– Required pre-packages• List of packages to be included in image

– Postscript• Script that configures the initial condition of image

Kickstart File

Page 50: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

50

SKKU Embedded Software Lab.

Kickstart File: Structure (1/4)

#Default locale, keyboard language, and timezonelang en_US.UTF-8keyboard ustimezone --utc Asia/Seoul

#Partition configurations# ROOT fs partitionpart / --size=2000 --ondisk mmcblk0p --fstype=ext4 --label=rootfs --extoptions="-J size=16"# DATA partitionpart /opt/ --size=312 --ondisk mmcblk0p --fstype=ext4 --label=system-data --extoptions="-m 0"# UMS partitionpart /opt/usr/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=user --extoptions="-m 0“

#Root user and default user to loginrootpw tizen bootloader --timeout=0 --append="rootdelay=5"

desktop --autologinuser=root user --name root --groups audio,video --password '‘(Continued)

tizen-2.3-mobile.kstizen-2.3-mobile.ks

Page 51: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

51

SKKU Embedded Software Lab.

Kickstart File: Structure (2/4)

(Continued)# Modify the local path as your environment.repo --name=local-packages --baseurl=file:///home/user/GBS-ROOT/local/repos/tizen2.3/armv7l/ --priority=1repo --name=2.3-mobile-target --baseurl=http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-mobile_20150206.1/repos/target/packages/ --save --ssl_verify=no --priority=2(Continued)

tizen-2.3-mobile.kstizen-2.3-mobile.ks

• Repository path– Path of repository that contains Tizen packages– Multiple path: local path, download server …– Priority is tunable.

Page 52: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

52

SKKU Embedded Software Lab.

Kickstart File: Structure (3/4)

• Required package groups– List of package groups to be included in image

• Pre-required packages– List of package groups to be included in image

(Continued)%packages@target-m@eng-tools-m%end

%prepackageslibprivilege-control-confrpm-security-plugin%end(Continued)

tizen-2.3-mobile.kstizen-2.3-mobile.ks

Page 53: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

53

SKKU Embedded Software Lab.

• Postscript– Script that configures the initial condition of image

Kickstart File: Structure (4/4)

(Continued)%postecho 'kickstart post script start'rm -rf /usr/includerm -rf /usr/share/manrm -rf /usr/share/docldconfigif [ ! -L var ]; then [ -d opt ] || mkdir opt cp -af var opt rm -rf var ln -snf opt/var var rm -rf opt/var/run ln -snf /run opt/var/runfi( 중략 )%end

tizen-2.3-mobile.kstizen-2.3-mobile.ks

Page 54: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

54

SKKU Embedded Software Lab.

1. Download Kickstart File1. $ git clone https://github.com/SKKU-ESLAB-Tizen/tizen-

kickstart-mobile

2. Make Tizen v2.3 Images1. $ cd tizen-kickstart-mobile2. $ gbs createimage --ks-file=tizen-2.3-mobile.ks --tmpfs

• --ks-file=<path>: the path of kickstart file• --tmpfs: accelerates making image process through ramdisk

3. Results: <TIZEN-ROOT>/mic-output1. tizen-2.3-mobile-YYYYMMDDhhmm.tar.gz: Platform

images1.rootfs.img, system-data.img, user.img,

2. tizen-2.3-mobile-YYYYMMDDhhmm.packages: Package list3. tizen-2.3-mobile-YYYYMMDDhhmm.xml: Partition

information4. manifest.json: Manifest file

Making Tizen v2.3 Platform Images

Page 55: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

55

SKKU Embedded Software Lab.

Appendix: Git and Repo Cheatsheet (1/2)

• Android developing document:• https://source.android.com/source/developing.html

Page 56: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

56

SKKU Embedded Software Lab.

Appendix: Git and Repo Cheatsheet (2/2)

Page 57: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

57

SKKU Embedded Software Lab.

• Problem– GBS can run on only English Ubuntu.– If you use Ubuntu in other language, GBS could not be

work.

• Solution– Run below commands before run GBS.

Appendix: Locale error in build phase

$ export LANGUAGE=en_US.UTF-8$ export LANG=en_US.UTF-8$ export LC_ALL=en_US.UTF-8$ locale-gen en_US.UTF-8$ dpkg-reconfigure locales

Page 58: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

58

SKKU Embedded Software Lab.

• When build error is occured, refer to the error log.

Appendix: GBS Trouble-shooting (1/2)

info: *** Build Status Summary ***=== the following packages failed to build due to rpmbuild issue (1) ===xf86-video-exynos: /home/user/GBS-ROOT/local/repos/tizen2.3/armv7l/logs/fail/xf86-video-exynos-1.0.0-1/log.txt

ExampleExample

[ 139s] error: db4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139s] error: cannot open Packages index using db4 - (-30971)[ 139s] error: cannot open Packages database in /var/lib/rpm[ 139s] error: db4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139s] error: cannot open Packages database in /var/lib/rpm

/home/user/GBS-ROOT/local/repos/tizen2.3/armv7l/

logs/fail/xf86-video-exynos-1.0.0-1/log.txt

/home/user/GBS-ROOT/local/repos/tizen2.3/armv7l/

logs/fail/xf86-video-exynos-1.0.0-1/log.txt

• You can find the problem on the error log.

Page 59: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

59

SKKU Embedded Software Lab.

• RPM DB4 error

Appendix: GBS Trouble-shooting (2/2)

[ 139s] error: db4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139s] error: cannot open Packages index using db4 - (-30971)[ 139s] error: cannot open Packages database in /var/lib/rpm[ 139s] error: db4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139s] error: cannot open Packages database in /var/lib/rpm

/home/user/GBS-ROOT/local/repos/tizen2.3/armv7l/

logs/fail/xf86-video-exynos-1.0.0-1/log.txt

/home/user/GBS-ROOT/local/repos/tizen2.3/armv7l/

logs/fail/xf86-video-exynos-1.0.0-1/log.txt

– Problem: temporary files in BUILD-ROOT are in conflict each other.

– Solution: Add ‘--clean’ flag on GBS.

gbs build -A armv7l --include-all --cleanbuild.shbuild.sh

Page 60: SKKU Embedded Software Lab. 54 1 SKKU Embedded Software Lab. Development Environment and Tizen v2.3 Platform Build.

SKKU Embedded Software Lab.

54

60

SKKU Embedded Software Lab.

• A file that defines characteristics by target device– Basic features: Model name, platform version, processor name– Processor: CPU architecture, FPU type, Graphics acceleration– Network: Wifi, Telephony, VoIP, Bluetooth, GPS, WPS, Push– Peripheral devices: Camera, FM Radio, Keyboard, Microphone,

Multi-point touch, Screen, Sensors, USB, Vision– Other features: Database encryption, OpenGL configuration,

Shell, Speech, OSP-compatible

• Different profile is required on different target.– Official targets of Tizen 2.3: Mobile, Wearable

• Refer to https://www.tizen.org/feature

Appendix: Profile


Recommended