Tizen 3.0 GBS Local Fullbuild Guide

From Tizen Wiki
Jump to: navigation, search

Introduction

This document describes how to build Tizen 3.0 profile using GBS fullbuild and how to create Tizen images using MIC.
How to install GBS and MIC is well described in Tizen documentation.(https://source.tizen.org/documentation/reference/git-build-system, https://source.tizen.org/documentation/reference/mic-image-creator)

There are two ways to construct full source tree of Tizen 3.0

  • Use '*.src.rpm'
  • Use 'repo init' and 'repo sync'


Both methods will be introduced.
In this document, how to build Tizen:Common with arm-wayland repository and armv7l architecture will be described to give you an example.
How to create Tizen images using mic with RPMs created by GBS Local Fullbuild will be described in last chapter

GBS Local Fullbuild using '*.src.rpm'

Setup parameters

  • Select workspace : overall workspace
  • Select base_snapshot: snapshot url where pre-built rpms are published
  • Select srcrpm_snapshot: snapshot url where *.src.rpm (which you want to build) are published
  • Select buildsrc: path where tizen sources are constructed
  • Select dl_srcrpm: path where *.src.rpm will be downloaded
  • Select baserepo: path where pre-built rpms are downloaded
  • Select build_conf_dl: path where build.conf file is downloaded and used

Example

$ workspace=~/gbs_fullbuild
$ profile="3.0-common"
$ build_repository="arm-wayland"
$ src_snapshot_date=20170203.1
$ base_snapshot_date=20170120.1

$ srcrpm_snapshot=http://download.tizen.org/snapshots/tizen/$profile/tizen-${profile}_$src_snapshot_date/
$ base_snapshot=http://download.tizen.org/snapshots/tizen/3.0-base/tizen-3.0-base_$base_snapshot_date/
$ buildsrc=$workspace/tizen-${profile}/
$ dl_srcrpm=$buildsrc/srcrpm
$ baserepo=$workspace/pre-built/toolchain-arm/
$ build_conf_dl=$workspace/scm/meta/build-config/

$ mkdir -p $workspace $buildsrc $dl_srcrpm $baserepo $build_conf_dl
$ cd $workspace


Download build.conf

  • Set build.conf file used in gbs building from srcrpm_snapshot/repos/arm-wayland/packages/repodata/ to $build_conf_dl
  • Find xxxx-build.conf.gz file from $srcrpm_snapshot/repos/arm-wayland/packages/repodata/
  • Download xxxx-build.conf.gz file from $ srcrpm_snapshot/repos/arm-wayland/packages/repodata/
  • unzip xxxx-build.conf.gz file
  • mv xxxx-build.conf build.conf
  • Set build.conf file used in gbs building as $build_conf_dl/build.conf

Example

$ pushd $build_conf_dl
$ build_conf_file=$(curl $srcrpm_snapshot/repos/$build_repository/packages/repodata/ | grep build.conf | awk -F\" '{print $6}')
$ wget $srcrpm_snapshot/repos/$build_repository/packages/repodata/$build_conf_file
$ gzip -d $build_conf_file
$ mv *-build.conf build.conf
$ buildconf=$build_conf_dl/build.conf
$ popd


Download pre-built RPMs

  • Download all the RPMs in $base_snapshot/repos/arm/packages/ to $baserepo. After this procedure, check all the RPMs are well downloaded in $baserepo.

Example

$ wget --directory-prefix=$baserepo --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 $base_snapshot/repos/arm/packages/


Construct full source tree

  • Download all the *.src.rpm in $srcrpm_snapshot/repos/arm-wayland/source to $dl_srcrpm
  • 'gbs import' for all *.src.rpm in $dl_srcrpm to $buildsrc : After this procedure, check all the packages are imported in $buildsrc

Example

$ wget --directory-prefix=$dl_srcrpm --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 $srcrpm_snapshot/repos/$build_repository/source
$ pushd $buildsrc
$ for src in $(ls $dl_srcrpm/*.src.rpm);do gbs import $src;done
$ popd


Configure .gbs.conf file

  • Configure $buildsrc/.gbs.conf file with above setting

Example

$ gbs_conf_file=$buildsrc/.gbs.conf

$ echo "[general]
profile = profile.tizen_${profile}

[profile.tizen_${profile}]
repos = repo.base
buildroot=$workspace/GBS-ROOT/
buildconf=$build_conf_dl/build.conf

[repo.base]
url = $baserepo" > $gbs_conf_file


GBS build

  • cd $buildsrc and gbs build with build option you want

Example

$ cd $buildsrc 
$ gbs build -A armv7l --threads=28 --include-all




GBS Local Fullbuild using 'repo init' and 'repo sync'

Setup parameters

  • Select workspace : overall workspace
  • Select base_snapshot: snapshot url where pre-built rpms are published
  • Select srcrpm_snapshot: snapshot url where *.src.rpm (which you want to build) are published
  • Select baserepo: path where pre-built rpms are downloaded
  • Select build_conf_dl: path where build.conf file is downloaded and used

Example

$ workspace=~/gbs_fullbuild
$ profile="3.0-common"
$ build_repository=arm-wayland
$ src_snapshot_date=20170203.1
$ base_snapshot_date=20170120.1

$ srcrpm_snapshot=http://download.tizen.org/snapshots/tizen/$profile/tizen-${profile}_$src_snapshot_date/
$ base_snapshot=http://download.tizen.org/snapshots/tizen/3.0-base/tizen-3.0-base_$base_snapshot_date/
$ baserepo=$workspace/pre-built/toolchain-arm/
$ build_conf_dl=$workspace/scm/meta/build-config/

$ mkdir -p $workspace
$ cd $workspace


'repo init' and 'repo sync'

  • repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b <branch_name> -m <profile>.xml
  • replace projects.xml file inside $workspace/.repo/ to manifest file in $srcrpm_snapshot
  • repo sync

Example

$ Username=xxxx
$ repo init -u ssh://$Username@review.tizen.org:29418/scm/manifest -b tizen -m common.xml 

$ pushd $workspace/.repo/manifests/common/
$ wget $srcrpm_snapshot/builddata/manifest/tizen-${profile}_${src_snapshot_date}_$build_repository.xml
$ mv tizen-${profile}_${src_snapshot_date}_$build_repository.xml projects.xml
$ popd

$ repo sync

When there is en error in 'repo sync', check first of all whether git project name inside projects.xml exists in review.tizen.org or not.

Download build.conf

  • Download xxxx-build.conf.gz from $ srcrpm_snapshot/repos/arm-wayland/packages/repodata/ to $workspace/scm/meta/build-config
  • unzip xxxx-build.conf.gz file
  • replace $workspace/scm/meta/build-config/build.conf to xxxx-build.conf.gz

Example

$ pushd $build_conf_dl
$ build_conf_file=$(curl $srcrpm_snapshot/repos/$build_repository/packages/repodata/ | grep build.conf | awk -F\" '{print $6}')
$ wget $srcrpm_snapshot/repos/$build_repository/packages/repodata/$build_conf_file
$ gzip -d $build_conf_file
$ mv *-build.conf build.conf
$ buildconf=$build_conf_dl/build.conf
$ popd


Download pre-built RPMs (Recommendation, Not mandatory)

  • Delete all the files in $workspace/pre-built/
  • Download all the RPMs in $base_snapshot/repos/arm/packages/ to $baserepo. After this procedure, check all the RPMs are well downloaded in $baserepo.

Example

$ rm -rf $workspace/pre-built/*
$ wget --directory-prefix=$baserepo --mirror --reject index.html* -r -nH --no-parent --cut-dirs=8 $base_snapshot/repos/arm/packages/


Configure .gbs.conf file

  • Configure $workspace/.gbs.conf file with above setting

Example

$ gbs_conf_file=$workspace/.gbs.conf

$ echo "[general]
profile = profile.tizen_${profile}

[profile.tizen_${profile}]
repos = repo.base
buildroot=$workspace/GBS-ROOT/
buildconf=$build_conf_dl/build.conf

[repo.base]
url = $baserepo" > $gbs_conf_file


GBS build

  • cd $workspace and run gbs build with build option you want

Example

$ cd $workspace
$ gbs build -A armv7l --threads=28 --include-all




Image creation using MIC

Setup parameters

  • Select workspace : overall workspace
  • Select target_image : one of target image in $srcrpm_snapshot/images/arm-wayland
  • Select workspace for mic : overall workspace for mic
  • Select mic_images: path where images are created
  • Select mic_ks_files: path where *.ks files are downloaded
  • Select mic_logs: path where mic log files are saved
  • Select srcrpm_snapshot which is used in GBS Local Fullbuild
  • Select baserepo: path which is used in GBS Local Fullbuild

Example

$ workspace=~/gbs_fullbuild
$ profile="3.0-common"
$ build_repository=arm-wayland
$ target_image=common-wayland-3parts-armv7l-odroidu3
$ src_snapshot_date=20170203.1

$ mic_workspace=$workspace/mic_workspace
$ mic_images=$mic_workspace/images
$ ks_file_dir=$mic_workspace/builddata/image-configs
$ mic_logs=$mic_workspace/builddata/logs

$ srcrpm_snapshot=http://download.tizen.org/snapshots/tizen/$profile/tizen-${profile}_$src_snapshot_date/
$ baserepo=$workspace/pre-built/toolchain-arm/

$ mkdir -p $mic_workspace $mic_images $mic_ks_files $mic_logs
$ cd $mic_workspace

$ mkdir -p $mic_workspace $mic_images $mic_ks_files $mic_logs


Download ks file

  • Download ks file what you want from $srcrpm_snapshot/images
  • To use RPMs which are built by GBS Local Fullbuild in image creation, modify baseurl of 'repo' in ks file
  • Add '--priority=99' to profile related repo to download mic-bootstrap
  • Add 'local' repo in ks file whose baseurl is path of GBS fullbuild results RPMs
  • Replace baseurl of 'base' repo in ks file from remote_url to $baserepo
  • Create repo and repodata from $baserepo to be used in ks file

Example

$ ks_file_name=$(curl $mic_ks_files $srcrpm_snapshot/images/$build_repository/$target_image/ | grep .ks | awk -F\" '{print $6}')
$ wget --directory-prefix=$ks_file_dir $srcrpm_snapshot/images/$build_repository/$target_image/$ks_file_name
#original ks file
repo --name=common-wayland_armv7l --baseurl=http://download.tizen.org/snapshots/tizen/3.0-common/tizen-3.0-common_20170203.1/repos/arm-wayland/packages/ --ssl_verify=no
repo --name=base_arm --baseurl=http://download.tizen.org/snapshots/tizen/3.0-base/latest/repos/arm/packages/ --ssl_verify=no
#modified ks file
repo --name=common-wayland_armv7l --baseurl=http://download.tizen.org/snapshots/tizen/3.0-common/tizen-3.0-common_20170203.1/repos/arm-wayland/packages/ --ssl_verify=no --priority=99
repo --name=base_arm --baseurl=file://$baserepo --priority=1
repo --name=common-wayland_armv7l --baseurl=file://$workspace/GBS-ROOT/local/repos/tizen_${profile}/armv7l --priority=1


Run mic

  • Run mic with option what you want
$ sudo mic cr auto $ks_file_dir/$ks_file_name --logfile=$mic_logs/$target_image.log -o $mic_images