1 Tizen Porting 1: Tizen 개발환경구축및플랫폼빌드 시스템소프트웨어특론 (2014 2 학기 ) Sungkwankwan University
Contents 2 Tizen Porting 1 Tizen 개발환경구축 SCM Tools, Build Tool, Packaging Tools Tizen Platform IDE Tizen 플랫폼빌드및이미지만들기 방법 1: 전체패키지빌드 방법 2: 일부패키지만빌드 Tizen Porting 2 Tizen 커널빌드 부트로더포팅, 파티션설정및이미지플래시 플랫폼설정및문제사항해결
3 1. Tizen 개발환경구축
Tizen 개발도구 4 Source Code Management(SCM) Tools (Before build) Git, Repo, Gerrit Build Tool GBS(Git Build System) Packaging Tools (After build) MIC, RPM Tizen Platform IDE
개발환경구축과정요약 5 1. Git, Repo 설치 1. Git 설치 (8p) 2. Repo 설치 (15p) 2. Gerrit 서버에개발자등록및초기설정 1. Gerrit 개발자등록및초기설정 (19~24p) 3. GBS, MIC 설치 1. GBS 설치 (26p) 2. MIC 설치 (29p)
Git 6 A revision control and source management tool Features Free and open source(gnu GPL v2) Branching and merging Smaller and faster than other SCM tools Distributed Data assurance Staging area
Git: Key Concepts 7 Working directory: 실제파일 add command: staging area 에파일 / 디렉토리추가 Staging area(index): commit 될파일 commit command: 현재 staging area 를하나의버전으로서 repository 에반영 Repository(HEAD): 이미 commit 된 file Hash value 로식별되는 content-addressable object 로서보관됨.
Git: Commands 8 설치하기 $ sudo apt-get install git Repository 시작하기 새 repository 만들기 (init) $ git init Working directory 있는 repository 만들기 $ git init --bare Working directory 없는 repository 만들기 기존 repository 복제하기 (clone) 같은 PC 에 repository 가있는경우 $ git clone <local repository path> ex. git clone /home/user/tizen-platform 다른 PC 에 repository 가있는경우 $ git clone protocol://user@host:path ex. git clone ssh://user@review.tizen.org:external/systemd
Git: Commands 9 Staging area 에추가하기 (add) $ git add <file name> $ git add * Staging area 를하나의버전으로 commit $ git commit -m Description about this version $ git commit -a -m Description about this version -a: staging area 에자동으로추가하는옵션
Git: Commands 10 Local commit 을 remote repository 로밀어넣기 (push) $ git push <remote repository 이름 > <remote branch 이름 > Remote repository 이름의기본값 : origin Remote branch 이름의기본값 : master ex. git push origin master Remote repositor 의주소 (URI) 알려주기 해당 repository 가 remote repository 에서복제된것이아닌경우, remote repository 의주소를알려주면 push 명령사용가능 $ git remote add <remote repository 이름 > <remote repository 주소 > ex. git remote add origin ssh://user@review.tizen.org:external/systemd
Git: Commands 11 가지치기 (branch) 와합치기 (merge) 서로다른개발흐름을분리할때유용 Default branch: master 일반적으로는분리된 develop branch 를만들고, 이 branch 에서작업함. 하나의 topic 을추가하는개발과정을수행할때에도 topic 마다 branch 를하나씩만듦. Branch 의개발이끝나고나면원래 branch 로합침 (merge).
Git: Commands 12 새 branch 만들기 $ git branch <branch 이름 > ex. $ git branch feature_x 다른 branch 합치기 $ git merge < 합칠 branch 의이름 > ex. (master branch 로이동한후 feature_x 를 master 로합침 ) $ git checkout master $ git merge feature_x Branch 목록보여주기 $ git branch --list Remote branch reference 목록보여주기 $ git branch --remotes 다른 branch 로옮기기 (checkout) $ git checkout <branch 이름 >
Git: Commands 13 Commit log 보여주기 과거 commit 의 hash value 와 description 을보여줌 $ git log 이전 commit 으로옮기기 (checkout) $ git checkout <commit 의 hash value> ex. $ git log commit 783c82ff64eda9f03401834de906ecad01f691 Author: Gyeonghwan Hong <redcarrottt@gmail.com> Date: Mon Sep 22 10:37:44 2014 +0900 Second version commit: only prototype done commit 712943bb31bf85430e1a027abe197e5b88a26110 Author: Gyeonghwan Hong <redcarrottt@gmail.com> Date: Thu Aug 28 12:08:17 2014 +0900 initial version commit: there are only specification files $ git checkout 712943bb31bf85430e1a027abe197e5b88a26110
Repo 14 Repository management tool that built on top of Git Not replacement of Git Originally used in Android project Used for managing many git repositories Automate parts of development workflow
Repo: 설치하기 15 설치하기 1. 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. Repo 환경변수기본경로설정 1. ~/.bashrc 편집 1. $ gedit ~/.bashrc 2. 맨마지막줄에아래코드추가 PATH=~/bin:${PATH} ~/.bashrc 3. 저장후터미널다시시작
Repo: Commands 16 Initialize repo directory $ repo init -u <URL> [OPTIONS] OPTIONS -u: specify a URL from which to retrieve a manifest repository -b: specify a revision ex. tizen_2.1, tizen_2.2 ex. $ repo init -u ssh://user@review.tizen.org:29418/scm/manifest -b tizen_2.2 Synchronize repo directory $ repo sync [OPTIONS] Downloads new changes and updates the working files in local environment. All of the project in repo directory will be synchronized. -j: number of projects to fetch simultaneously
Git & Repo: References 17 Git Git official web site: http://git-scm.com/ Git official book: http://git-scm.com/book/ko Simple git manual: http://rogerdudler.github.io/gitguide/index.ko.html How Git Works Internally: http://www.slideshare.net/seongjaepark1/deep-darkside-ofgit Repo Android developing document: https://source.android.com/source/developing.html Repo command reference: https://source.android.com/source/using-repo.html
Gerrit and GBS(Git Build System) 18 Gerrit A Web-based code review system which checks the platform source code Reference: https://developer.tizen.org/devguide/2.2.1/org.tizen.platform.development/html/platform_dev _env/gerrit.htm GBS A developer command line tool that supports Tizen package development Functions Build a repository or repositories and make package files(*.rpm) Generate tarballs based on Git repositories Do local test buildings Submit code to OBS(Tizen s main build service)
Gerrit: Tizen 개발자등록 19 1. https://developer.tizen.org/ko 에서 Tizen ID 등록 2. Gerrit 개발자 ID 등록 (http://review.tizen.org/gerrit)
Gerrit: 초기설정 20 Tizen review server 에접근하기위해 SSH 설정을변경해야함. 3. Terminal 에서 ssh-keygen 실행 1. $ ssh-keygen Passphrase 는디폴트값사용 Config / Public key / private key 파일이생성됨.
Gerrit: 개발자등록및초기설정 21 4. SSH config 파일설정 1. $ gedit ~/.ssh/config username 은앞서등록시사용한아이디를입력 Host tizen Hostname review.tizen.org IdentityFile ~/.ssh/id_rsa User username Port 29418 ~/.ssh/config Host review.tizen.org Hostname review.tizen.org IdentityFile ~/.ssh/id_rsa User username Port 29418
Gerrit: 개발자등록및초기설정 22 5. http://review.tizen.org/gerrit 에로그인후, 설정화면으로이동 6. SSH Public Keys 메뉴에서 Add Key 선택
Gerrit: 개발자등록및초기설정 23 7. 미리생성해둔 public 키의내용을복사하여입력
Gerrit: 개발자등록및초기설정 24 8. SSH 접속테스트 1. $ ssh tizen 2. $ ssh review.tizen.org 정상적으로접속될경우, 아래와같은메시지가출력됨.
GBS(Git Build System) 25 A developer command line tool that supports Tizen package development. Features Builds Tizen packages based on source code of git repositories Generates tarballs based on Git repositories Does local test buildings Submits code to OBS(Open Build System; Tizen s main build service)
GBS: 설치하기 26 1. APT repository 에 Tizen development tool repository 추가 1. $ sudo gedit /etc/apt/sources.list 2. 아래항목추가 1. XX : Ubuntu Major 버전 (12, 13 지원 ) 2. YY : Ubuntu Minor 버전 (04, 10 지원 ) deb http://download.tizen.org/tools/latest-release/ubuntu_xx.yy / 3. $ sudo apt-get update 2. GBS 패키지설치 1. sudo apt-get install gbs /etc/apt/sources.list
GBS: 설정파일 27.gbs.conf: GBS 설정파일 Profile 이름, working directory 경로설정 Local repository, remote repository 경로설정 [general] tmpdir=/var/tmp/ profile=profile.tizen2.2 work_dir=. ~/tizen-platform/.gbs.conf [repo.tizen2.2] url=http://download.tizen.org/releases/2.2/tizen-2.2/ [repo.tizen2.2_arm] url=${work_dir}/pre-build/toolchain-arm/ [repo.tizen2.2_x86] url=${work_dir}/pre-built/toolchain-x86/ [profile.tizen2.2] repos=repo.tizen2.2_arm, repo.tizen2.2_x86, repo.tizen2.2 buildconf=${work_dir}/scm/meta/build-config/build.conf
GBS: Commands 28 빌드하기 gbs build -A <target architecture 이름 > 옵션 빌드대상 : 현재디렉토리에있는모든패키지의 git repository 소스코드 (git 으로 commit 한소스코드 ) Tizen 에서는 x86, armv7l 를 target architecture 로설정가능 --threads <thread 수 >: 빌드에사용할총 thread 개수 --clean-once: 첫빌드시 gbs build 환경디렉토리초기화 --include-all: git repository 가아닌, working directory 를빌드함 --exclude=< 패키지목록 >: 빌드에서제외할패키지목록 Cyclic dependency 문제를막거나굳이빌드하지않아도되는패키지를제외하기위해사용 ex. gbs build -A armv7l ex. gbs build -A armv7l --threads=2 --clean-once --includeall --exclude=bash,bzip2-libs,rpm
MIC(Moblin Image Creator) 29 Tool to create an operating system image for a Tizen device 설치하기 1. APT repository 에 Tizen development tool repository 추가 참고 : GBS: 설치하기 2. MIC 패키지설치하기 1. $ sudo apt-get install mic
RPM 30 Red Hat Package Manager or RPM Package Manager A Package Manager which can be used to build, install, query, verify, update, erase individual software packages Package Components Type An archive of files Metadata used to install and erase the archive files helper scripts, file attributes, and descriptive information about the package Binary package: used to encapsulate software to be installed Source package: containing the source code and recipe necessary to produce binary packages 참고 : http://rpm.org/wiki/docs
Tizen Platform IDE 31 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
Tizen Platform IDE: 설치하기 32 Tizen Platform IDE 는 Tizen SDK 에포함되어있음. 1../tizen-sdk-ubuntu32-v2.2.71.bin 2. 아래옵션을반드시체크 Platform development SDK development Tools Platform Rootstrap
Tizen Platform IDE: Git 설정 33 Tizen Review Server 에접근하기위해 Git 에서버의주소를설정해주어야함. 1. Window Preferences à Tizen SDK à Platform à Site Configuration 2. Add Configuration 3. Tizen review server 에대한내용을기입 4. OK 클릭후 Update
Tizen Platform Project 만들기 34 1. File à New à Project à Tizen à Tizen Platform Project Tizen review server 에있는 git repository 중하나를선택
SSL Ceritification 문제해결방법 35 SSL Certification 에문제가있는경우, 다음과정을진행한다. wget https://java-useexamples.googlecode.com/svn/trunk/src/com/aw/ad/util/installcer t.java javac InstallCert.java java InstallCert 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
Tizen IDE Platform Perspective 36
Checkout Repository 37 Git Repository Checkout Window à Show View à Others à Git à Git Repositories Create new branch (Checkout from remote branch) Branch à Local à Switch To à New Branch Choose refs/remotes/origin/tizen_2.2 Finish
Building Tizen Platform Project 38 Build Package Choose target device from rootstrap view Choose project and Build package
39 2. Tizen 플랫폼빌드및이미지만들기
Contents 40 Tizen 전체빌드과정 Tizen Servers, Tizen 플랫폼을빌드하는두가지방법 전체패키지빌드 Cloning Total Platform Source Code Cloning ODROID-U3 Profile Source Profile Building Total Platform Packages Making Tizen Platform Images Kickstart File 일부패키지만빌드 Cloning a Source Code Repository Cloning Essential Repositories Building Total Platform Packages Building a Package Making Tizen Platform Images
Tizen 전체빌드과정 41
Tizen Servers 42 Tizen Review Server (review.tizen.org) 직접작성한코드를 review 받거나 review 가끝난코드를내려받을수있는서버 Gerrit 사용 : Git 과긴밀하게연결되어있는 review 시스템 https://review.tizen.org/gerrit/documentation/intro-quick.html Tizen Download Server (download.tizen.org) Pre-built 패키지나이미지, SDK 등을내려받을수있는서버
Tizen Servers: Tizen Download Server 43 Tizen Dev. Tools (http://download.tizen.org/tools) Build tools: depanneur, libzypp, GBS, QEMU, Image maker and flasher: MIC, lthor Tizen SDK Tizen Pre-built Packages & Images Maintained by versions and target architectures Versions Snapshots: made when the end of build cycle Pre-releases: alpha, beta versions Releases: final version
Tizen 플랫폼빌드방법 (1/3) 44 아래두가지방법중하나를선택하여플랫폼을빌드할수있다. 전체패키지빌드 PC 에모든 Tizen 플랫폼패키지들을유지함. 빌드시간이너무오래걸림. 일부패키지만빌드 PC 에는 Tizen 플랫폼패키지들중일부만유지함. 나머지패키지들 : Tizen server 로부터이미빌드된패키지를다운로드하여이미지를만듦. 빌드시간최소화가능.
Tizen 플랫폼빌드방법 (2/3) 45 전체패키지빌드
Tizen 플랫폼빌드방법 (3/3) 46 일부패키지만빌드 빌드시간절약!
47 2. Tizen 플랫폼빌드및이미지만들기 ( 방법 1: 전체패키지빌드 )
플랫폼빌드 & 이미지만들기과정 ( 전체패키지 ) 48 1. 모든플랫폼소스코드저장소복제하기 Cloning Total Platform Source Code 2. ODROID-U3 Profile 소스저장소복제하기 Cloning ODROID-U3 Profile Source 3. 패키지빌드 Building Total Platform Packages 4. 플랫폼이미지만들기 Making Tizen Platform Images
Cloning Total Platform Source Code 49 1. Repo 설치 ( 참고 : Repo: 설치하기 ) 2. Tizen 2.2 전체소스코드다운로드 총용량약 6GB 1. $ mkdir tizen-platform; cd tizen-platform 2. Repo 에다운로드대상소스코드를지정함 1. $ repo init -u ssh://<username>@review.tizen.org:29418/scm/manifest -b <Branch-name> ex. $ repo init -u ssh://user@review.tizen.org:29418/scm/manifest -b tizen_2.2 3. 소스코드다운로드 (8 개 thread 사용 ) 1. $ repo sync -j8 참고 : Repo: Commands
Profile 50 Tizen 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 Target board 에따라다른 profile 필요함. Tizen 2.2 공식지원 target: RD-210, RD-PQ, Emulator ODROID-U3 target 은공식지원되지않음 새 profile 필요 참고 : https://www.tizen.org/feature
ODROID-U3 Profile 51 ODROID-U3 Profile 디렉토리의구성요소 LICENSE.APLv2: Apache License v2 NOTICE.APLv2 model-config.manifest: Manifest file required for RPM 참고 : http://wiki.tizen.org/wiki/security/application_installation_and_ma nifest model-config.xml ODROID-U3 Profile XML 로작성됨. 참고 : https://ko.wikipedia.org/wiki/xml packaging/model-config-odroid-u3.spec RPM Package specification
ODROID-U3 Profile: 구조 52 ~/tizen-platform/profile/mobile/model/config-odroid-u3/ model-config.xml <?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>
Cloning ODROID-U3 Profile Source (1/3) 53 1. ODROID-U3 Profile Source Code 다운로드 1. icampus 에서 config-odroid-u3.tar.gz 다운로드 2. config-odroid-u3.tar.gz 압축해제 3. 압축해제한결과를 ~/tizen-platform/profile/mobile/model/config-odroid-u3 로복사 2. 새로운 Package Group Pattern 만들기 ODROID-U3 에서 Tizen 이동작하기위해필요한패키지목록도필요 1. $ cd ~/tizen-platform/meta/package-groups/patterns 2. $ gedit target-odroid-u3.yaml 이파일에들어가야할내용은다음슬라이드에있음
Cloning ODROID-U3 Profile Source (2/3) 54 Package Group Pattern Tizen의패키지들을큰기준으로묶는것을정의한파일 패키지구조를관리하기쉽게하기위함. MIC로이미지를만들때 package group 별로 include 가리키는순서 : Kickstart Package group Packages ~/tizen-platform/meta/package-groups/patterns/target-odroid-u3.xml 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 ( 뒤쪽에계속 )
Cloning ODROID-U3 Profile Source (3/3) 55 ( 앞쪽에서계속 ) - 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
Building Total Platform Packages (1/2) 56 1. GBS 설정파일 (.gbs.conf) 만들기 1. $ cd ~/tizen-platform 2. $ gedit.gbs.conf [general] tmpdir=/var/tmp/ profile=profile.tizen2.2 work_dir=. ~/tizen-platform/.gbs.conf [repo.tizen2.2] url=http://download.tizen.org/releases/2.2/tizen-2.2/ [repo.tizen2.2_arm] url=${work_dir}/pre-build/toolchain-arm/ [repo.tizen2.2_x86] url=${work_dir}/pre-built/toolchain-x86/ [profile.tizen2.2] repos=repo.tizen2.2_arm, repo.tizen2.2_x86, repo.tizen2.2 buildconf=${work_dir}/scm/meta/build-config/build.conf
Building Total Platform Packages (2/2) 57 2. 빌드스크립트 (build.sh) 만들기 1. $ gedit build.sh ~/tizen-platform/build.sh #!/bin/bash # 패키지의존성문제를막고, 빌드시간을줄이기위해빌드하지않을패키지목록 skip_pkgs="bash,bzip2-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 armv7l --threads=2 --clean-once --include-all --exclude=${skip_pkgs} 2. $ sudo chmod +x build.sh 3. 빌드스크립트실행 1. $ build.sh
Kickstart File 58 Target device 에대한이미지만들기설정파일 구성요소 Default locale, keyboard language, timezone Partition configurations, root user, default user to login Repository path 패키지가있는저장소의경로 Required package groups 이미지에들어가야할패키지그룹목록 Required pre-packages 이미지만들기작업자체에필요한패키지목록 Postscript Required package groups 에명시된모든패키지를합친이미지에대한초기조건설정
Kickstart File: 구조 (1/4) 59 ~/tizen-platform/odroid-u3.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 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 ' ( 뒤쪽에계속 )
Kickstart File: 구조 (2/4) 60 Repository path 패키지가있는저장소의경로목록 local path, download server 등여러개의 path 설정가능 우선순위조절가능 ( 숫자가작을수록우선순위높음 ) ~/tizen-platform/odroid-u3.ks ( 앞쪽에서계속 ) # 홈폴더가 /home/user/ 인경우, 아래와같이씁니다. 개발환경에맞게바꿔주세요. 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/tizenmain/armv7l/packages/ --save --ssl_verify=no --priority=99 repo --name=tizen-base -- baseurl=https://download.tizen.org/snapshots/2.2/common/latest/repos/tizenbase/armv7l/packages/ --ssl_verify=no --priority=99 ( 뒤쪽에계속 )
Kickstart File: 구조 (3/4) 61 Required package groups 이미지에들어가야할패키지그룹목록 Pre-required packages 이미지만들기작업자체에필요한패키지목록 ~/tizen-platform/odroid-u3.ks ( 앞쪽에서계속 ) %packages @common @apps-common @apps-core @osp @target-common @target-odroid-u3 %end %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 ( 뒤쪽에계속 )
Kickstart File: 구조 (4/4) 62 Postscript Required package groups 에명시된모든패키지를합친이미지에대한초기조건설정 ( 앞쪽에서계속 ) %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-u3.ks rm -rf /etc/localtime ln -sf /opt/etc/localtime /etc/localtime ( 중략 ) %end
Making Tizen Platform Images 63 1. Kickstart 파일다운로드 1. icampus 에서 ODROID-U3.ks 다운로드 ~/tizen-platform 으로복사 2. Image 만들기 1. $ cd ~/tizen-platform 2. $ gbs makeimage --ks-file=odroid-u3.ks --tmpfs --ks-file: kickstart 파일경로 --tmpfs: Ramdisk 상에서이미지만들기작업을수행하여속도향상 3. 결과물은 <TIZEN-ROOT>/mic-output 에생성됨 RD-PQ-YYYYMMDDhhmm.tar.gz: 최종플랫폼이미지 platform.img, ums.img, data.img RD-PQ-YYYYMMDDhhmm.packages: 패키지목록 RD-PQ-YYYYMMDDhhmm.xml: 파티션정보 manifest.json: 파일구성정보
64 2. Tizen 플랫폼빌드및이미지만들기 ( 방법 2: 일부패키지만빌드 )
플랫폼빌드 & 이미지만들기과정 ( 일부패키지 ) 65 1. ( 선택 ) 빌드하고싶은소스코드저장소복제하기 Cloning a Source Code Repository 2. 필수저장소복제하기 Cloning Essential Repositories 3. 패키지빌드 전부빌드 : Building Total Platform Packages 단일패키지빌드 : Building a Platform Packages 4. 플랫폼이미지만들기 Making Tizen Platform Images
Cloning a Source Code Repository (1/2) 66 1. 필요한 package 의 repository 경로알아내기 1. https://review.tizen.org/gerrit/#/admin/projects/ 에접속 2. 필요한 package 의 repository 선택후, repository 경로복사 ex. ssh://redcarrottt@review.tizen.org:29418/externel/systemd 2. Repository 복제 1. $ git clone <repository 경로 > ex. git clone ssh://redcarrottt@review.tizen.org:29418/externel/systemd
Cloning a Source Code Repository (2/2) 67 3. Repository 를 Tizen 버전에맞는 branch 로변경 1. Remote repository 의 branch 목록알아내기 1. $ git branch --remotes ex. $ git branch --remotes origin/master origin/tizen origin/tizen_2.1 origin/tizen_2.2 origin/tizen_common origin/tizen_generic origin/tizen_ivi origin/tizen_mobile 2. Tizen 버전에맞는 Branch 로변경 1. $ git checkout <branch 이름 > ex. $ git checkout tizen_2.2
Cloning Essential Repositories (1/6) 68 일부 Tizen 패키지를빌드하고플랫폼이미지를만들기위해, 다음패키지들이반드시필요함. tools/package-groups Package group pre-built/toolchain-arm 이미빌드된 ARM toolchain pre-built/toolcahin-x86 이미빌드된 x86 toolchain profile/mobile/model/config-odroid-u3 ODROID-U3 profile ODROID-U3 에서동작하는플랫폼이미지를만들기위해필요 이미지생성시 package group pattern 으로이패키지에접근하기때문에, 새로운 ODROID-U3 package group pattern 을추가해야함.
Cloning Essential Repositories (2/6) 69 1. Tizen 플랫폼코드디렉토리생성 1. $ mkdir ~/tizen-platform; cd ~/tizen-platform 2. tools/package-groups repository 가져오기 1. Repository 복제 1. $ git clone ssh://user@review.tizen.org:29418/tools/packagegroups meta/package-groups 2. Branch 를 Tizen 2.2 로이동 1. $ cd meta/package_groups 2. $ git checkout origin/tizen_2.2 3. $ cd -
Cloning Essential Repositories (3/6) 70 3. pre-built/toolchain-arm 가져오기 1. $ git clone ssh://user@review.tizen.org:29418/prebuilt/toolchain-arm pre-built/toolchain-arm 2. $ cd pre-built/toolchain-arm 3. $ git checkout origin/tizen_2.2 4. $ cd - 4. pre-built/toolcahin-x86 가져오기 1. $ git clone ssh://user@review.tizen.org:29418/ prebuilt/toolchain-x86 pre-built/toolchain-x86 2. $ git pre-built/toolchain-x86 3. $ git checkout origin/tizen_2.2 4. $ cd -
Cloning Essential Repositories (4/6) 71 5. profile/mobile/model/config-odroid-u3 가져오기 1. icampus 에서 config-odroid-u3.tar.gz 다운로드 2. config-odroid-u3.tar.gz 압축해제 3. 압축해제한결과를 ~/tizen-platform/profile/mobile/model/config 로복사
Cloning Essential Repositories (5/6) 72 6. 새로운 Package Group Pattern 만들기 1. $ cd ~/tizen-platform/meta/package-groups/patterns 2. $ gedit target-odroid-u3.yaml ~/tizen-platform/meta/package-groups/patterns/target-odroid-u3.xml 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 ( 뒤쪽에계속 )
Cloning Essential Repositories (6/6) 73 ( 앞쪽에서계속 ) - 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
Building Total Platform Packages (1/2) 74 1. GBS 설정파일 (.gbs.conf) 만들기 1. $ cd ~/tizen-platform 2. $ gedit.gbs.conf [general] tmpdir=/var/tmp/ profile=profile.tizen2.2 work_dir=. ~/tizen-platform/.gbs.conf [repo.tizen2.2] url=http://download.tizen.org/releases/2.2/tizen-2.2/ [repo.tizen2.2_arm] url=${work_dir}/pre-build/toolchain-arm/ [repo.tizen2.2_x86] url=${work_dir}/pre-built/toolchain-x86/ [profile.tizen2.2] repos=repo.tizen2.2_arm, repo.tizen2.2_x86, repo.tizen2.2
Building Total Platform Packages (2/2) 75 2. 빌드스크립트 (build.sh) 만들기 1. $ gedit build.sh ~/tizen-platform/build.sh #!/bin/bash # 패키지의존성문제를막고, 빌드시간을줄이기위해빌드하지않을패키지목록 skip_pkgs="bash,bzip2-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 armv7l --threads=2 --clean-once --include-all --exclude=${skip_pkgs} 2. $ sudo chmod +x build.sh 3. 빌드스크립트실행 1. $ build.sh
Building a Package 76 1. 패키지의디렉토리로이동 ex. systemd 패키지빌드시 : $ cd ~/tizen-platform/external/systemd 2. 빌드 1. $ gbs build -A armv7l --clean-once
Making Tizen Platform Images 1. Kickstart 파일다운로드 1. icampus 에서 ODROID-U3.ks 다운로드 ~/tizen-platform 으로복사 2. Image 만들기 1. $ cd ~/tizen-platform 2. $ gbs makeimage --ks-file=odroid-u3.ks --tmpfs --ks-file: kickstart 파일경로 --tmpfs: Ramdisk 상에서이미지만들기작업을수행하여속도향상 3. 결과물은 <TIZEN-ROOT>/mic-output 에생성됨 RD-PQ-YYYYMMDDhhmm.tar.gz: 최종플랫폼이미지 platform.img, ums.img, data.img RD-PQ-YYYYMMDDhhmm.packages: 패키지목록 RD-PQ-YYYYMMDDhhmm.xml: 파티션정보 manifest.json: 파일구성정보
부록 : Git and Repo Cheatsheet (1/2) 78 Android developing document: https://source.android.com/source/developing.html
부록 : Git and Repo Cheatsheet (2/2) 79
부록 : 플랫폼빌드시 Locale 에러해결 80 원인 플랫폼빌드는영문 Ubuntu 를기준으로되어있음. Ubuntu 가영문이외의언어를사용하는경우, gbs 에서 Locale 이맞지않는오류가발생할수있음. 해결책 build.sh 에아래와같이 locale 을영어로맞추는코드삽입 # Locale 은 UTF-8 영어로설정되어있어야오류가생기지않음 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 ~/tizen-platform/build.sh
부록 : GBS Trouble-shooting (1/2) 81 GBS 빌드오류시, 각패키지의빌드로그파일을참고 Example info: *** Build Status Summary *** === the following packages failed to build due to rpmbuild issue (1) === xf86-video-exynos: /home/user/gbs- ROOT/local/repos/tizen2.2/armv7l/logs/fail/xf86-video-exynos-1.0.0-1/log.txt 빌드로그파일내에서 error 검색 /home/user/gbs-root/local/repos/tizen2.2/armv7l/ logs/fail/xf86-video-exynos-1.0.0-1/log.txt [ 139s] error: db4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139s] error: cannot open Packages index using db4 - (-30971) [ 139s] error: cannot open Packages database in /var/lib/rpm [ 139s] error: db4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139s] error: cannot open Packages database in /var/lib/rpm
부록 : GBS Trouble-shooting (2/2) 82 RPM DB4 error /home/user/gbs-root/local/repos/tizen2.2/armv7l/ logs/fail/xf86-video-exynos-1.0.0-1/log.txt [ 139s] error: db4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139s] error: cannot open Packages index using db4 - (-30971) [ 139s] error: cannot open Packages database in /var/lib/rpm [ 139s] error: db4 error(-30971) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch [ 139s] error: cannot open Packages database in /var/lib/rpm 증상 : BUILD-ROOTS 에있는임시파일이서로꼬여버림 해법 : 빌드시 gbs 명령에서 --clean-once flag 를제거하고, --clean flag 를추가 ex. build.sh 의아래부분을수정 gbs build -A armv7l --include-all --clean build.sh