1 58 Tizen Development Environment and Tizen v

  • Slides: 65
Download presentation
1 58 Tizen Development Environment and Tizen v 3. 0 Platform Build SKKU Embedded

1 58 Tizen Development Environment and Tizen v 3. 0 Platform Build SKKU Embedded Software Lab.

Contents 2 58 • Setting up Tizen Development Environment – Tizen Development Overview –

Contents 2 58 • Setting up Tizen Development Environment – Tizen Development Overview – Tizen Dev. Environment Setting – Tizen Source Code Management • Building a Tizen v 3. 0 Platform Project • Building Total Tizen v 3. 0 Platform Projects • Creating Tizen v 3. 0 Platform Image SKKU Embedded Software Lab.

3 58 1. Setting up Tizen Development Environment A. Tizen Development Overview B. Tizen

3 58 1. Setting up Tizen Development Environment A. Tizen Development Overview B. Tizen Dev. Environment Setting C. Tizen Source Code Management SKKU Embedded Software Lab.

Tizen Development Overview (1/2) • Hundreds of 'Open Source' Projects • Source code repository

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 SKKU Embedded Software Lab. 4 58

Tizen Development Overview (2/2) • Centralized Source Code Management – Tizen source code is

Tizen Development Overview (2/2) • 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 to perform build for git-based source code – All the repositories are managed on Tizen servers ; Gerrit and OBS. SKKU Embedded Software Lab. 5 58

Tizen Development Workflow (1/3) • From local coding to final release SKKU Embedded Software

Tizen Development Workflow (1/3) • From local coding to final release SKKU Embedded Software Lab. 6 58

Tizen Development Workflow (2/3) 7 1. Local works by Developers – It will be

Tizen Development Workflow (2/3) 7 1. Local works by Developers – It will be covered in “Section 1 -C. Tizen Source Code Management”. 1. Setting up Tizen development environment 2. Cloning the source code 3. Changing local source code and verifying it through local build using GBS 2. Submit & Review 1. Submission : Developer submits patches to review server for stakeholders to review 2. Review & Verify : Reviewers review and verify the patches 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. SKKU Embedded Software Lab. 58

Tizen Development Workflow (3/3) 8 3. Release – 1. 2. 3. 4. Tizen backend

Tizen Development Workflow (3/3) 8 3. Release – 1. 2. 3. 4. 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. SKKU Embedded Software Lab. 58

Tizen SCM Tools (1/2): GBS 9 58 • Git Build System • Command line

Tizen SCM Tools (1/2): GBS 9 58 • 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 SKKU Embedded Software Lab.

Tizen SCM Tools (2/2): MIC 10 • Meego Image Creator • Commandline tool to

Tizen SCM Tools (2/2): MIC 10 • 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) SKKU Embedded Software Lab. 58

Other SCM Tools (1/3): Git 11 • A revision control and source management tool

Other SCM Tools (1/3): Git 11 • A revision control and source management tool • Features – – – Free and open source(GNU GPL v 2) 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. SKKU Embedded Software Lab. 58

Other SCM Tools (2/3): RPM 12 • Red Hat Package Manager • A tool

Other SCM Tools (2/3): RPM 12 • Red Hat Package Manager • A tool tomanage 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. SKKU Embedded Software Lab. 58

Other SCM Tools (3/3): Repo 13 • Repository management tool built on top of

Other SCM Tools (3/3): Repo 13 • 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 SKKU Embedded Software Lab. 58

Centralized SCM System • Gerrit (review. tizen. org ) – A Web-based code review

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. SKKU Embedded Software Lab. 14 58

15 58 1. Setting up Tizen Development Environment A. Tizen Development Overview B. Tizen

15 58 1. Setting up Tizen Development Environment A. Tizen Development Overview B. Tizen Dev. Environment Setting C. Tizen Source Code Management SKKU Embedded Software Lab.

Tizen Dev. Environment Setting (1/10) • We will cover an environment based Ubuntu on.

Tizen Dev. Environment Setting (1/10) • We will cover an environment based Ubuntu on. 1. Git: Install and Configuration 1. Install a git package. 1. 2. $ sudo apt-get install git Git is automatically installed when gbs is intalled 2. Configure user information of git. • 1. 2. • This information will be used for committer information. $ git config --global user. name “Your name” $ git config --global user. email@address ex. – – $ git config --global user. name “Gyeonghwan Hong” $ git config --global user. email redcarrottt@gmail. com SKKU Embedded Software Lab. 16 58

Tizen Dev. Environment Setting (2/10) 17 58 2. Repo: Install and Configuration 1. Download

Tizen Dev. Environment Setting (2/10) 17 58 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. 2. $ gedit ~/. bashrc After adding below code to the last line, restart your shell. ~/. bashrc PATH=~/bin: ${PATH} SKKU Embedded Software Lab.

Tizen Dev. Environment Setting (3/10) 18 58 3. GBS, MIC: Install 1. Add Tizen

Tizen Dev. Environment Setting (3/10) 18 58 3. GBS, MIC: Install 1. Add Tizen development tool repository to APT repository list. 1. 2. $ sudo gedit /etc/apt/sources. list Add below code – Check your Ubuntu version. » $ cat /etc/issue /etc/apt/sources. list deb http: //download. tizen. org/tools/pre-release/Ubuntu_13. 10 / / 3. $ sudo apt-get update 2. Install packages of GBS, MIC. 1. $ sudo apt-get install gbs mic SKKU Embedded Software Lab.

Tizen Dev. Environment Setting (4/10) 19 58 You should have an access right to

Tizen Dev. Environment Setting (4/10) 19 58 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). SKKU Embedded Software Lab.

Tizen Dev. Environment Setting (5/10) 5. Review. Server: Configuration 1. $ gedit ~/. ssh/config

Tizen Dev. Environment Setting (5/10) 5. Review. Server: Configuration 1. $ gedit ~/. ssh/config – Enter your Gerrit ID. Host tizen Hostname review. tizen. org Identity. File ~/. ssh/id_rsa User Gerrit. ID Port 29418 Host review. tizen. org Hostname review. tizen. org Identity. File ~/. ssh/id_rsa User Gerrit. ID Port 29418 SKKU Embedded Software Lab. ~/. ssh/config 20 58

Tizen Dev. Environment Setting (6/10) 5. Review Server: Configuration (Cont’d) 2. Run “ssh-keygen” on

Tizen Dev. Environment Setting (6/10) 5. Review Server: Configuration (Cont’d) 2. Run “ssh-keygen” on a shell. 1. $ ssh-keygen – Press just enter about every question for using default values. – Finally, id_rsa. pubfiles will be created. » id_rsa: private key » id_rsa. pub: public key SKKU Embedded Software Lab. 21 58

Tizen Dev. Environment Setting (7/10) 22 58 5. Review Server: Configuration (Cont’d) 3. After

Tizen Dev. Environment Setting (7/10) 22 58 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. SKKU Embedded Software Lab.

Tizen Dev. Environment Setting (8/10) 5. Review Server: Configuration (Cont’d) 5. Display the contents

Tizen Dev. Environment Setting (8/10) 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’ SKKU Embedded Software Lab. 23 58

Tizen Dev. Environment Setting (9/10) 24 5. Review Server: Configuration (Cont’d) 7. Test ssh

Tizen Dev. Environment Setting (9/10) 24 5. Review Server: Configuration (Cont’d) 7. Test ssh server connection 1. 2. • $ ssh tizen $ ssh review. tizen. org If the connection is successful, below message will be displayed. SKKU Embedded Software Lab. 58

Tizen Dev. Environment Setting (10/10) 25 58 6. Make a GBS configuration file (~/.

Tizen Dev. Environment Setting (10/10) 25 58 6. Make a GBS configuration file (~/. gbs. conf) – Without this file, Tizen source code cannot be built. 1. $ gedit ~/. gbs. conf • Check whether url of repo. tizen 3. 0_base and repo. tizen 3. 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. tizen 3. 0 [profile. tizen 3. 0] repos=repo. tizen 3. 0_base , repo. tizen 3. 0_mobile [repo. tizen 3. 0_base] url=http: //download. tizen. org/releases/weekly/tizen/3. 0 -base/tizen-3. 0 base_20161223. 2/repos/arm/packages/ [repo. tizen 3. 0_mobile] url=http: //download. tizen. org/releases/weekly/tizen/3. 0 -mobile/tizen-3. 0 SKKU Embedded Software Lab. mobile_20170104. 1/repos/arm-wayland/packages/

26 58 1. Setting up Tizen Development Environment A. Tizen Development Overview B. Tizen

26 58 1. Setting up Tizen Development Environment A. Tizen Development Overview B. Tizen Dev. Environment Setting C. Tizen Source. Code Management SKKU Embedded Software Lab.

Tizen Local Work Flow • All Process before submission 1. Git: manages source code

Tizen Local Work Flow • All Process before submission 1. Git: manages source code versions 2. GBS: builds source code of git repository → makes package file(RPM) 3. Install package file on target board SKKU Embedded Software Lab. 27 58

Git: Key Concepts • Working directory – Source code in work – “add”command: adds

Git: Key Concepts • 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 contentaddressable objects identifiable by hash value(SHA-1). SKKU Embedded Software Lab. 28 58

Version Management (1/2) • Add a source code, ‘hello. cpp’ 1. Add hello. c

Version Management (1/2) • 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. $ git add --all 2. Make a new version 1. $ git commit -m “commit message” • Display staging area’s status 1. $ git status SKKU Embedded Software Lab. 29 58

Version Management (2/2) 30 58 • Display the commit log 1. $ git log

Version Management (2/2) 30 58 • Display the commit log 1. $ git log – Each commit’s hash value, author information, date, message commit 783 c 82 ff 64 eda 9 f 03401834 de 906 eca 77 d 01 f 691 Author: Gyeonghwan Hong <redcarrottt@gmail. com> Date: Mon Sep 22 10: 37: 44 2014 +0900 2 nd version commit: hello. c is added commit 712943 bb 31 bf 85430 e 1 a 027 abe 197 e 5 b 88 a 26110 Author: Gyeonghwan Hong <redcarrottt@gmail. com> Date: Thu Aug 28 12: 08: 17 2014 +0900 1 st version commit: hello. h is added • Return to a previous version 1. $ git checkout <commit’s hash value> – ex. Return to “ 1 st version commit” $ git checkout 712943 bb 31 bf 85430 e 1 a 027 abe 197 e 5 b 88 a 26110 SKKU Embedded Software Lab.

Local & Remote Repository (1/2) • “Commit” – Make a new version on local

Local & Remote Repository (1/2) • “Commit” – Make a new version on local repository • “Push” – Uploadcommits in local repository to remote repository • “Pull” – Download commits in remote repository to local repository SKKU Embedded Software Lab. 31 58

Local & Remote Repository (2/2) • Upload to remote repository 1. $ git push

Local & Remote Repository (2/2) • Upload to remote repository 1. $ git push <remote name> <remote branch> – ex. $ git push origin master • Download from remote repository 1. $ git pull <remote name> <remote branch> – ex. $ git pull originmaster SKKU Embedded Software Lab. 32 58

Branch Management (1/3) 33 • Check the branch list of local repository 1. $

Branch Management (1/3) 33 • 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 – 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> SKKU Embedded Software Lab. 58

Branch Management (2/3) • Develop a new feature by making a new branch 1.

Branch Management (2/3) • Develop a new feature by making a new branch 1. Make a new branch ‘feature_x’ 1. $ git branch feature_x 2. Checkout to the new branch 2. $ git checkout feature_x 3. Edit and commit source code 4. Merge the ‘feature_x’ branch to original branch 1. $ git checkout master 2. $ git merge feature_x SKKU Embedded Software Lab. 34 58

Branch Management (3/3) 35 • Conflict – When merging feature_y branch to master branch,

Branch Management (3/3) 35 • 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/v 2/Git-Branching-Basic-Branching-and. Merging SKKU Embedded Software Lab. 58

36 58 2. Building a Tizen v 3. 0 Platform Project SKKU Embedded Software

36 58 2. Building a Tizen v 3. 0 Platform Project SKKU Embedded Software Lab.

Tizen v 3. 0 Platform Project Build Process (1/2) 37 • Assume that Tizen

Tizen v 3. 0 Platform Project Build Process (1/2) 37 • Assume that Tizen v 3. 0 is running on target board • Example: build and install package A SKKU Embedded Software Lab. 58

Tizen v 3. 0 Platform Project Build Process (2/2) 38 1. Clone the Source

Tizen v 3. 0 Platform Project Build Process (2/2) 38 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. SKKU Embedded Software Lab. 58

Required Files in Repository (1/2) • Tizen v 3. 0 projectrepository requires following files

Required Files in Repository (1/2) • Tizen v 3. 0 projectrepository requires following files – Red files are required at least. AUTHORS: Author list LICENSE: License information CMake. Lists. 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> • CMake. Lists. txt • include • Header files • src • Source code files • <sub-directory 2>, <sub-directory 3>, … • • SKKU Embedded Software Lab. 39 58

Required Files in Repository (2/2) • ex. Remote Key Framework Service Project (Link) AUTHORS:

Required Files in Repository (2/2) • ex. Remote Key Framework Service Project (Link) AUTHORS: Author list LICENSE: License information CMake. Lists. 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 • CMake. Lists. txt • include • common. h: Common header file • src • main. cpp: Main source code • common. cpp: Source code of dlog connector • • • SKKU Embedded Software Lab. 40 58

Clone the Source Code of Tizen v 3. 0 Project (1/2) 41 58 1.

Clone the Source Code of Tizen v 3. 0 Project (1/2) 41 58 1. Log in Tizen review serverreview. 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 repository 1. $ git clone ssh: //username@review. tizen. org: 29418/project-name SKKU Embedded Software Lab.

Clone the Source Code of Tizen v 3. 0 Project(2/2) 42 • Tizen project

Clone the Source Code of Tizen v 3. 0 Project(2/2) 42 • Tizen project source code has several branches by release version. 5. Check branches 1. $ git branch --remote • ex. origin/1. 0_post origin/2. 0 alpha origin/HEAD -> origin/master origin/tizen_2. 1 origin/tizen_2. 2 origin/tizen_2. 3 origin/tizen_3. 0 6. Change branch to target release version 1. $ git checkout <target branch> • ex. git checkout origin/tizen_3. 0 SKKU Embedded Software Lab. 58

Build the Tizenv 3. 0 Project (1/3) 43 • Build the most recent version

Build the Tizenv 3. 0 Project (1/3) 43 • Build the most recent version in Git repository – By default, GBS builds the source code of most recent version. 1. Move to the directory of repository. 2. $ gbs build -A armv 7 l – -A <architecture type>: i 586, x 86_64, armv 7 l SKKU Embedded Software Lab. 58

Build the Tizenv 3. 0 Project (2/3) • Build the working directory – Use

Build the Tizenv 3. 0 Project (2/3) • 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 armv 7 l --include-all – --include-all: option for building working directory SKKU Embedded Software Lab. 44 58

Build the Tizenv 3. 0 Project (3/3) 45 58 • GBS downloads dependent packages

Build the Tizenv 3. 0 Project (3/3) 45 58 • GBS downloads dependent packages from Tizen download server on demand. – ex. wrt(Web Runtime) package depends on ewebkit 2(Web. Kit. EFL) package, so ewebkit 2 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-1. 2. 1. armv 7 l. rpm – Located in: ~/GBS-ROOT/local/repos/tizen 3. 0/armv 7 l/RPMS/ SKKU Embedded Software Lab.

Install the Packages (1/2) • Install package files(*. rpm) on target board – Send

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 SKKU Embedded Software Lab. 46 58

Install the Packages (2/2) 1. Connect to ODROID-U 3 via USB – – How

Install the Packages (2/2) 1. Connect to ODROID-U 3 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 file> / 4. Install the package 1. $ sdb shell rpm -ivh --nodeps --force <package file> 5. Reboot your target board 1. $ sdb shell sync; sdb shell reboot -f SKKU Embedded Software Lab. 47 58

48 58 3. Building Total Tizen v 3. 0 Platform Projects SKKU Embedded Software

48 58 3. Building Total Tizen v 3. 0 Platform Projects SKKU Embedded Software Lab.

Cloning Total Source Code of Tizen 49 1. Make and move to Tizen source

Cloning Total Source Code of Tizen 49 1. Make and move to Tizen source code directory 1. $ mkdir tizen-platform; cd tizen-platform 2. Set the path of download server. 1. Initialize the repository 1. $ repo init -u https: //git. tizen. org/cgit/scm/manifest -b <branch name> -m <manifest file name> 2. Example) $ repo init -u https: //git. tizen. org/cgit/scm/manifest -b tizen -m mobile. xml 2. Replace manifest file with specific snapshot manifest file 1. $ curl <Snapshot_Manifest_URL> >. repo/manifests/common/projects. xml 2. Example) $ curl http: //download. tizen. org/releases/weekly/tizen/3. 0 mobile/tizen-3. 0 -mobile_20170104. 1/builddata/manifest/tizen-3. 0 mobile_20170104. 1_armwayland. xml>. repo/manifests/common/projects. xml 3. Clone source code(Using 8 threads) 1. $ repo sync -j 8 SKKU Embedded Software Lab. 58

Edit GBS Configuration 50 58 • Need only repo. tizen 3. 0_base in GBS

Edit GBS Configuration 50 58 • Need only repo. tizen 3. 0_base in GBS configuration file. 1. $ gedit ~/tizen-platform/. gbs. conf [general] tmpdir=/var/tmp/ profile=profile. tizen 3. 0 [profile. tizen 3. 0] repos=repo. tizen 3. 0_base [repo. tizen 3. 0_base] url=http: //download. tizen. org/releases/weekly/tizen/3. 0 -base/tizen-3. 0 base_20161223. 2/repos/arm/packages/ [repo. tizen 3. 0_mobile] # Don’t need this repo url=http: //download. tizen. org/releases/weekly/tizen/3. 0 -mobile/tizen-3. 0 mobile_20170104. 1/repos/arm-wayland/packages/ SKKU Embedded Software Lab.

Building Total Platform Packages 51 58 1. Make a build script (build. sh) 1.

Building Total Platform Packages 51 58 1. Make a build script (build. sh) 1. $ gedit build. sh ~/tizen-platform/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, bzip 2 -libs, c-ares, cmake, coreutils, diffutils, eglibc, elfutils-libelf, elfutilslibs, 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, rpmlibs, rpm-build, sed, sqlite, tar, xz-libs, binutils, gcc, filesystem, aul, libmmsound, libtool, syspopup, notification, libva, libzypp-bindings, rpm, web-ui-fw, pythondoc, rpm, perl “ gbs build -A armv 7 l --threads=8 --clean-once --include-all --exclude=${skip_pkgs} 2. $ sudo chmod +x build. sh 2. Run the build script 1. $. /build. sh SKKU Embedded Software Lab.

52 58 4. Creating Tizen v 3. 0 Platform Image SKKU Embedded Software Lab.

52 58 4. Creating Tizen v 3. 0 Platform Image SKKU Embedded Software Lab.

Process of Creating Tizen v 3. 0 Platform Images • MIC creates images using

Process of Creating Tizen v 3. 0 Platform Images • MIC creates images using Tizen v 3. 0 packages. – MIC downloads prebuilt packages from download server, which do not exist in local repository. • Requirements – Tizen packages • in local • in download server – Kickstart file SKKU Embedded Software Lab. 53 58

Kickstart File 54 58 • A file that defines how to create image •

Kickstart File 54 58 • 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 SKKU Embedded Software Lab.

Kickstart File: Structure (1/4) 55 58 tizen-3. 0 -mobile. ks #Default locale, keyboard language,

Kickstart File: Structure (1/4) 55 58 tizen-3. 0 -mobile. ks #Default locale, keyboard language, and timezone lang en_US. UTF-8 keyboard us timezone --utc Asia/Seoul #Partition configurations part / --size=2000 --ondisk mmcblk 0 p --fstype=ext 4 --label=rootfs --extoptions="-J size=16" part /opt/ --size=1000 --ondisk mmcblk 0 p --fstype=ext 4 --label=system-data --extoptions="-m 0" part /opt/usr --size=2000 --ondisk mmcblk 0 p --fstype=ext 4 --label=user --extoptions="-m 0" part /boot/kernel/mod_tizen_tm 1/lib/modules --size=12 --ondisk mmcblk 0 p --fstype=ext 4 -label=modules #Root user and default user to login rootpw tizen xconfig --startxonbootloader --timeout=3 --append="rw vga=current splash rootwait rootfstype=ext 4 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) SKKU Embedded Software Lab.

Kickstart File: Structure (2/4) 56 58 • Repository path – Path of repository that

Kickstart File: Structure (2/4) 56 58 • Repository path – Path of repository that contains Tizen packages – Multiple path: local path, download server … – Priority is tunable. tizen-3. 0 -mobile. ks (Continued) # Modify the local path as your environment. repo --name=local-packages --baseurl=file: ///home/user/GBSROOT/local/repos/tizen 3. 0/armv 7 l/ --priority=1 repo --name=mobile-target-TM 1 --baseurl=http: //download. tizen. org/snapshots/tizen/3. 0 mobile/tizen-3. 0 -mobile_20170509. 1/repos/target-TM 1/packages/ --ssl_verify=no --priority=2 repo --name=base_arm --baseurl=http: //download. tizen. org/snapshots/tizen/3. 0 base/latest/repos/arm/packages/ --ssl_verify=no --priority=2 (Continued) SKKU Embedded Software Lab.

Kickstart File: Structure (3/4) 57 58 • Required package groups – List of packages

Kickstart File: Structure (3/4) 57 58 • Required package groups – List of packages to be included in image tizen-3. 0 -mobile. ks (Continued) %packages # @ Generic Base bash connman coreutils default-ac-domains … # @ Mobile Base capi-base-utils cert-svc-ui Deviced … %end (Continued) SKKU Embedded Software Lab.

Kickstart File: Structure (4/4) 58 58 • Postscript – Script that configures the initial

Kickstart File: Structure (4/4) 58 58 • 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 … %end SKKU Embedded Software Lab. tizen-3. 0 -mobile. ks

Creating Tizen v 3. 0 Platform Images 59 1. Download Kickstart File 1. $

Creating Tizen v 3. 0 Platform Images 59 1. Download Kickstart File 1. $ wget http: //download. tizen. org/snapshots/tizen/3. 0 -mobile/tizen 3. 0 -mobile_20170516. 1/images/arm-wayland/mobile-waylandarmv 7 l-tm 2/tizen-3. 0 -mobile_20170516. 1_mobile-wayland-armv 7 ltm 2. ks 2. Create Tizenv 3. 0 Images 1. $ gbs createimage --ks-file=tizen-3. 0 -mobile_20170516. 1_mobilewayland-armv 7 l-tm 2. ks --tmpfs • --ks-file=<path>: the path of kickstart file • --tmpfs: accelerates making image process using ramdisk 3. Results: <TIZEN-ROOT>/ mic-output 1. tizen-3. 0 -mobile-YYYYMMDDhhmm. tar. gz : Platform images 1. rootfs. img, system-data. img, user. img, 2. tizen-3. 0 -mobile-YYYYMMDDhhmm. packages: Package list 3. tizen-3. 0 -mobile-YYYYMMDDhhmm. xml: Partition information 4. manifest. json: Manifest file SKKU Embedded Software Lab. 58

Appendix: Git and Repo Cheatsheet (1/2) • Android developing document: • https: //source. android.

Appendix: Git and Repo Cheatsheet (1/2) • Android developing document: • https: //source. android. com/source/developing. html SKKU Embedded Software Lab. 60 58

Appendix: Git and Repo Cheatsheet (2/2) SKKU Embedded Software Lab. 61 58

Appendix: Git and Repo Cheatsheet (2/2) SKKU Embedded Software Lab. 61 58

Appendix: Locale error in build phase • Problem – GBS can run on only

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 SKKU Embedded Software Lab. 62 58

Appendix: GBS Trouble-shooting (1/2) 63 • When build error is occured, refer to the

Appendix: GBS Trouble-shooting (1/2) 63 • When build error is occured, refer to the error log. Example info: *** Build Status Summary *** === the following packages failed to build due to rpmbuild issue (1) === xf 86 -video-exynos: /home/user/GBSROOT/local/repos/tizen 3. 0/armv 7 l/logs/fail/xf 86 -video-exynos-1. 0. 0 -1/log. txt • You can find the problem on the error log. /home/user/GBS-ROOT/local/repos/tizen 3. 0/armv 7 l/ logs/fail/xf 86 -video-exynos-1. 0. 0 -1/log. txt [ 139 s] error: db 4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139 s] error: cannot open Packages index using db 4 - (-30971) [ 139 s] error: cannot open Packages database in /var/lib/rpm [ 139 s] error: db 4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139 s] error: cannot open Packages database in /var/lib/rpm SKKU Embedded Software Lab. 58

Appendix: GBSTrouble-shooting (2/2) 64 58 • RPM DB 4 error /home/user/GBS-ROOT/local/repos/tizen 3. 0/armv 7

Appendix: GBSTrouble-shooting (2/2) 64 58 • RPM DB 4 error /home/user/GBS-ROOT/local/repos/tizen 3. 0/armv 7 l/ logs/fail/xf 86 -video-exynos-1. 0. 0 -1/log. txt [ 139 s] error: db 4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139 s] error: cannot open Packages index using db 4 - (-30971) [ 139 s] error: cannot open Packages database in /var/lib/rpm [ 139 s] error: db 4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139 s] error: cannot open Packages database in /var/lib/rpm – Problem: temporary files in BUILD-ROOT are in conflict each other. – Solution: Add ‘--clean’ option on GBS. gbs build -A armv 7 l --include-all --clean SKKU Embedded Software Lab. build. sh

Appendix: Profile 65 58 • A file that defines characteristics by target device Basic

Appendix: Profile 65 58 • 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, Vo. IP, Bluetooth, GPS, WPS, Push Peripheral devices : Camera, FM Radio, Keyboard, Microphone, Multi-point touch, Screen, Sensors, USB, Vision – Other features : Database encryption, Open. GL configuration, Shell, Speech, OSP-compatible – – • Different profile is required on different target. – Official targets of Tizen 3. 0: Mobile, Wearable, TV, IVI, Common • Refer tohttps: //www. tizen. org/feature SKKU Embedded Software Lab.