Building Tizen Development EnvironmentTizen_2.3).pdf · Building Tizen Development Environment...

22
Real-Time Computing and Communications Lab., Hanyang University http://rtcc.hanyang.ac.kr Real-Time Computing and Communications Lab., Hanyang University http://rtcc.hanyang.ac.kr Building Tizen Development Environment Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University [email protected]

Transcript of Building Tizen Development EnvironmentTizen_2.3).pdf · Building Tizen Development Environment...

Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Building Tizen Development

Environment

Minsoo Ryu

Real-Time Computing and Communications Lab.

Hanyang University

[email protected]

2Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 2Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Tizen 2.3 Development Environment

Target hardware device

Tizen Reference Device-PQ (RD-PQ)

Tizen 2.2.1 is installed in current RD-PQ

Our target Tizen platform is 2.2.1, so we need to upgrade the

device with Tizen 2.3

Display Super AMOLED capacitive touch screen with 16M colors. Size 720 X 1280 pixels.

Chipset Exynos Quad

CPU Quad-core 1.4GHz Cortex-A9

Sensors Accelerometer, Gyro, Proximity, Magnetic etc.

Camera Primary 8MP, Secondary 1.9MP

WiFi Yes

Bluetooth Yes

GPS No? (emulated)

3Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 3Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Tizen 2.3 Development Environment

Download the following images from

#Bootloader

• http://download.tizen.org/releases/2.3/2.3-

mobile/bootloader/migrate_2.3_bootloader.tar.gz

#Mobile boot image

• http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-

mobile_20150311.3/images/target/mobile_boot/tizen-2.3-

mobile_20150311.3_mobile_boot.tar.gz

#Mobile platform Image

• http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-

mobile_20150311.3/images/target/mobile_target/tizen-2.3-

mobile_20150311.3_mobile_target.tar.gz

Remark: Tizen 2.3 is based on Linux kernel 3.0

4Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 4Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Upgrading Tizen 2.2.1 to Tizen 2.3

Bootloader upgrade

Enter the download mode of your device with

PowerKey+VolDown

Fuse the “migrate_2.3_bootloader.tar.gz” using lthor

• $ Sudo lthor migrate_2.3_bootloader.tar.gz

Platform upgrade

Enter the download mode for your device with

PowerKey+VolDown

Flash the boot image and the platform image

• $ Sudo lthor tizen-2.3-mobile_20150311.3_mobile_boot.tar.gz tizen-

2.3-mobile_20150311.3_mobile_target.tar.gz

5Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 5Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Setting Up Gerrit Access

1. Registering a user account to gain access to

tizen.org

2. Configuring Secure Shell (SSH) for Gerrit access

3. Configuring Git

6Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 6Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Registering a User Account

https://www.tizen.org/

7Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 7Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Configuring Secure Shell (SSH)

Generate RSA keys by executing the following command

$ ssh-keygen

Follow the on-screen prompt

Enter file in which to save the key (/home/(user)/.ssh/id_rsa) :

Enter passphrase (empty for no passphrase) :

Enter same passphrase again :

Create an SSH configuration file with a full path of “~/.ssh/config”

$ vim ~/.ssh/config

8Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 8Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Configuring Secure Shell (SSH)

Insert your Tizen ID

Host tizen review.tizen.org

Hostname review.tizen.org

IdentityFile ~/.ssh/id_rsa

User Tizen ID

Port 29418

#The line below is optional configuration applicable to Ubuntu and openSUSE.

#Add when using proxy, otherwise, skip it.

#ProxyCommand nc -X5 -x : %h %p

#The line below is optional configuration applicable to Fedora.

#Add when using proxy, otherwise, skip it.

#ProxyCommand nc --proxy-type socks4 --proxy : %h %p

9Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 9Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Configuring Secure Shell (SSH)

SSH public key

vim ~/.ssh/id_rsa.pub

Register SSH public key

10Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 10Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Configuring Secure Shell (SSH)

Check SSH connection

$ ssh tizen

**** Welcome to Gerrit Code Review ****

Hi Kyusang Choi, you have successfully connected over SSH.

Unfortunately, interactive shells are disabled.

To clone a hosted Git repository, use:

git clone ssh://[email protected]:29418/REPOSITORY_NAME.git

11Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 11Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Configuring Git

Install Git

$ sudo apt-get install git

Configure Git

$ git config --global user.name “name"

$ git config --global user.email “e-mail address"

12Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 12Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Installing Tizen Development Tools

Configure Tizen tools repository (Ubuntu 14.04 LTS)

$ sudo vim /etc/apt/sources.list

deb http://download.tizen.org/tools/latest-release/Ubuntu_14.04 /

$ sudo apt-get update

Install gbs, mic package

$ sudo apt-get install gbs mic

$ sudo apt-get update

$ sudo apt-get upgrade

13Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 13Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Cloning Tizen v2.3 Source

Create ~/bin/ subdirectory, include it in PATH

$ mkdir ~/bin/

$ PATH=~/bin:$PATH

Download the repo script by executing the following command :

$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

Change the attribute of repo

$ sudo chmod a+x ~/bin/repo

Create a new directory

$ mkdir ~/<Tizen_Project>

$ cd ~/<Tizen_Project>

14Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 14Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Cloning Tizen v2.3 Source

Initialize the repository Tizen 2.3

$ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_2.3

Synchronize the repository

$ repo sync

15Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 15Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Git Build System (GBS)

GBS

A developer command line tool that supports Tizen package

development

It's used to generate tarballs based on Git repositories, to do

local test buildings, and to submit code to OBS (Tizen's main

build service)

16Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 16Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Git Build System (GBS)

Prebuilt binary packages

The <Tizen_Project>/pre-built directory contains a group of prebuilt

projects that provides base and toolchain binary RPM packages for

GBS build.

Dependency cycles in Repos

Building packages with dependency cycles is not supported by

GBS. Known cycles are as follows:

gcc->eglibc->gcc

gcc->binutils->gettext->gcc

gettext->gcc->eglibc->gettext

cmake->curl->c-ares->cmake

filesystem->setup->filesystem

aul->privacy-manager-server->aul

libtool->texinfo->libzio->bzip2->libtool

libmm-sound->avsystem->pulseaudio->system-server-

>libfeedback->libmm-sound

17Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 17Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Git Build System (GBS)

Accelerator Packages

Tizen provides cross-compilers and other accelerator packages, as

shown below, in <Tizen_Project>/pre-built/toolchain-arm/ for ARM

build.

For the first build, these packages need to be excluded, otherwise

built out packages will be installed and used, which will make

accelerator packages fail to work.

bash,bzip2-libs,c-ares,cmake,coreutils,diffutils,eglibc,elfutils-libelf,elfutils-

libs,elfutils,fdupes,file,findutils,gawk,gmp,gzip,libacl,libattr,libcap,libcurl,libfile,libgcc,libl

ua,libstdc++,make,mpc,mpfr,ncurses-libs,nodejs,nspr,nss-softokn-

freebl,nss,openssl,patch,popt,rpm-build,rpm-libs,rpm,sed,sqlite,tar,xz-

libs,zlib,binutils,gcc

18Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 18Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Building a Specific Package

Move to Project folder

Configuring .gbs.conf

$ cd <Project folder>

[general]

profile = profile.tizen

[profile.tizen]

user = ID

passwdx = password

obs = obs.tizen

repos = repo.tizen_latest

[repo.tizen_latest]

url = http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-

mobile_20150311.3/repos/target/packages/

19Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 19Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Cloning a Specific Package over SSH

Clone the required package by executing the

following command

$ git clone ssh:

//<Username>@review.tizen.org:29418/framework/system/sen

sord

You can check if it is the master branch by executing

the following command

$ git branch –a

Build package in architecture armv7l

$ gbs build -A armv7l –include-all

20Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 20Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

MIC Image Creator

MIC is an image creator

It's used to create images for Tizen

With the MIC tool, users can create images of different types

for different verticals, including live CD images, live USB

images, raw images for KVM, loop images for IVI platforms,

and fs images for chrooting

entire framework

Result of specific

built package

21Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 21Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Creating a Tizen Image with MIC

Preparing the Kickstart File

Create a Tizen Image

$ sudo mic create loop tizen-2.3-

mobile_20150311.3_mobile_target.ks --local-pkgs-

path=localpath/ --pack-to=tizen_0416.tar.gz

Note that tizen_0416 is the result of MIC and localpath is the result of GBS

KS-File is a kickstart file that we already downloaded

$ wget

http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-

mobile_20150311.3/images/target/mobile_target/tizen-2.3-

mobile_20150311.3_mobile_target.ks

$ sudo mic create loop <KS-File> --local-pkgs-path=<localpath>/ --

pack-to=<Image name>.tar.gz

22Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 22Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr

Putting Image into RD-PQ

$ sudo lthor tizen-2.3-mobile_20150206.1_mobile_boot.tar.gz

tizen_0416.tar.gz