Download presentation
Published byCamilla Woods Modified over 9 years ago
1
Development Environment and Tizen v2.3 Platform Build
2
Contents 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
3
1. Tizen v2.3 Development Environment
Tizen v2.3 Development Overview Installation Tizen v2.3 Source Code Management
4
Tizen v2.3 Development Overview (1/2)
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
5
Tizen v2.3 Development Overview (2/2)
Centralized Source Code Management Tizen source code is reviewed and submitted on centralized review server. GBS(Git Build System): a tool for centralized source code management All the repositories are managed on Tizen servers; Gerrit and OBS.
6
Tizen v2.3 Development Workflow (1/3)
From local coding to final release
7
Tizen v2.3 Development Workflow (2/3)
Local works by Developers It will be covered in “Section 1-C. Tizen Source Code Management”. Setting up Tizen development environment Cloning the source code Changing and verifying local source code through local build Submit & Review Submission: Developer submits patches to review server for stakeholders to review Verification: Tizen backend service and reviewers verify the patches through testing process and then vote based on the quality of the patches. Approval and Merge: Maintainers approve the patches and then merge code changes to the review server’s repository.
8
Tizen v2.3 Development Workflow (3/3)
Release Tizen backend service activates pre-release and normal release processes at the same time. Submission on OBS: Maintainers/Developers submit packages to the OBS by using gbs submit command. Pre-release: Tizen images that incorporates specific packages are created and submitted to release engineers to review. Final review: Release engineers accept or reject submissions based on the quality of the packages. Accepted source code is merged into the OBS repository. Release: the normal release process takes over and publishes repos together with Tizen images.
9
SCM Tools (1/3): Git 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.
10
SCM Tools (2/3): Repo 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
11
SCM Tools (3/3): GBS 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)
12
Centralized SCM System
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.
13
Packaging Tools: RPM and MIC
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)
14
1. Tizen v2.3 Development Environment
Tizen v2.3 Development Overview Installation Tizen v2.3 Source Code Management
15
Tizen v2.3 Dev. Environment Install (1/10)
We will cover an environment based on Ubuntu. Git: Install and Configuration Install a git package. $ sudo apt-get install git Configure user information of git. This information will be used for committer information. $ git config --global user.name “Your name” $ git config --global user. ex. $ git config --global user.name “Gyeonghwan Hong” $ git config --global user.
16
Tizen v2.3 Dev. Environment Install (2/10)
Repo: Install and Configuration Download repo. $ sudo apt-get install curl $ mkdir -p ~/bin $ curl > ~/bin/repo $ chmod +x ~/bin/repo Add repo’s path to the basic path list. Edit ~/.bashrc $ gedit ~/.bashrc After adding below code to the last line, restart your shell. PATH=~/bin:${PATH} ~/.bashrc
17
Tizen v2.3 Dev. Environment Install (3/10)
GBS, MIC: Install Add Tizen development tool repository to APT repository list. $ sudo gedit /etc/apt/sources.list Add below code Check your Ubuntu version. $ cat /etc/issue deb /etc/apt/sources.list $ sudo apt-get update Install packages of GBS, MIC. $ sudo apt-get install gbs mic
18
Tizen v2.3 Dev. Environment Install (4/10)
You should have an access right to review server for accessing Tizen source code. Register a Tizen developer ID Go to developer.tizen.org/ko. You can log in Tizen review server (review.tizen.org).
19
Tizen v2.3 Dev. Environment Install (5/10)
Review Server: Configuration $ gedit ~/.ssh/config Enter your Gerrit ID. Host tizen Hostname review.tizen.org IdentityFile ~/.ssh/id_rsa User GerritID Port 29418 Host review.tizen.org ~/.ssh/config
20
Tizen v2.3 Dev. Environment Install (6/10)
Review Server: Configuration (Cont’d) Run “ssh-keygen” on a shell. $ ssh-keygen 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
21
Tizen v2.3 Dev. Environment Install (7/10)
Review Server: Configuration (Cont’d) After log in review.tizen.org, go to ‘settings’ menu. Enter into “SSH Public Keys” menu → Press “Add Key …” button.
22
Tizen v2.3 Dev. Environment Install (8/10)
Review Server: Configuration (Cont’d) Display the contents of public key file. $ cat ~/.ssh/id_rsa.pub Copy the displayed text to below text box. Contents of ‘~/.ssh/id_rsa.pub’
23
Tizen v2.3 Dev. Environment Install (9/10)
Review Server: Configuration (Cont’d) Test ssh server connection $ ssh tizen $ ssh review.tizen.org If the connection is successful, below message will be displayed.
24
Tizen v2.3 Dev. Environment Install (10/10)
Make a GBS configuration file (~/.gbs.conf) Without this file, Tizen source code cannot be built. $ 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. [general] tmpdir=/var/tmp/ profile=profile.tizen2.3 [repo.tizen2.3] url= [profile.tizen2.3] repos=repo.tizen2.3
25
1. Tizen v2.3 Development Environment
Tizen v2.3 Development Overview Installation Tizen v2.3 Source Code Management
26
Tizen v2.3 Local Work Flow All Process before submission
Git: manages source code versions GBS: builds source code of git repository → makes package file(RPM) Install package file on target board
27
Git: Key Concepts Working directory Staging area(index)
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).
28
Version Management (1/2)
Add a source code, ‘hello.cpp’ Add hello.c to staging area $ git add hello.c Make a new version $ git commit -m “commit message” Add all of the source code $ git add --all Display staging area’s status $ git status
29
Version Management (2/2)
Display the commit log $ git log Each commit’s hash value, author information, date, message commit 783c82ff64eda9f de906eca77d01f691 Author: Gyeonghwan Hong Date: Mon Sep 22 10:37: 2nd version commit: hello.c is added commit bb31bf85430e1a027abe197e5b88a26110 Date: Thu Aug 28 12:08: 1st version commit: hello.h is added Return to a previous version $ git checkout <commit’s hash value> ex. Return to “1st version commit” $ git checkout bb31bf85430e1a027abe197e5b88a26110
30
Local & Remote Repository (1/2)
“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
31
Local & Remote Repository (2/2)
Upload to remote repository $ git push <remote name> <remote branch> ex. $ git push origin master Download from remote repository $ git pull <remote name> <remote branch> ex. $ git pull origin master
32
Branch Management (1/3) Check the branch list of local repository
$ git branch --list Check the branch list of remote repository $ git branch --remote * master feature_x Move to another branch $ 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>
33
Branch Management (2/3) Develop a new feature by making a new branch
Make a new branch ‘feature_x’ $ git branch feature_x Checkout to the new branch Edit and commit source code Merge the ‘feature_x’ branch to original branch $ git checkout master $ git merge feature_x
34
Branch Management (3/3) 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. $ git mergetool
35
2. Building a Tizen v2.3 Platform Project
36
Tizen v2.3 Platform Project Build Process (1/2)
Assume that Tizen v2.3 is running on target board Example: build and install package A
37
Tizen v2.3 Platform Project Build Process (2/2)
Clone the Source Code of a Tizen Project Download source code of a Tizen project from Tizen review server. Build the Tizen Project Build the source code of the project with GBS, and make package files(*.rpm). Install the Packages Install the package files(*.rpm) to the target board with SDB.
38
Required Files in Repository (1/2)
Tizen v2.3 project repository requires following files Red files are 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>.spec: RPM package specification file <sub-directory 1> CMakeLists.txt include Header files src Source code files <sub-directory 2>, <sub-directory 3>, …
39
Required Files in Repository (2/2)
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.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
40
Clone the Source Code of Tizen v2.3 Project (1/2)
Log in Tizen review server (review.tizen.org) Enter into “Projects” → “List” 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. Clone the repository $ git clone
41
Clone the Source Code of Tizen v2.3 Project (2/2)
Tizen project source code has several branches by release version. Check branches $ 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 origin/tizen_2.3 Change branch to target release version $ git checkout <target branch> ex. git checkout origin/tizen_2.3
42
Build the Tizen v2.3 Project (1/3)
Build the most recent version in Git repository In default, GBS builds the source code of most recent version. Move to the directory of repository. $ gbs build -A armv7l -A <architecture type>: i586, x86_64, armv7l
43
Build the Tizen v2.3 Project (2/3)
Build the working directory Use it in the case of building the source code in work. Move to the directory of repository. $ gbs build -A armv7l --include-all --include-all: option for building working directory
44
Build the Tizen v2.3 Project (3/3)
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 armv7l.rpm Located in: ~/GBS-ROOT/local/repos/tizen2.3/armv7l/RPMS/
45
Install the Packages (1/2)
Install package files(*.rpm) on target board Send package files to target board through SDB Install the packages by RPM tool
46
Install the Packages (2/2)
Connect to ODROID-U3 via USB How to check connection: $ sdb devices Caution: If you are using VMWare, check the connection of ‘removable device’ Enter to SDB root mode $ sdb root on Send package file to target board through SDB $ sdb push <package file> / Install the package $ sdb shell rpm -ivh --nodeps --force <package file> Reboot your target board $ sdb shell sync; sdb shell reboot -f
47
3. Making Tizen v2.3 Platform Image
48
Process of Making Tizen v2.3 Platform Images
MIC makes images using Tizen v2.3 packages. 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
49
Kickstart File 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
50
Kickstart File: Structure (1/4)
#Default locale, keyboard language, and timezone lang en_US.UTF-8 keyboard us timezone --utc Asia/Seoul #Partition configurations # ROOT fs partition part / --size= ondisk mmcblk0p --fstype=ext4 --label=rootfs --extoptions="-J size=16" # DATA partition part /opt/ --size=312 --ondisk mmcblk0p --fstype=ext4 --label=system-data --extoptions="-m 0" # UMS partition part /opt/usr/ --size= ondisk mmcblk0p --fstype=ext4 --label=user --extoptions="-m 0“ #Root user and default user to login rootpw tizen bootloader --timeout=0 --append="rootdelay=5" desktop --autologinuser=root user --name root --groups audio,video --password '‘ (Continued) tizen-2.3-mobile.ks
51
Kickstart File: Structure (2/4)
Repository path Path of repository that contains Tizen packages Multiple path: local path, download server … Priority is tunable. (Continued) # Modify the local path as your environment. repo --name=local-packages --baseurl=file:///home/user/GBS-ROOT/local/repos/tizen2.3/armv7l/ --priority=1 repo --name=2.3-mobile-target --baseurl= --save --ssl_verify=no --priority=2 tizen-2.3-mobile.ks
52
Kickstart File: Structure (3/4)
Required package groups List of package groups to be included in image Pre-required packages (Continued) %packages @target-m @eng-tools-m %end %prepackages libprivilege-control-conf rpm-security-plugin tizen-2.3-mobile.ks
53
Kickstart File: Structure (4/4)
Postscript Script that configures the initial condition of image (Continued) %post echo 'kickstart post script start' rm -rf /usr/include rm -rf /usr/share/man rm -rf /usr/share/doc ldconfig if [ ! -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/run fi (중략) %end tizen-2.3-mobile.ks
54
Making Tizen v2.3 Platform Images
Download Kickstart File $ git clone Make Tizen v2.3 Images $ cd tizen-kickstart-mobile $ 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 Results: <TIZEN-ROOT>/mic-output tizen-2.3-mobile-YYYYMMDDhhmm.tar.gz: Platform images rootfs.img, system-data.img, user.img, tizen-2.3-mobile-YYYYMMDDhhmm.packages: Package list tizen-2.3-mobile-YYYYMMDDhhmm.xml: Partition information manifest.json: Manifest file
55
Appendix: Git and Repo Cheatsheet (1/2)
Android developing document:
56
Appendix: Git and Repo Cheatsheet (2/2)
57
Appendix: Locale error in build phase
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. $ 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
58
Appendix: GBS Trouble-shooting (1/2)
When build error is occured, refer to the error log. 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 /log.txt Example You can find the problem on the error log. [ 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 /home/user/GBS-ROOT/local/repos/tizen2.3/armv7l/ logs/fail/xf86-video-exynos /log.txt
59
Appendix: GBS Trouble-shooting (2/2)
RPM DB4 error [ 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 /home/user/GBS-ROOT/local/repos/tizen2.3/armv7l/ logs/fail/xf86-video-exynos /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 --clean build.sh
60
Appendix: Profile 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
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.