Скачать презентацию 1 75 Development Environment and Platform Build SKKU Скачать презентацию 1 75 Development Environment and Platform Build SKKU

e519e99db79eea455fc33c45e162c741.ppt

  • Количество слайдов: 80

1 75 Development Environment and Platform Build SKKU Embedded Software Lab. 1 75 Development Environment and Platform Build SKKU Embedded Software Lab.

Contents 2 75 • Tizen Development Environment – Tizen Development Overview – Tizen Source Contents 2 75 • Tizen Development Environment – Tizen Development Overview – Tizen Source Code Management – Installation • Building Tizen Platform • Tizen Platform IDE • Appendices – Trouble-shootings SKKU Embedded Software Lab.

3 75 1. Tizen Development Environment A. Tizen Development Overview B. Tizen Source Code 3 75 1. Tizen Development Environment A. Tizen Development Overview B. Tizen Source Code Management C. Installation SKKU Embedded Software Lab.

Tizen Development Overview 4 75 • Hundreds of packages – Tizen is composed of Tizen Development Overview 4 75 • Hundreds of packages – Tizen is composed of hundreds of packages. – Each package has its source code repository. – Git: Tizen source code is managed in distributed manner. • Centralized Source Code Management – Tizen source code is reviewed and submitted in centralized manner. – GBS(Git Build System): a tool for centralized source code management – All the repositories are managed on Tizen servers ; Gerrit and OBS. • Packaging and Making images – Packages are managed by RPM, images are made by MIC. SKKU Embedded Software Lab.

Tizen Development Workflow (1/3) SKKU Embedded Software Lab. 5 75 Tizen Development Workflow (1/3) SKKU Embedded Software Lab. 5 75

Tizen Development Workflow (2/3) 1. Local works by Developers 1. Setting up Tizen development Tizen Development Workflow (2/3) 1. Local works by Developers 1. Setting up Tizen development environment 2. Cloning the source code 3. Changing and verifying local source code through local build 2. Review 1. Submission : Developer submits patches to review server for stakeholders to review 2. 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. SKKU Embedded Software Lab. 6 75

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

SCM Tools (1/3): Git 8 • A revision control and source management tool • SCM Tools (1/3): Git 8 • 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. 75

SCM Tools (2/3): Repo 9 75 • Repository management tool built top of Git SCM Tools (2/3): Repo 9 75 • Repository management tool built top of Git on – 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.

SCM Tools (3/3): GBS 10 75 • Git Build System • A developer command SCM Tools (3/3): GBS 10 75 • 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) SKKU Embedded Software Lab.

Centralized SCM System • Gerrit ( review. tizen. org ) – A Web-based code 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. 11 75

Packaging Tools: RPM and MIC 12 75 • RPM(Red Hat Package Manager) – A Packaging Tools: RPM and MIC 12 75 • 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) SKKU Embedded Software Lab.

13 75 1. Tizen Development Environment A. Tizen Development Overview B. Tizen Source Code 13 75 1. Tizen Development Environment A. Tizen Development Overview B. Tizen Source Code Management C. Installation SKKU Embedded Software Lab.

Tizen Source Code Workflow 1. Git: manages source code versions 2. GBS: builds source Tizen Source Code Workflow 1. Git: manages source code versions 2. GBS: builds source code of git repository → makes package file(RPM) 3. Install package file on ODROID-U 3 SKKU Embedded Software Lab. 14 75

Git: Key Concepts • Working directory – Source code in work – “add” command: 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. SKKU Embedded Software Lab. 15 75

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. 16 75

Version Management (2/2) 17 75 • Display the commit log 1. $ git log Version Management (2/2) 17 75 • 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 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 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 – ex. 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” – Upload commits in local repository to remote repository • “Pull” – Download commits in remote repository to local repository SKKU Embedded Software Lab. 18 75

Local & Remote Repository (2/2) • Upload to remote repository 1. $ git push Local & Remote Repository (2/2) • Upload to remote repository 1. $ git push – ex. $ git push origin master • Download from remote repository 1. $ git pull SKKU Embedded Software Lab. 19 75

Branch Management (1/3) • Check the branch list of local repository 1. $ git Branch Management (1/3) • 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 – ex. $ git checkout feature_x SKKU Embedded Software Lab. 20 75

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. $ git checkout feature_x 2. Edit and commit source code 3. Merge ‘feature_x’ branch to original branch 1. $ git checkout master 2. $ git merge feature_x SKKU Embedded Software Lab. 21 75

Branch Management (3/3) 22 • Conflict – When merging feature_y branch to master branch, Branch Management (3/3) 22 • 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. 75

23 75 1. Tizen Development Environment A. Tizen Development Overview B. Tizen Source Code 23 75 1. Tizen Development Environment A. Tizen Development Overview B. Tizen Source Code Management C. Installation SKKU Embedded Software Lab.

Tizen Dev. Environment Install (1/11) 1. Git: Install and Configuration 1. Install a git Tizen Dev. Environment Install (1/11) 1. Git: Install and Configuration 1. Install a git package. 1. $ sudo apt-get install git 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 protected] ex. – – $ git config --global user. name “Gyeonghwan Hong” $ git config --global user. email [email protected] com SKKU Embedded Software Lab. 24 75

Tizen Dev. Environment Install (2/11) 25 75 2. Repo: Install and Configuration 1. Download Tizen Dev. Environment Install (2/11) 25 75 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 Install (3/11) 26 75 3. GBS, MIC: Install 1. Add Tizen Tizen Dev. Environment Install (3/11) 26 75 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 1. 2. XX : Ubuntu’s major version (ex. 12, 13, 14) YY : Ubuntu’s minor version (ex. 04, 10) /etc/apt/sources. list deb http: //download. tizen. org/tools/latest-release/Ubuntu_XX. YY / 3. $ sudo apt-get update 2. Install packages of GBS, MIC. 1. sudo apt-get install gbs mic SKKU Embedded Software Lab.

Tizen Dev. Environment Install (4/11) 27 75 You should have an access right to Tizen Dev. Environment Install (4/11) 27 75 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 Install (5/11) 5. Review. Server: Configuration 1. $ gedit ~/. ssh/config Tizen Dev. Environment Install (5/11) 5. Review. Server: Configuration 1. $ gedit ~/. ssh/config – Enter your username. Host tizen Hostname review. tizen. org Identity. File ~/. ssh/id_rsa User username Port 29418 Host review. tizen. org Hostname review. tizen. org Identity. File ~/. ssh/id_rsa User username Port 29418 SKKU Embedded Software Lab. ~/. ssh/config 28 75

Tizen Dev. Environment Install (6/11) 5. Review Server: Configuration (Cont’d) 2. Run “ssh-keygen” on Tizen Dev. Environment Install (6/11) 5. Review Server: Configuration (Cont’d) 2. Run “ssh-keygen” on a shell. 1. $ ssh-keygen – Press enter about every question for using default values. – In result, id_rsa. pub files will be created. » id_rsa : private key » id_rsa. pub : public key SKKU Embedded Software Lab. 29 75

Tizen Dev. Environment Install (7/11) 30 75 5. Review Server: Configuration (Cont’d) 3. After Tizen Dev. Environment Install (7/11) 30 75 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 Install (8/11) 5. Review Server: Configuration (Cont’d) 5. Display the contents Tizen Dev. Environment Install (8/11) 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. 31 75

Tizen Dev. Environment Install (9/11) 32 5. Review Server: Configuration (Cont’d) 7. Test ssh Tizen Dev. Environment Install (9/11) 32 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. 75

Tizen Dev. Environment Install (10/11) 33 • Tizen source code is built by pre-built Tizen Dev. Environment Install (10/11) 33 • Tizen source code is built by pre-built toolchains. 6. Clone Pre-built Toolchain Packages 1. Clone ARM toolchain 1. 2. 3. 4. $ git clone ssh: //[email protected] tizen. org: 29418/pre-built/toolchainarm pre-built/toolchain-arm $ cd pre-built/toolchain-arm $ git checkout origin/tizen_2. 2 $ cd - 2. Clone x 86 toolchain 1. 2. 3. 4. $ git clone ssh: //[email protected] tizen. org: 29418/ pre-built/toolchainx 86 pre-built/toolchain-x 86 $ git checkout origin/tizen_2. 2 $ cd SKKU Embedded Software Lab. 75

Tizen Dev. Environment Install (11/11) 7. Make a GBS configuration file (~/. gbs. conf) Tizen Dev. Environment Install (11/11) 7. Make a GBS configuration file (~/. gbs. conf) – Without this file, Tizen source code cannot be built. 1. $ gedit ~/. gbs. conf [general] tmpdir=/var/tmp/ profile=profile. tizen 2. 2 work_dir=/home/user [repo. tizen 2. 2] url=http: //download. tizen. org/releases/2. 2/tizen-2. 2/ [repo. tizen 2. 2_arm] url=${work_dir}/pre-built/toolchain-arm/ [repo. tizen 2. 2_x 86] url=${work_dir}/pre-built/toolchain-x 86/ [profile. tizen 2. 2] repos=repo. tizen 2. 2_arm, repo. tizen 2. 2_x 86, repo. tizen 2. 2 SKKU Embedded Software Lab. 34 75

35 75 2. Building Single Tizen Package SKKU Embedded Software Lab. 35 75 2. Building Single Tizen Package SKKU Embedded Software Lab.

Tizen Build Process SKKU Embedded Software Lab. 36 75 Tizen Build Process SKKU Embedded Software Lab. 36 75

How to Build and Apply Tizen Package 37 • Building Single Tizen Package – How to Build and Apply Tizen Package 37 • Building Single Tizen Package – Maintain source code of single package. – If other packages are required in build phase, download them from Tizen download server. – There are two ways to apply single package. • Installing the package on target board in force • Making and flashing Tizen platform images – Build time and package size are minimized. • Building Tizen Platform – Maintain total source code of Tizen platform. – Build time is too long and the size of packages is too large. SKKU Embedded Software Lab. 75

Building Single Tizen Package • Build time and package size are minimized. SKKU Embedded Building Single Tizen Package • Build time and package size are minimized. SKKU Embedded Software Lab. 38 75

Building Tizen Platform 39 75 • Build time is too long and the size Building Tizen Platform 39 75 • Build time is too long and the size of packages is too large. SKKU Embedded Software Lab.

Required Files in Repository (1/2) • Tizen project repository requires following files – Red Required Files in Repository (1/2) • Tizen project repository 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 . manifest : SMACK manifest file packaging . manifest : SMACK manifest file . spec : RPM package specification file CMake. Lists. txt include • Header files • src • Source code files • , , … • • • SKKU Embedded Software Lab. 40 75

Required Files in Repository (2/2) • ex. Remote Key Framework Service Project ) (Link 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. 41 75

How to Clone Existing Repository (1/2) 1. Log in Tizen review server ( review. How to Clone Existing Repository (1/2) 1. Log in Tizen review server ( review. tizen. org ) 2. Enter into “Projects” “List” → 3. Find a repository that you want to clone – Be careful: Packages in Tizen 2. 2 and 3. 0 are managed in different way, so multiple packages will be displayed on the result. 4. Clone the repository 1. $ git clone ssh: //[email protected] tizen. org : 29418/project-name SKKU Embedded Software Lab. 42 75

How to Clone Existing Repository (2/2) • Tizen package repository several branches by has How to Clone Existing Repository (2/2) • Tizen package repository several branches by has 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. 0 origin/tizen_2. 1 origin/tizen_2. 2 origin/tizen_2. 3 6. Change branch to target release version 1. $ git checkout • ex. git checkout origin/tizen_2. 2 SKKU Embedded Software Lab. 43 75

How to Build Single Tizen Package (1/3) 44 • Build the most recent version How to Build Single Tizen Package (1/3) 44 • 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 armv 7 l – -A : x 86, armv 7 l SKKU Embedded Software Lab. 75

How to Build Single Tizen Package (2/3) • Build the working directory – Use How to Build Single Tizen Package (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. 45 75

How to Build Single Tizen Package (3/3) • Other GBS Options – --threads <# How to Build Single Tizen Package (3/3) • Other GBS Options – --threads <# of threads>: the number of build threads – --clean: initializes the GBS build root – --exclude=: the list of packages to be excluded • Build Result – Name: package_name-version. arch. rpm • ex. remote-key-framework-1. 2. 1. armv 7 l. rpm – Located in: ~/GBS-ROOT/local/repos/tizen 2. 2/armv 7 l/RPMS/ SKKU Embedded Software Lab. 46 75

How to Install Tizen Package (1/2) • Install package files(*. rpm) on target board How to Install Tizen Package (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. 47 75

How to Install Tizen Package (2/2) 1. Connect to ODROID-U 3 USB via – How to Install Tizen Package (2/2) 1. Connect to ODROID-U 3 USB via – – How to check connection: $ sdb devices Caution: If you are using VMWare, check the connection of ‘removable device’ 2. Enter to SDB root mode 1. $ sdb root on 3. Send package file to target board through SDB 1. $ sdb push package_name-version. arch. rpm / 4. Install the package 1. $ sdb shell rpm -ivh --nodeps --force package_nameversion. arch. rpm 5. Reboot your target board 1. $ adb shell sync; sdb shell reboot -f SKKU Embedded Software Lab. 48 75

49 75 4. Building Tizen Platform SKKU Embedded Software Lab. 49 75 4. Building Tizen Platform SKKU Embedded Software Lab.

Overview on Building Tizen Platform • Requirements – – Total source code of Tizen Overview on Building Tizen Platform • Requirements – – Total source code of Tizen Profile for ODROID-U 3 Kickstart file for ODROID-U 3 Package group pattern for ODROID-U 3 • Entire Process – Cloning total Tizen platform source code – Setting up for target board • Profile • Kickstart file • Package group pattern – Building – Making Images SKKU Embedded Software Lab. 50 75

Total Source Code of Tizen 51 75 • Total source code contains below directories. Total Source Code of Tizen 51 75 • Total source code contains below directories. (Tizen 2. 2) – – – – adaptation apps external framework kernel meta mic-output pkgs pre-built profile scm sdk toolchains tools SKKU Embedded Software Lab.

Profile 52 75 • A file that defines characteristics by target device Basic features Profile 52 75 • 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 by target board. – Official target of Tizen 2. 2: RD-210, RD-PQ, Emulator – ODROID-U 3 is not supported officially → New profile is required • Refer tohttps: //www. tizen. org/feature SKKU Embedded Software Lab.

ODROID-U 3 Profile • 53 Components – – – LICENSE. APLv 2: Apache License ODROID-U 3 Profile • 53 Components – – – LICENSE. APLv 2: Apache License v 2 NOTICE. APLv 2 model-config. manifest: Manifest file required for RPM • – model-config. xml • – http: //wiki. tizen. org/wiki/Security/Application_installation_and_Ma nifest ODROID-U 3 Profile packaging/model-config-odroid-u 3. spec • RPM package specification SKKU Embedded Software Lab. 75

ODROID-U 3 Profile: Structure 54 75 ~/tizen-platform/profile/mobile/model/config-odroid-u 3/ model-config. xml <? xml version= ODROID-U 3 Profile: Structure 54 75 ~/tizen-platform/profile/mobile/model/config-odroid-u 3/ model-config. xml ODROID-U 3 Tizen 2. 2 exynos 4412 false false (중략) SKKU Embedded Software Lab.

Kickstart File 55 75 • A file that defines how to make image of Kickstart File 55 75 • 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 SKKU Embedded Software Lab.

Kickstart File: Structure (1/4) 56 75 ~/tizen-platform/ODROID-U 3. ks #Default locale, keyboard language, and Kickstart File: Structure (1/4) 56 75 ~/tizen-platform/ODROID-U 3. ks #Default locale, keyboard language, and timezone lang en_US. UTF-8 keyboard us timezone --utc America/Los_Angeles #Partition configurations # ROOT fs partition part / --size=3000 --ondisk mmcblk 0 p --fstype=ext 4 --label=platform # DATA partition part /opt/ --size=3000 --ondisk mmcblk 0 p --fstype=ext 4 --label=data # UMS partition part /opt/usr/ --size=3000 --ondisk mmcblk 0 p --fstype=ext 4 --label=ums #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) SKKU Embedded Software Lab.

Kickstart File: Structure (2/4) 57 75 • Repository path – Path of repository that Kickstart File: Structure (2/4) 57 75 • Repository path – Path of repository that contains Tizen packages – Multiple path: local path, download server … – Priority is tunable. ~/tizen-platform/ODROID-U 3. ks (Continued) # Modify the local path as your environment. repo --name=local --baseurl=file: ///home/user/GBS-ROOT/local/repos/tizen 2. 2/armv 7 l/ -priority=1 repo --name=Tizen-main -baseurl=https: //download. tizen. org/snapshots/2. 2/common/latest/repos/tizenmain/armv 7 l/packages/ --save --ssl_verify=no --priority=99 repo --name=Tizen-baseurl=https: //download. tizen. org/snapshots/2. 2/common/latest/repos/tizenbase/armv 7 l/packages/ --ssl_verify=no --priority=99 (Continued) SKKU Embedded Software Lab.

Kickstart File: Structure (3/4) 58 • Required package groups – List of package groups Kickstart File: Structure (3/4) 58 • Required package groups – List of package groups to be included in image • Pre-required packages – List of package groups to be included in image ~/tizen-platform/ODROID-U 3. ks (Continued) %packages @common @apps-core @osp @target-common @target-odroid-u 3 %end %prepackages eglibc systemd busybox libacl libcap dbus-libs libgcc libudev libattr default-files-tizen openssl libprivilege-control-conf security-server libdlog libsecurity-server-client sqlite tzdata-slp vconf tizen-coreutils rpm-security-plugin %end (Continued) SKKU Embedded Software Lab. 75

Kickstart File: Structure (4/4) 59 75 • Postscript – Script that configures the initial Kickstart File: Structure (4/4) 59 75 • Postscript – Script that configures the initial condition of image (Continued) %post echo 'kickstart post script start' if [ -d /etc/init. d ]; then cp /etc/init. d/* /etc/rc. d/init. d/ -rdf fi rm -rf /etc/init. d* ln -sf /etc/rc. d/init. d /etc/init. d ~/tizen-platform/ODROID-U 3. ks rm -rf /etc/localtime ln -sf /opt/etc/localtime (중략) %end SKKU Embedded Software Lab.

ODROID-U 3 Package Group Pattern (1/2) • 60 75 Package Group Pattern – – ODROID-U 3 Package Group Pattern (1/2) • 60 75 Package Group Pattern – – Tizen packages are grouped by their common objectives. When MIC makes Tizen image, it loads packages in the unit of package group. ~/tizen-platform/meta/package-groups/patterns/target-odroid-u 3. xml Description: Packages for ODROID-U 3 target Name: target-odroid-u 3 Packages: - alsa-scenario-scn-data-0 -wm 1811 - bluetooth-firmware-bcm-e 4412 - charging-animation - device-manager-plugin-exynos - gst-plugins-e 4 x 12 - gst-plugins-fimcconvert - libomxil-e 4 x 12 (Continued) SKKU Embedded Software Lab.

ODROID-U 3 Package Group Pattern (2/2) (Continued) - libtbm-exynos 4412 - mfc-firmware-e 4412 - ODROID-U 3 Package Group Pattern (2/2) (Continued) - libtbm-exynos 4412 - mfc-firmware-e 4412 - mmfw-sysconf-cleansdk-e 4 x 12 - model-config-odroid-u 3 - my-account - nfc-plugin-65 nxp - nfc-plugin-nxp - opengl-es-virtual-drv - org. tizen. mobileprint - powertop - print-service - print-driver-data - pygobject - rfkill - sensor-plugins - system-plugin-slp - systemd-console-tty. SAC 2 - tel-plugin-imcmodem - xorg-x 11 -drv-exynos - xorg-x 11 -misc-exynos Summary: Packages for ODROID-U 3 profile package SKKU Embedded Software Lab. 61 75

Cloning Total Source Code of Tizen 62 1. Make and move to Tizen source Cloning Total Source Code of Tizen 62 1. Make and move to Tizen source code directory 1. $ mkdir tizen-platform; cd tizen-platform 2. Set the path of download server. 1. $ repo init -u ssh: //@review. tizen. org: 29418/scm/manifest -b ex. $ repo init -u ssh: //[email protected] tizen. org: 29418/scm/manifest -b tizen_2. 2 3. Clone source code (Using 8 threads) 1. $ repo sync -j 8 SKKU Embedded Software Lab. 75

Setting up for Target Board (1/2) 63 1. Move to Tizen source code directory Setting up for Target Board (1/2) 63 1. Move to Tizen source code directory 1. $ cd ~/tizen-platform 2. Clone ODROID-U 3 profile package 1. cd ~/tizen-platform 2. git clone https: //github. com/SKKU-ESLAB-Tizen/tizen-profile-odroid -u 3. git profile/mobile/model/config-odroid-u 3 3. Copy ODROID-U 3 kickstart file 1. cp profile/mobile/model/config-odroid-u 3/ODROID-U 3. ks ~/tizenplatform 4. Copy ODROID-U 3 package group file 1. cp profile/mobile/model/config-odroid-u 3/target-odroid-u 3. yaml ~/tizen-platform/meta/package-groups/patterns/ 2. cd ~/tizen-platform/meta/package-groups/ 3. git add. 4. git commit -m “ODROID-U 3 package group is added” SKKU Embedded Software Lab. 75

Setting up for Target Board (2/2) 64 75 5. Modify Repo Manifest File: 1. Setting up for Target Board (2/2) 64 75 5. Modify Repo Manifest File: 1. $ cd ~/tizen-platform 2. gedit. /. repo/manifests/profile-projects. xml 1. Add following red line. SKKU Embedded Software Lab.

Building Total Platform Packages 65 75 1. Make a build script (build. sh) 1. Building Total Platform Packages 65 75 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. 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" gbs build -A armv 7 l --threads=2 --exclude=${skip_pkgs} 2. $ sudo chmod +x build. sh 2. Run the build script 1. $. /build. sh SKKU Embedded Software Lab.

Making Tizen Images (1/2) • MIC makes images using Tizen packages. – MIC downloads Making Tizen Images (1/2) • MIC makes images using Tizen packages. – MIC downloads 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. 66 75

Making Tizen Images (2/2) 67 1. Making Tizen Images 1. $ cd ~/tizen-platform 2. Making Tizen Images (2/2) 67 1. Making Tizen Images 1. $ cd ~/tizen-platform 2. $ gbs createimage --ks-file=ODROID-U 3. ks --tmpfs • --ks-file=: the path of kickstart file • --tmpfs: accelerates making image process through ramdisk 2. Results: / mic-output – RD-PQ-YYYYMMDDhhmm. tar. gz: P latform images • platform. img, ums. img, data. img – RD-PQ-YYYYMMDDhhmm. packages: List of packages included 1. RD-PQ-YYYYMMDDhhmm. xml: Partition information 2. manifest. json: Manifest file SKKU Embedded Software Lab. 75

Tizen Platform IDE 68 • Platform IDE provides the following advantages: – Download source Tizen Platform IDE 68 • Platform IDE provides the following advantages: – Download source code from git repository and contribute changes – Create platform projects and commit changes and push to git repository – Easily build platform module – Run and debug the platform module – Easily manage packages SKKU Embedded Software Lab. 75

Tizen Platform IDE: Install • Tizen Platform IDE included in is Tizen SDK. 1. Tizen Platform IDE: Install • Tizen Platform IDE included in is Tizen SDK. 1. . /tizen-sdk-ubuntu 32 -v 2. 2. 71. bin 2. Check below options. • Platform development • SDK development Tools • Platform Rootstrap SKKU Embedded Software Lab. 69 75

Tizen Platform IDE: Git Configuration • Set the Review Server’s Address – For accessing Tizen Platform IDE: Git Configuration • Set the Review Server’s Address – For accessing Tizen review server, you should set the review server’s address. 1. “Window Preferences Tizen SDK Platform Site Configuration” 2. “Add Configuration” 3. Input the review server’s information as below figure. 4. Press “OK” SKKU Embedded Software Lab. 70 75

Cloning Existing Tizen Repository • “File New Project Tizen Platform Project” – Choose one Cloning Existing Tizen Repository • “File New Project Tizen Platform Project” – Choose one of the git repositories in Tizen review server. SKKU Embedded Software Lab. 71 75

SSL Ceritification Error 72 75 • SSL certification error is often occurred. In this SSL Ceritification Error 72 75 • SSL certification error is often occurred. In this case, follow below process. – $ wget https: //java-useexamples. googlecode. com/svn/trunk/src/com/aw/ad/util/Install. Cert. java – $ javac Install. Cert. java – $ java Install. Cert review. tizen. org • Enter when ‘Enter certificate to add to trusted keystore or 'q' to quit: [1]’ – Copy jssecacerts into • /usr/lib/jvm/java-7 -oracle/jre/lib/security/cacerts – Click update again in site configuration then success SKKU Embedded Software Lab.

Tizen IDE Platform Perspective SKKU Embedded Software Lab. 73 75 Tizen IDE Platform Perspective SKKU Embedded Software Lab. 73 75

Checkout Repository • Git Repository Checkout – Window Show View Others Git Repositories – Checkout Repository • Git Repository Checkout – Window Show View Others Git Repositories – Create new branch (Checkout from remote branch) • Branch Local Switch To New Branch • Choose refs/remotes/origin/tizen_2. 2 • Finish SKKU Embedded Software Lab. 74 75

Building Tizen Platform Project • Build Package – Choose target device from rootstrap view Building Tizen Platform Project • Build Package – Choose target device from rootstrap view – Choose project and Build package SKKU Embedded Software Lab. 75 75

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. 76 75

Appendix: Git and Repo Cheatsheet (2/2) SKKU Embedded Software Lab. 77 75 Appendix: Git and Repo Cheatsheet (2/2) SKKU Embedded Software Lab. 77 75

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. 78 75

Appendix: GBS Trouble-shooting (1/2) 79 • When build error is occured, refer to the Appendix: GBS Trouble-shooting (1/2) 79 • 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 2. 2/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 2. 2/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. 75

Appendix: GBS Trouble-shooting (2/2) 80 75 • RPM DB 4 error /home/user/GBS-ROOT/local/repos/tizen 2. 2/armv Appendix: GBS Trouble-shooting (2/2) 80 75 • RPM DB 4 error /home/user/GBS-ROOT/local/repos/tizen 2. 2/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’ flag on GBS. gbs build -A armv 7 l --include-all --clean SKKU Embedded Software Lab. build. sh