Download presentation
Presentation is loading. Please wait.
Published byDonald Lawson Modified over 7 years ago
1
Tizen Development Environment and Tizen v3.0 Platform Build
2
Contents Setting up Tizen Development Environment
Tizen Development Overview Tizen Dev. Environment Setting Tizen Source Code Management Building a Tizen v3.0 Platform Project Building Total Tizen v3.0 Platform Projects Creating Tizen v3.0 Platform Image
3
1. Setting up Tizen Development Environment
Tizen Development Overview Tizen Dev. Environment Setting Tizen Source Code Management
4
Tizen 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 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 to perform build for git-based source code All the repositories are managed on Tizen servers; Gerrit and OBS.
6
Tizen Development Workflow (1/3)
From local coding to final release
7
Tizen 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 local source code and verifying it through local build using GBS Submit & Review Submission: Developer submits patches to review server for stakeholders to review Review & Verify: Reviewers review and verify the patches 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 Development Workflow (3/3)
Release Tizen backend service activates pre-release and normal release processes. Submission on OBS: Maintainers/Developers submit packages to the OBS using ‘gbs submit’ command. Pre-release: OBS project that incorporates gbs submitted packages are created, OBS build runs and then image is created if there is no problem in OBS build Final review: Release engineers accept or reject submissions based on the quality of the packages, OBS build results and image creation results. Accepted source code is merged into the OBS repository. Release: Normal release process takes over and publishes repos together with Tizen images.
9
Tizen SCM Tools (1/2): GBS
Git Build System Command line tool that supports Tizen package build Functions Builds Tizen packages and make package files(*.rpm) A kind of wrapper which performs rpmbuild Generates Git repositoriy using src.rpm or tarball gbs import Submits source code to OBS(Tizen’s main build service) gbs submit
10
Tizen SCM Tools (2/2): MIC
Meego Image Creator Commandline tool to create platform images to be flashed on target device’s storage Requires: Tizen platform packages (*.rpm) Kickstart file A kind of recipe to create image Specify partition lists and package lists which are included in target image Output: Tizen platform images(system.img, userdata.img, ums.img)
11
Other 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.
12
Other SCM Tools (2/3): 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 packed by *.rpm form and managed by RPM.
13
Other SCM Tools (3/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
14
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.
15
1. Setting up Tizen Development Environment
Tizen Development Overview Tizen Dev. Environment Setting Tizen Source Code Management
16
Tizen Dev. Environment Setting (1/10)
We will cover an environment based on Ubuntu. Git: Install and Configuration Install a git package. $ sudo apt-get install git Git is automatically installed when gbs is intalled 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.
17
Tizen Dev. Environment Setting (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
18
Tizen Dev. Environment Setting (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
19
Tizen Dev. Environment Setting (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).
20
Tizen Dev. Environment Setting (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
21
Tizen Dev. Environment Setting (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
22
Tizen Dev. Environment Setting (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.
23
Tizen Dev. Environment Setting (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’
24
Tizen Dev. Environment Setting (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.
25
Tizen Dev. Environment Setting (10/10)
Make a GBS configuration file (~/.gbs.conf) Without this file, Tizen source code cannot be built. $ gedit ~/.gbs.conf Check whether url of repo.tizen3.0_base and repo.tizen3.0_mobile are vaild or not. Repository’s URL can be changed if new version of Tizen is released. [general] tmpdir=/var/tmp/ profile=profile.tizen3.0 [profile.tizen3.0] repos=repo.tizen3.0_base,repo.tizen3.0_mobile [repo.tizen3.0_base] url= [repo.tizen3.0_mobile] url=
26
1. Setting up Tizen Development Environment
Tizen Development Overview Tizen Dev. Environment Setting Tizen Source Code Management
27
Tizen 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
28
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).
29
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
30
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
31
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
32
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
33
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>
34
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 $ git checkout feature_x Edit and commit source code Merge the ‘feature_x’ branch to original branch $ git checkout master $ git merge feature_x
35
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
36
2. Building a Tizen v3.0 Platform Project
37
Tizen v3.0 Platform Project Build Process (1/2)
Assume that Tizen v3.0 is running on target board Example: build and install package A
38
Tizen v3.0 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.
39
Required Files in Repository (1/2)
Tizen v3.0 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>, …
40
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
41
Clone the Source Code of Tizen v3.0 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
42
Clone the Source Code of Tizen v3.0 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.1 origin/tizen_2.2 origin/tizen_2.3 origin/tizen_3.0 Change branch to target release version $ git checkout <target branch> ex. git checkout origin/tizen_3.0
43
Build the Tizen v3.0 Project (1/3)
Build the most recent version in Git repository By 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
44
Build the Tizen v3.0 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
45
Build the Tizen v3.0 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 from remote repos specified in .gbs.conf file 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/tizen3.0/armv7l/RPMS/
46
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
47
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
48
3. Building Total Tizen v3.0 Platform Projects
49
Cloning Total Source Code of Tizen
Make and move to Tizen source code directory $ mkdir tizen-platform; cd tizen-platform Set the path of download server. Initialize the repository $ repo init -u -b <branch name> -m <manifest file name> Example) $ repo init -u -b tizen -m mobile.xml Replace manifest file with specific snapshot manifest file $ curl <Snapshot_Manifest_URL> > .repo/manifests/common/projects.xml Example) $ curl Clone source code (Using 8 threads) $ repo sync -j8
50
Edit GBS Configuration
Need only repo.tizen3.0_base in GBS configuration file. $ gedit ~/tizen-platform/.gbs.conf [general] tmpdir=/var/tmp/ profile=profile.tizen3.0 [profile.tizen3.0] repos=repo.tizen3.0_base [repo.tizen3.0_base] url= [repo.tizen3.0_mobile] # Don’t need this repo url=
51
Building Total Platform Packages
Make a build script (build.sh) $ gedit build.sh #!/bin/bash # The list of packages to be excluded, # in order to prevent package dependency problem and reduce build time. export skip_pkgs="bash,bzip2-libs,c-ares,cmake,coreutils,diffutils,eglibc,elfutils-libelf,elfutils-libs,elfutils,fdupes,file,findutils,gawk,gmp,libacl,libattr,libcap,libcurl,libfile,libgcc,liblua,libstdc++,make,mpc,mpfr,ncurses-libs,nodejs,nspr,nss-softokn-freebl,nss,openssl,patch,popt,rpm-libs,rpm-build,sed,sqlite,tar,xz-libs,binutils,gcc,filesystem,aul,libmm-sound,libtool,syspopup,notification,libva,libzypp-bindings,rpm,web-ui-fw,python-doc,rpm,perl“ gbs build -A armv7l --threads=8 --clean-once --include-all --exclude=${skip_pkgs} ~/tizen-platform/build.sh $ sudo chmod +x build.sh Run the build script $ ./build.sh
52
4. Creating Tizen v3.0 Platform Image
53
Process of Creating Tizen v3.0 Platform Images
MIC creates images using Tizen v3.0 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
54
Kickstart File A file that defines how to create image Structure
Default locale, keyboard language, timezone Partition configurations, root user, default user to login Repository path Path of repository that contains Tizen packages Required packages List of packages to be included in image Postscript Script that configures the initial condition of image
55
Kickstart File: Structure (1/4)
#Default locale, keyboard language, and timezone lang en_US.UTF-8 keyboard us timezone --utc Asia/Seoul #Partition configurations part / --size= ondisk mmcblk0p --fstype=ext4 --label=rootfs --extoptions="-J size=16" part /opt/ --size= ondisk mmcblk0p --fstype=ext4 --label=system-data --extoptions="-m 0" part /opt/usr --size= ondisk mmcblk0p --fstype=ext4 --label=user --extoptions="-m 0" part /boot/kernel/mod_tizen_tm1/lib/modules --size=12 --ondisk mmcblk0p --fstype=ext4 --label=modules #Root user and default user to login rootpw tizen xconfig --startxonboot bootloader --timeout=3 --append="rw vga=current splash rootwait rootfstype=ext4 plymouth.enable=0" --ptable=gpt --menus="install:Wipe and Install:systemd.unit=system-installer.service:test" desktop --autologinuser=root user --name root --groups audio,video --password 'tizen' (Continued) tizen-3.0-mobile.ks
56
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/tizen3.0/armv7l/ --priority=1 repo --name=mobile-target-TM1 --baseurl= --ssl_verify=no --priority=2 repo --name=base_arm --baseurl= --ssl_verify=no --priority=2 tizen-3.0-mobile.ks
57
Kickstart File: Structure (3/4)
Required package groups List of packages to be included in image (Continued) %packages Generic Base bash connman coreutils default-ac-domains … Mobile Base capi-base-utils cert-svc-ui Deviced %end tizen-3.0-mobile.ks
58
Kickstart File: Structure (4/4)
Postscript Script that configures the initial condition of image (Continued) %post #!/bin/sh echo "#################### generic-base.post ####################" test ! -e /opt/var && mkdir -p /opt/var test -d /var && cp -arf /var/* /opt/var/ rm -rf /var ln -snf opt/var /var … %end tizen-3.0-mobile.ks
59
Creating Tizen v3.0 Platform Images
Download Kickstart File $ wget Create Tizen v3.0 Images $ gbs createimage --ks-file=tizen-3.0-mobile_ _mobile-wayland-armv7l-tm2.ks --tmpfs --ks-file=<path>: the path of kickstart file --tmpfs: accelerates making image process using ramdisk Results: <TIZEN-ROOT>/mic-output tizen-3.0-mobile-YYYYMMDDhhmm.tar.gz: Platform images rootfs.img, system-data.img, user.img, tizen-3.0-mobile-YYYYMMDDhhmm.packages: Package list tizen-3.0-mobile-YYYYMMDDhhmm.xml: Partition information manifest.json: Manifest file
60
Appendix: Git and Repo Cheatsheet (1/2)
Android developing document:
61
Appendix: Git and Repo Cheatsheet (2/2)
62
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
63
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/tizen3.0/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/tizen3.0/armv7l/ logs/fail/xf86-video-exynos /log.txt
64
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/tizen3.0/armv7l/ logs/fail/xf86-video-exynos /log.txt Problem: temporary files in BUILD-ROOT are in conflict each other. Solution: Add ‘--clean’ option on GBS. gbs build -A armv7l --include-all --clean build.sh
65
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 3.0: Mobile, Wearable, TV, IVI, Common Refer to
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.