http://blog.csdn.net/flydream0/article/details/9004746

前一篇文章已经介绍了如何下载tizen源码(http://blog.csdn.net/flydream0/article/details/8996654),下面我将继续讲述如何编译源码.

1 下载安装gbs编译工具

tizen源码是用gbs工具进行编译的,因此我们首先得将此工具下载下来,并且设置好。

下面以Ubuntu12.04版本为例.

1.1 添加gbs的源

用vim打开source.list文件:

  1. $ sudo vim /etc/apt/sources.list

在最后添加两行:

  1. deb http://download.tizen.org/tools/latest-release/Ubuntu_12.04/ /
  2. deb-src http://download.tizen.org/tools/latest-release/Ubuntu_12.04/ /

如下图:

然后更新源:

  1. $sudo apt-get update

安装gbs工具:

  1. $sudo apt-get install gbs

可以相看当前gbs的版本:

  1. $ gbs -V
  2. gbs 0.16

1.2 修改.gbs.config文件

安装完gbs工具后,会在用户目录下生成一隐藏文件.gbs.config文件,用vim打开:

  1. $vim .gbs.config

初始安装gbs后的.gbs.config文件的默认内容如下:

  1. [general]
  2. #Current profile name which should match a profile section name
  3. profile = profile.tizen
  4. [profile.tizen]
  5. #Common authentication info for whole profile
  6. #user =
  7. #CAUTION: please use the key name "passwd" to reset plaintext password
  8. #passwd =
  9. obs = obs.tizen
  10. #Comma separated list of repositories
  11. repos = repo.tizen_latest
  12. #repos = repo.tizen_main, repo.tizen_base
  13. [obs.tizen]
  14. #OBS API URL pointing to a remote OBS.
  15. url = https://api.tizen.org
  16. #Optional user and password, set if differ from profile's user and password
  17. #user =
  18. #passwd =
  19. #Repo section example
  20. [repo.tizen_latest]
  21. #Build against repo's URL
  22. url = http://download.tizen.org/releases/daily/trunk/ivi/latest/
  23. #Optional user and password, set if differ from profile's user and password
  24. #user =
  25. #passwd =
  26. #Individual repo is also supported
  27. #[repo.tizen_base]
  28. #url = http://download.tizen.org/releases/daily/trunk/ivi/latest/repos/base/ia32/packages/
  29. #[repo.tizen_main]
  30. #url = http://download.tizen.org/releases/daily/trunk/ivi/latest/repos/ivi/ia32/packages/

修改为:

  1. [general]
  2. #Current profile name which should match a profile section name
  3. profile = profile.tizen
  4. [profile.tizen]
  5. #Common authentication info for whole profile
  6. #user =
  7. #CAUTION: please use the key name "passwd" to reset plaintext password
  8. #passwd =
  9. obs = obs.tizen
  10. #Comma separated list of repositories
  11. #repos = repo.tizen_latest
  12. repos = repo.tizen_main, repo.tizen_base
  13. [obs.tizen]
  14. #OBS API URL pointing to a remote OBS.
  15. url = https://api.tizen.org
  16. #Optional user and password, set if differ from profile's user and password
  17. #user =
  18. #passwd =
  19. #Repo section example
  20. #[repo.tizen_latest]
  21. #Build against repo's URL
  22. #url = http://download.tizen.org/releases/daily/trunk/ivi/latest/
  23. #Optional user and password, set if differ from profile's user and password
  24. #user =
  25. #passwd =
  26. #Individual repo is also supported
  27. [repo.tizen_base]
  28. #url = http://download.tizen.org/releases/daily/trunk/ivi/latest/repos/base/ia32/packages/
  29. url = http://download.tizen.org/releases/daily/2.0alpha/ivi-wayland/tizen-2.0alpha_20130522.2/repos/base/ia32/packages/
  30. [repo.tizen_main]
  31. #url = http://download.tizen.org/releases/daily/trunk/ivi/latest/repos/ivi/ia32/packages/
  32. url = http://download.tizen.org/releases/daily/2.0alpha/ivi-wayland/tizen-2.0alpha_20130522.2/repos/ivi-wayland/ia32/packages/

有关.gbs.config文件的格式说明请参照:http://blog.csdn.net/flydream0/article/details/9018443

2 本地编译源码

编译要求:

OS:Ubuntu12.04(64位)

内存:至少4G

Swap(交换分区大小):至少4G

注:内存和Swap大小都必要至少4G以上,不然会编译不过。操作系统必须是64位的,虽然在32位下也能源码编译通过,但是到后续制作镜像文件(使用mic工具时)会失败。

2.1 编译所有工程

输入如下指令进行编译:

cd到profile目录下, 然后通过如下指令对整个profile进行编译.

  1. $ gbs build -A i586

接下来要花很长一段时间才能编译完。

编译完后如下界面:

2.2 编译单个工程

当然也可以只针对某个project进行编译,方法很简单,只需要cd到某个project的根目录,然后使用

$gbs build -A i586

即可。

2.3 编译后的输出目录

在默认情况下,gbs build后将用户的工作目录(即~/)下生成GBS-ROOT目录保存下载或编译后的结果。如下:

  1. $ tree GBS-ROOT/ -L 3
  2. GBS-ROOT/
  3. └── local
  4. ├── BUILD-ROOTS
  5. │   └── scratch.i586.0
  6. ├── cache
  7. │   ├── f55c091634900cdc0c89559765a7b82f
  8. │   └── f92daa70cae15fb8d7f50595bc454ce0
  9. ├── order
  10. ├── repos
  11. │   └── tizen2.0alpha
  12. └── sources
  13. └── tizen2.0alpha

其中repos目录保存着RPM包:

  1. $ tree repos/ -L 3
  2. repos/
  3. └── tizen2.0alpha
  4. └── i586
  5. ├── logs
  6. ├── repodata
  7. ├── RPMS
  8. └── SRPMS

其中RPMS和SRPMS保存着编译后的结果RPM包,这些包为下一步制作镜像文件提供RPM包。

3 远程编译源码

tizen
源码不但可以在本地进行编译,还可以使用远程编译。所谓远程编译就是将本地的修改自动上传到远程服务器OBS进行编译。对于tizen源码,使用gbs
remotebuild指令来进行相关操作。这对于本地PC资源达不到要求的情况是十分有用的,只可惜远程编译需要授权才能进行,而目前我没有可以使用的
用户名和密码,因此,没有试验成功过。

有关如何制作镜像文件我将在后续文章中描述,敬请关注!

[转]如何编译tizen源码(图文教程)?的更多相关文章

  1. 如何编译tizen源码(图文教程)?

    前一篇文章已经介绍了如何下载tizen源码,下面我将继续讲述如何编译源码. 1 下载安装gbs编译工具 tizen源码是用gbs工具进行编译的,因此我们首先得将此工具下载下来,并且设置好. 下面的Ub ...

  2. [转]如何下载tizen源码(图文教程)?

    http://blog.csdn.net/flydream0/article/details/8996654 当前tizen发布的最新源码版本是2.1,本文将以图文教程讲述如何下载tizen源码,关于 ...

  3. 编译android源码官方教程(2)建立编译环境「linux & mac osx」

    https://source.android.com/source/initializing.html Establishing a Build Environment IN THIS DOCUMEN ...

  4. 编译android源码官方教程(6)编译内核

    Building Kernels IN THIS DOCUMENT Selecting a kernel Identifying kernel version Downloading sources ...

  5. 编译android源码官方教程(5)编译完之后刷机、编译fastboot

    Running Builds IN THIS DOCUMENT Building fastboot and adb Booting into fastboot mode Unlocking the b ...

  6. 编译android源码官方教程(4)开始编译

    Preparing to Build IN THIS DOCUMENT Obtain proprietary binaries Download proprietary binaries Extrac ...

  7. 编译android源码官方教程(3)下载代码

    https://source.android.com/source/downloading.html Downloading the Source IN THIS DOCUMENT Installin ...

  8. 编译android源码官方教程(1)硬件、系统要求

    https://source.android.com/source/requirements.html Requirements IN THIS DOCUMENT Hardware requireme ...

  9. 在Ubuntu-14.04.3配置并成功编译Android6_r1源码

    折腾了一周,终于把Android6_r1的源码编译成功.先上图,这是在ubuntu中运行的Android模拟器: 由于我是在win8中安装虚拟机VMware,然后在虚拟机中安装Ubuntu进行编译,所 ...

随机推荐

  1. DIV 布局 左中右

    <style type="text/css">body{ margin:0; padding:0;}.Header{ height:100px; background: ...

  2. jquery操作复选框(checkbox)

    1.获取单个checkbox选中项(三种写法)$("input:checkbox:checked").val()或者$("input:[type='checkbox']: ...

  3. Rule of write code with C# in Unity3d

    Good Practice 普通的Public变量可以在inspect里显示,变量是可以在inspect里赋值并realtime反映在被attach到的GameObject上的.注意经典public ...

  4. 第三章TP-Link 703N OpenWrt设置网络

    默认情况下不开启wifi,另外需要连接到网络来安装软件,所以需要修正配置文件. 可以用vi修改相关配置(不会用vim的同学悲剧了). 首先修改/etc/config/wireless文件,注释掉 # ...

  5. :app:transformResourcesWithMergeJavaResForDebug FAILED

    资源xml有错误,应该排查每一处xml. 如果提示gradle相关错误,需要修改系统级的build.gradle和程序级的build.gradle,比如后者不能缺少:dependencies {    ...

  6. 防火墙没关导致 ORA-12541: TNS: 无监听程序

    电脑用着用着突然Oracle就报出下面的错误,按照网上的办法搞了几个小时都没有搞好. Oracle重装了好几次也没用,实在没办法又花了个多小时装了个虚机,结果也是同样的错误. 于是恍然大悟,可能是物理 ...

  7. java substring和substr

    1.substring 方法 定义和用法 substring 方法用于提取字符串中介于两个指定下标之间的字符. 语法 stringObject.substring(start,stop) 参数     ...

  8. AnimImageView

    https://github.com/eltld/AnimImageView

  9. MySql服务器的启动和关闭

    转自:http://zqding.iteye.com/blog/1562095 在windows下: 启动: .cd c:\mysql\bin .mysqld --console 关闭: .cd c: ...

  10. GXPT(一)——UI设计

    通过长时间的积淀.TGB再次開始GXPT模式,JAVA版..NET版两条线同一时候进行. 纯面向对象的底层架构的搭建:easyUI+MVC的界面设计:工作流的再次雄起.云平台的构想:Confluenc ...