Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Creating new Tizen profiles using the Yocto Project

3,719 views

Published on

Presentation for Tizen Developer Conference 2015 Shenzhen.

Tizen is an open source Linux based software platform for Internet of Things, mobile, wearable and embedded devices. Tizen:Common provides a generic development environment for Tizen 3 which key features include Wayland, Weston, EFL, and the Crosswalk web runtime. The Yocto Project offers easy to use tools to create meta layers for new Tizen 3 profiles that inherit and expand the features of Tizen:Common. This talk will focus the Tizen architecture and it will provide guidelines for creating and building new Tizen profiles, based on Tizen:Common, using the Yocto Project for devices with Intel or ARM processors. It will also provide information about hidden gems in Tizen on Yocto and practical examples for packaging and deploying HTML5 applications through Yocto recipes for the open source hardware development boards MinnowBoard Max (Intel) and Humming Board (Freescale I.MX6 ARM SoC).

Published in: Software
  • Be the first to comment

Creating new Tizen profiles using the Yocto Project

  1. 1. Creating new Tizen profiles using the Yocto Project Leon Anavi Konsulko Group
  2. 2. Leon Anavi ● Software engineer and open source enthusiast ● E-mail: leon@anavi.org ; leon.anavi@konsulko.com
  3. 3. Overview ● Tizen Profiles ● The Yocto Project ● Building Tizen on Yocto ● Creating new meta layers and recipes for Tizen ● Contributing to Tizen on Yocto
  4. 4. Tizen ● Open source Linux-based software platform ● Project of the Linux foundation ● Compatible with ARM and Intel architectures ● Excellent HTML5 and web apps support ● Suitable of all device areas: mobile, wearable, embedded, IVI, IoT, etc.
  5. 5. Tizen Versions Tizen 1.0 Larkspur Tizen 2 Tizen 3 (upstream)
  6. 6. Tizen 3 Profiles Mobile TV Wearable IVI Tizen:Common
  7. 7. Tizen Architecture Web applications Web framework Native framework Core components Linux kernel and device drivers Native applications
  8. 8. Tizen 3 Key Features and Core Components ● Linux kernel 3.14 LTS (or newer) ● Security: SMACK and Cynara ● Systemd ● Wayland & Weston ● Crosswalk web runtime ● EFL ● RPM
  9. 9. Crosswalk ● Open source web runtime for all Tizen 3 profile based on Tizen:Common ● Up to date version of Blink and Chromium ● Up to date JavaScript APIs based on the web standards ● Tizen specific JavaScript APIs ● https://crosswalk-project.org/
  10. 10. How to Build Tizen 3? ● Git Build System (GBS) ● Tizen on Yocto System requirements: ● Intel Core i7 CPU (or better) ● 8GB RAM (or more) ● GNU/Linux distribution
  11. 11. The Yocto Project ● Open source collaborative project for creating custom Linux-based systems for embedded devices. ● Based on the OpenEmbedded build framework ● Project of the Linux Foundation Getting started: ● https://www.yoctoproject.org/ ● https://www.yoctoproject.org/documentation
  12. 12. Advantages of the Yocto Project ● Represents a whole GNU/Linux distribution as a simple and easy to extend configuration ● Existing Board Support Packages (BSP) for various architectures and numerous devices ● De facto industry standard for automotive, embedded devices, and Internet of Things (IoT) ● Large community
  13. 13. Yocto Project Development Environment Image courtesy of the Yocto Project official documentation
  14. 14. Releases of the Yocto Project ● Yocto Project 2.0 Jethro (expected release date 30 Oct) ● Yocto Project 1.8 Fido ● Yocto Project 1.7 Dizzy (used by Tizen on Yocto) ● Yocto Project 1.6 Daisy ● Yocto Project 1.5 Dora ● Yocto Project 1.4 Dylan
  15. 15. Tizen on Yocto Project ● Project which aims at building Tizen images using the tools provided by the Yocto Project ● Provides Tizen distribution layer (meta-tizen) for Yocto/OpenEmbedded ● Maintainers: Mauro Carvalho Chehab, Leon Anavi Getting started: ● https://wiki.tizen.org/wiki/Build_Tizen_with_Yocto_Project ● https://wiki.tizen.org/wiki/Tizen_on_Yocto_Project
  16. 16. Tizen on Yocto Supported Devices Supported single board computers: ● MinnowBoard MAX ● Raspberry Pi 2 http://git.s-osg.org/tizen-distro.git/ ● HummingBoard https://github.com/konsulko/tizen-distro ● Easy porting to other ARM and Intel devices Useful links: ● https://wiki.tizen.org/wiki/MinnowMax ● https://wiki.tizen.org/wiki/HummingBoard ● http://blogs.s-osg.org/tizen-on-rpi2/
  17. 17. Building Tizen on Yocto (1/3) ● Download tizen-distro ● Download meta layers with additional board support packages (BSP) ● Initialize build environment source ./tizen-common-init-build-env build-common git clone git://review.tizen.org/scm/bb/tizen-distro cd tizen-distro
  18. 18. Building Tizen on Yocto (2/3) ● Configure conf/local.conf ● Add BSP meta layers to conf/bblayers.conf MACHINE ??= "intel-corei7-64" PARALLEL_MAKE ?= "-j 8" BB_NUMBER_THREADS ?= "8" ...
  19. 19. Building Tizen on Yocto (3/3) ● Build an image ● Get some coffee... ● Grab the generated image from tmp-glibc/deploy/images/${MACHINE} bitbake tizen-common-core-image-crosswalk-dev
  20. 20. Bitbake Cheat Sheet ● Check value of a variable in a recipe ● Check recipe version ● Build a package or an image ● Clean up ● Recompile if the source has been changed ● Output dependency tree in graphviz format bitbake tizen-common-core-image-crosswalk -e | grep ^ROOTFS_PKGMANAGE bitbake -s | grep crosswalk bitbake -c compile foo bitbake -g tizen-common-core-image-crosswalk bitbake foo bitbake -c clean foo
  21. 21. Adding Packages to Tizen Image ● Append packages, for example ofono and ofono-test, to image by adding the following command to conf/local.conf or the image's recipe: IMAGE_INSTALL_append = " ofono ofono-test "
  22. 22. Runtime Package Management (1/2) ● Setup package feed on the build machine sudo apt-get install apache2 sudo mkdir /var/www/html/tizen/ sudo ln -s ~/tizen-distro/build/tmp-glibc/deploy/rpm/ /var/www/html/tizen/ bitbake package-index
  23. 23. Runtime Package Management (2/2) ● Setup channels of the smart package manager on the Tizen device and manage packages ● More information and examples: https://wiki.tizen.org/wiki/Runtime_package_management_in_Tizen_on_Yocto_with_Smart smart channel --add tizen-all type=rpm-md baseurl=http://<server>/tizen/rpm/all/ smart update smart install <package_name>
  24. 24. Creating New Meta Layer (1/2) ● Create new meta layer using script yocto-layer ./scripts/yocto-layer create newprofile Please enter the layer priority you'd like to use for the layer: [default: 6] Would you like to have an example recipe created? (y/n) [default: n] Would you like to have an example bbappend file created? (y/n) [default: n] New layer created in meta-newprofile. Don't forget to add it to your BBLAYERS (for details see meta-newprofileREADME).
  25. 25. Creating New Meta Layer (2/2) ● Add meta data to the new layer ● Add the new layer to conf/bblayers.conf
  26. 26. Extending a Recipe ● Append instructions at the end of existing recipe in .bbappend file ● Apply a patch, for example: ● Add new files, for example: FILESEXTRAPATHS_prepend := "{THISDIR}/${PN}:${PV}:" SRC_URI += "file://mypatch.patch" FILESEXTRAPATHS_prepend := "{THISDIR}/${PN}:${PV}:" SRC_URI += "file://my.conf" do_install_append() { install -m 644 ${WORKDIR}/my.conf ${D}${sysconfdir} }
  27. 27. Writing a New Recipe ● Create new recipe with name that matches the format: ● Use and modify the following skeleton recipe: ● Modify tasks (do_compile, do_install, etc.) if needed ● Store path to the recipe at layer's conf/layer.conf <basename>_<version>.bb SUMMARY = "" HOMEPAGE = "" LICENSE = "" LIC_FILES_CHKSUM = "" SRC_URI = "" SRC_URI[md5sum] = "" SRC_URI[sha256sum] = "" S = "${WORKDIR}/${PN}${PV}" inherit <stuff>
  28. 28. HTML5 Application Management in Tizen 3 ● Install wgt file ● List installed HTML5 applications (per user) ● Launch HTML5 application in Crosswalk ● Kill running HTML5 application ● Uninstall application pkgcmd -i -t wgt -p <wgt file> -q app_launcher -l app_launcher -s <Application ID> app_launcher -k <Application ID> pkgcmd -u -q -n <package>
  29. 29. Creating New Recipe for HTML5 App (1/2) ● Develop HTML5 Tizen app with icon.png & config.xml ● Create new recipe and reimplement do_install ● Ship wgt file hello_files = "" hello_files += "/opt/usr/apps/.preinstallWidgets/hello.wgt" do_install() { cd ${S} rm -rf ${D} mkdir -p ${D} mkdir -p ${D}/opt/usr/apps/.preinstallWidgets mkdir -p ${D}${prefix}/share/apps/Common/icons zip -r ${D}/opt/usr/apps/.preinstallWidgets/hello.wgt css icon.png config.xml index.html README.txt }
  30. 30. Creating New Recipe for HTML5 App (2/2) ● Create script that installs hello.wgt using pkgcmd ● Create oneshot systemd service that launches the install script at first boot of the device and removes itself upon successful completion of the script ● Create recipe that provides the install script and the systemd service
  31. 31. Contributing to Tizen on Yocto (1/2) ● Tizen-distro uses combo-layer script git://git.tizen.org/scm/bb/tizen-distro ● Tizen-distro layers: bitbake, openembedded-core, meta-openembedded, meta-qt5, meta-tizen ● Meta-tizen git://git.tizen.org/scm/bb/meta-tizen
  32. 32. Contributing to Tizen on Yocto (2/2) ● Git (revision control system) ● Gerrit (web-based code review tool) https://review.tizen.org/gerrit/ ● JIRA https://bugs.tizen.org/ ● Step by step instructions for contributors https://wiki.tizen.org/wiki/How_to_contribute_to_Tizen_on_Yocto_Project
  33. 33. Thank you! Questions? Slides (license: CC BY-SA 3.0) http://www.slideshare.net/leonanavi/creating-new-tizen-profiles-using-the-yocto-project Images under CC BY 3.0 from flaticon.com have been used in some of the slides.

×