Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of...

20
Tizen Platform Build Xiaoli Gong [email protected] Nankai University, China

Transcript of Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of...

Page 1: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Tizen Platform Build

Xiaoli Gong

[email protected]

Nankai University, China

Page 2: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Overview on Building Tizen Platform

Requirements

Total source code of Tizen

Profile for ODROID-U3

Kickstart file for ODROID-U3

Package group pattern for ODROID-U3

Entire Process

Cloning total Tizen platform source code

Setting up for target board

Profile

Kickstart file

Package group pattern

Building

Making Images

Page 3: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Cloning Total Source Code of Tizen

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://<Username>@review.tizen.org:29418/scm/manifest -b

<Branch-name> --repo-

url=git://android.git.linaro.org/tools/repo.git

ex. $ repo init -u

ssh://[email protected]:29418/scm/manifest -b tizen_2.2 -

-repo-url=git://android.git.linaro.org/tools/repo.git

3. Clone source code (Using 8 threads)

1. $ repo sync -j8

Page 4: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Total Source Code of Tizen

• 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

Page 5: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Profile:feature and apps in the system

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 by target board.

Official target of Tizen 2.2: RD-210, RD-PQ, Emulator

ODROID-U3 is not supported officially → New profile is required

Refer to https://www.tizen.org/feature

Page 6: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

ODROID-U3 Profile

Components

LICENSE.APLv2: Apache License v2

NOTICE.APLv2

model-config.manifest: Manifest file required

for RPM

http://wiki.tizen.org/wiki/Security/Application_insta

llation_and_Manifest

model-config.xml

ODROID-U3 Profile

packaging/model-config-odroid-u3.spec

RPM package specification

Page 7: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

ODROID-U3 Profile: Structure

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<model-config version="2.2.0" model="ODROID-U3-REF">

<platform>

<!-- Model Name, Platform Name/Version, Processor Name -->

<key name="tizen.org/system/model_name" type="string">ODROID-U3</key>

<key name="tizen.org/system/platform.name" type="string">Tizen</key>

<key name="tizen.org/feature/platform.version" type="string">2.2</key>

<key name="tizen.org/system/platform.processor" type="string">exynos4412</key>

<!-- Specification of Features -->

<key name="tizen.org/feature/camera" type="bool">false</key>

<key name="tizen.org/feature/camera.back" type="bool">false</key>

</platform>

<custom>

</custom>

</model-config>

~/tizen-platform/profile/mobile/model/config-odroid-u3/

model-config.xml

Page 8: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Kickstart File:How to build

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

Page 9: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Kickstart File: Structure (1/4)

#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 mmcblk0p --fstype=ext4 --label=platform

# DATA partition

part /opt/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=data

# UMS partition

part /opt/usr/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --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)

~/tizen-platform/ODROID-U3.ks

Page 10: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

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 --baseurl=file:///home/user/GBS-ROOT/local/repos/tizen2.2/armv7l/ --

priority=1

repo --name=Tizen-main --

baseurl=https://download.tizen.org/snapshots/2.2/common/latest/repos/tizen-

main/armv7l/packages/ --save --ssl_verify=no --priority=99

repo --name=Tizen-base --

baseurl=https://download.tizen.org/snapshots/2.2/common/latest/repos/tizen-

base/armv7l/packages/ --ssl_verify=no --priority=99

(Continued)

~/tizen-platform/ODROID-U3.ks

Page 11: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Kickstart File: Structure (3/4)

Required package groups

List of package groups to be included in image

Pre-required packages

List of package groups to be included in image

(Continued)

%packages

@common

@apps-common

@apps-core

@osp

@target-common

@target-odroid-u3

%end

~/tizen-platform/ODROID-U3.ks

%prepackages

eglibc

systemd

busybox

libacl

libcap

dbus-libs

libgcc

libudev

libattr

default-files-tizen

openssl

libprivilege-control

libprivilege-control-conf

security-server

libdlog

libsecurity-server-client

sqlite

tzdata-slp

vconf

tizen-coreutils

rpm-security-plugin

%end

(Continued)

Page 12: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Kickstart File: Structure (4/4)

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

rm -rf /etc/localtime

ln -sf /opt/etc/localtime /etc/localtime

(중략)

%end

~/tizen-platform/ODROID-U3.ks

Page 13: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

ODROID-U3 Package Group Pattern (1/2)

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.

Description: Packages for ODROID-U3 target

Name: target-odroid-u3

Packages:

- alsa-scenario-scn-data-0-wm1811

- bluetooth-firmware-bcm-e4412

- charging-animation

- device-manager-plugin-exynos

- gst-plugins-e4x12

- gst-plugins-fimcconvert

- libomxil-e4x12

(Continued)

~/tizen-platform/meta/package-groups/patterns/target-odroid-u3.xml

Page 14: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

ODROID-U3 Package Group Pattern (2/2)

(Continued)

- libtbm-exynos4412

- mfc-firmware-e4412

- mmfw-sysconf-cleansdk-e4x12

- model-config-odroid-u3

- my-account

- nfc-plugin-65nxp

- 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-ttySAC2

- tel-plugin-imc

- tel-plugin-imcmodem

- xorg-x11-drv-exynos

- xorg-x11-misc-exynos

Summary: Packages for ODROID-U3

ODROID-U3 profile package

Page 15: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Setting up for Target Board

1. Move to Tizen source code directory

1. $ cd ~/tizen-platform

2. Clone ODROID-U3 profile package

1. cd ~/tizen-platform

2. git clone https://github.com/SKKU-ESLAB-Tizen/tizen-profile-

odroid-u3.git profile/mobile/model/config-odroid-u3

3. Copy ODROID-U3 kickstart file

1. cp profile/mobile/model/config-odroid-u3/ODROID-U3.ks ~/tizen-

platform

4. Copy ODROID-U3 package group file

1. cp profile/mobile/model/config-odroid-u3/target-odroid-u3.yaml

~/tizen-platform/meta/package-groups/patterns/

2. cd ~/tizen-platform/meta/package-groups/

3. git add .

4. git commit -m “ODROID-U3 package group is added”

Page 16: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Building Total Platform Packages

1. Make a build script (build.sh)

1. $ gedit 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,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"

gbs build -A armv7l --threads=2 --clean-once --include-all --exclude=${skip_pkgs}

~/tizen-platform/build.sh

2. $ sudo chmod +x build.sh

2. Run the build script1. $ ./build.sh

Page 17: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Tizen Structure

Page 18: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

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

Page 19: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Making Tizen Images (2/2)

1. Making Tizen Images

1. $ cd ~/tizen-platform

2. $ gbs createimage --ks-file=ODROID-U3.ks --tmpfs

• --ks-file=<path>: the path of kickstart file

• --tmpfs: accelerates making image process through ramdisk

2. Results: <TIZEN-ROOT>/mic-output

– RD-PQ-YYYYMMDDhhmm.tar.gz: Platform images

• platform.img, ums.img, data.img

– RD-PQ-YYYYMMDDhhmm.packages: List of packages

included

– RD-PQ-YYYYMMDDhhmm.xml: Partition information

– manifest.json: Manifest file

Page 20: Tizen Platform Build · Kickstart File:How to build A file that defines how to make image of target device Structure Default locale, keyboard language, timezone Partition configurations,

Acknowledgement

This project is partially sponsored by Tianjin Samsung

Electronics Co., Ltd.

Special thanks to SKKU Embedded Software Laboratory. This

material is based on the lecture provided by them, and the

credit goes to the original authors.