Yocto Project Reference Manual

Scott Rifenbark

Scotty's Documentation Services, INC

Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-Share Alike 2.0 UK: England & Wales as published by Creative Commons.

Manual Notes

  • This version of the Yocto Project Reference Manual is for the 2.6 release of the Yocto Project. To be sure you have the latest version of the manual for this release, go to the Yocto Project documentation page and select the manual from that site. Manuals from the site are more up-to-date than manuals derived from the Yocto Project released TAR files.

  • If you located this manual through a web search, the version of the manual might not be the one you want (e.g. the search might have returned a manual much older than the Yocto Project version with which you are working). You can see all Yocto Project major releases by visiting the Releases page. If you need a version of this manual for a different Yocto Project release, visit the Yocto Project documentation page and select the manual set by using the "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE" pull-down menus.

  • To report any inaccuracies or problems with this manual, send an email to the Yocto Project discussion group at yocto@yoctoproject.com or log into the freenode #yocto channel.

Revision History
Revision 4.0+git24 November 2010
Released with the Yocto Project 0.9 Release
Revision 1.06 April 2011
Released with the Yocto Project 1.0 Release.
Revision 1.0.123 May 2011
Released with the Yocto Project 1.0.1 Release.
Revision 1.16 October 2011
Released with the Yocto Project 1.1 Release.
Revision 1.2April 2012
Released with the Yocto Project 1.2 Release.
Revision 1.3October 2012
Released with the Yocto Project 1.3 Release.
Revision 1.4April 2013
Released with the Yocto Project 1.4 Release.
Revision 1.5October 2013
Released with the Yocto Project 1.5 Release.
Revision 1.5.1January 2014
Released with the Yocto Project 1.5.1 Release.
Revision 1.6April 2014
Released with the Yocto Project 1.6 Release.
Revision 1.7October 2014
Released with the Yocto Project 1.7 Release.
Revision 1.8April 2015
Released with the Yocto Project 1.8 Release.
Revision 2.0October 2015
Released with the Yocto Project 2.0 Release.
Revision 2.1April 2016
Released with the Yocto Project 2.1 Release.
Revision 2.2October 2016
Released with the Yocto Project 2.2 Release.
Revision 2.3May 2017
Released with the Yocto Project 2.3 Release.
Revision 2.4October 2017
Released with the Yocto Project 2.4 Release.
Revision 2.5May 2018
Released with the Yocto Project 2.5 Release.
Revision 2.6November 2018
Released with the Yocto Project 2.6 Release.

Table of Contents

1. System Requirements
1.1. Supported Linux Distributions
1.2. Required Packages for the Build Host
1.2.1. Ubuntu and Debian
1.2.2. Fedora Packages
1.2.3. openSUSE Packages
1.2.4. CentOS Packages
1.3. Required Git, tar, and Python Versions
1.3.1. Downloading a Pre-Built buildtools Tarball
1.3.2. Building Your Own buildtools Tarball
2. Yocto Project Terms
3. Yocto Project Releases and the Stable Release Process
3.1. Major and Minor Release Cadence
3.2. Major Release Codenames
3.3. Stable Release Process
3.4. Testing and Quality Assurance
4. Migrating to a Newer Yocto Project Release
4.1. General Migration Considerations
4.2. Moving to the Yocto Project 1.3 Release
4.2.1. Local Configuration
4.2.2. Recipes
4.2.3. Linux Kernel Naming
4.3. Moving to the Yocto Project 1.4 Release
4.3.1. BitBake
4.3.2. Build Behavior
4.3.3. Proxies and Fetching Source
4.3.4. Custom Interfaces File (netbase change)
4.3.5. Remote Debugging
4.3.6. Variables
4.3.7. Target Package Management with RPM
4.3.8. Recipes Moved
4.3.9. Removals and Renames
4.4. Moving to the Yocto Project 1.5 Release
4.4.1. Host Dependency Changes
4.4.2. atom-pc Board Support Package (BSP)
4.4.3. BitBake
4.4.4. QA Warnings
4.4.5. Directory Layout Changes
4.4.6. Shortened Git SRCREV Values
4.4.7. IMAGE_FEATURES
4.4.8. /run
4.4.9. Removal of Package Manager Database Within Image Recipes
4.4.10. Images Now Rebuild Only on Changes Instead of Every Time
4.4.11. Task Recipes
4.4.12. BusyBox
4.4.13. Automated Image Testing
4.4.14. Build History
4.4.15. udev
4.4.16. Removed and Renamed Recipes
4.4.17. Other Changes
4.5. Moving to the Yocto Project 1.6 Release
4.5.1. archiver Class
4.5.2. Packaging Changes
4.5.3. BitBake
4.5.4. Changes to Variables
4.5.5. Package Test (ptest)
4.5.6. Build Changes
4.5.7. qemu-native
4.5.8. core-image-basic
4.5.9. Licensing
4.5.10. CFLAGS Options
4.5.11. Custom Image Output Types
4.5.12. Tasks
4.5.13. update-alternative Provider
4.5.14. virtclass Overrides
4.5.15. Removed and Renamed Recipes
4.5.16. Removed Classes
4.5.17. Reference Board Support Packages (BSPs)
4.6. Moving to the Yocto Project 1.7 Release
4.6.1. Changes to Setting QEMU PACKAGECONFIG Options in local.conf
4.6.2. Minimum Git version
4.6.3. Autotools Class Changes
4.6.4. Binary Configuration Scripts Disabled
4.6.5. eglibc 2.19 Replaced with glibc 2.20
4.6.6. Kernel Module Autoloading
4.6.7. QA Check Changes
4.6.8. Removed Recipes
4.6.9. Miscellaneous Changes
4.7. Moving to the Yocto Project 1.8 Release
4.7.1. Removed Recipes
4.7.2. BlueZ 4.x / 5.x Selection
4.7.3. Kernel Build Changes
4.7.4. SSL 3.0 is Now Disabled in OpenSSL
4.7.5. Default Sysroot Poisoning
4.7.6. Rebuild Improvements
4.7.7. QA Check and Validation Changes
4.7.8. Miscellaneous Changes
4.8. Moving to the Yocto Project 2.0 Release
4.8.1. GCC 5
4.8.2. Gstreamer 0.10 Removed
4.8.3. Removed Recipes
4.8.4. BitBake datastore improvements
4.8.5. Shell Message Function Changes
4.8.6. Extra Development/Debug Package Cleanup
4.8.7. Recipe Maintenance Tracking Data Moved to OE-Core
4.8.8. Automatic Stale Sysroot File Cleanup
4.8.9. linux-yocto Kernel Metadata Repository Now Split from Source
4.8.10. Additional QA checks
4.8.11. Miscellaneous Changes
4.9. Moving to the Yocto Project 2.1 Release
4.9.1. Variable Expansion in Python Functions
4.9.2. Overrides Must Now be Lower-Case
4.9.3. Expand Parameter to getVar() and getVarFlag() is Now Mandatory
4.9.4. Makefile Environment Changes
4.9.5. libexecdir Reverted to ${prefix}/libexec
4.9.6. ac_cv_sizeof_off_t is No Longer Cached in Site Files
4.9.7. Image Generation is Now Split Out from Filesystem Generation
4.9.8. Removed Recipes
4.9.9. Class Changes
4.9.10. Build System User Interface Changes
4.9.11. ADT Removed
4.9.12. Poky Reference Distribution Changes
4.9.13. Packaging Changes
4.9.14. Tuning File Changes
4.9.15. Supporting GObject Introspection
4.9.16. Miscellaneous Changes
4.10. Moving to the Yocto Project 2.2 Release
4.10.1. Minimum Kernel Version
4.10.2. Staging Directories in Sysroot Has Been Simplified
4.10.3. Removal of Old Images and Other Files in tmp/deploy Now Enabled
4.10.4. Python Changes
4.10.5. uClibc Replaced by musl
4.10.6. ${B} No Longer Default Working Directory for Tasks
4.10.7. runqemu Ported to Python
4.10.8. Default Linker Hash Style Changed
4.10.9. KERNEL_IMAGE_BASE_NAME no Longer Uses KERNEL_IMAGETYPE
4.10.10. BitBake Changes
4.10.11. Swabber has Been Removed
4.10.12. Removed Recipes
4.10.13. Removed Classes
4.10.14. Minor Packaging Changes
4.10.15. Miscellaneous Changes
4.11. Moving to the Yocto Project 2.3 Release
4.11.1. Recipe-specific Sysroots
4.11.2. PATH Variable
4.11.3. Changes to Scripts
4.11.4. Changes to Functions
4.11.5. BitBake Changes
4.11.6. Absolute Symbolic Links
4.11.7. GPLv2 Versions of GPLv3 Recipes Moved
4.11.8. Package Management Changes
4.11.9. Removed Recipes
4.11.10. Wic Changes
4.11.11. QA Changes
4.11.12. Miscellaneous Changes
4.12. Moving to the Yocto Project 2.4 Release
4.12.1. Memory Resident Mode
4.12.2. Packaging Changes
4.12.3. Removed Recipes
4.12.4. Kernel Device Tree Move
4.12.5. Package QA Changes
4.12.6. README File Changes
4.12.7. Miscellaneous Changes
4.13. Moving to the Yocto Project 2.5 Release
4.13.1. Packaging Changes
4.13.2. Removed Recipes
4.13.3. Scripts and Tools Changes
4.13.4. BitBake Changes
4.13.5. Python and Python 3 Changes
4.13.6. Miscellaneous Changes
4.14. Moving to the Yocto Project 2.6 Release
4.14.1. GCC 8.2 is Now Used by Default
4.14.2. Removed Recipes
4.14.3. Packaging Changes
4.14.4. XOrg Protocol dependencies
4.14.5. distutils and distutils3 Now Prevent Fetching Dependencies During the do_configure Task
4.14.6. linux-yocto Configuration Audit Issues Now Correctly Reported
4.14.7. Image/Kernel Artifact Naming Changes
4.14.8. SERIAL_CONSOLE Deprecated
4.14.9. Configure Script Reports Unknown Options as Errors
4.14.10. Override Changes
4.14.11. systemd Configuration is Now Split Into systemd-conf
4.14.12. Automatic Testing Changes
4.14.13. OpenSSL Changes
4.14.14. BitBake Changes
4.14.15. Security Changes
4.14.16. Post Installation Changes
4.14.17. Python 3 Profile-Guided Optimization
4.14.18. Miscellaneous Changes
5. Source Directory Structure
5.1. Top-Level Core Components
5.1.1. bitbake/
5.1.2. build/
5.1.3. documentation/
5.1.4. meta/
5.1.5. meta-poky/
5.1.6. meta-yocto-bsp/
5.1.7. meta-selftest/
5.1.8. meta-skeleton/
5.1.9. scripts/
5.1.10. oe-init-build-env
5.1.11. LICENSE, README, and README.hardware
5.2. The Build Directory - build/
5.2.1. build/buildhistory
5.2.2. build/conf/local.conf
5.2.3. build/conf/bblayers.conf
5.2.4. build/conf/sanity_info
5.2.5. build/downloads/
5.2.6. build/sstate-cache/
5.2.7. build/tmp/
5.2.8. build/tmp/buildstats/
5.2.9. build/tmp/cache/
5.2.10. build/tmp/deploy/
5.2.11. build/tmp/deploy/deb/
5.2.12. build/tmp/deploy/rpm/
5.2.13. build/tmp/deploy/ipk/
5.2.14. build/tmp/deploy/licenses/
5.2.15. build/tmp/deploy/images/
5.2.16. build/tmp/deploy/sdk/
5.2.17. build/tmp/sstate-control/
5.2.18. build/tmp/sysroots-components/
5.2.19. build/tmp/sysroots/
5.2.20. build/tmp/stamps/
5.2.21. build/tmp/log/
5.2.22. build/tmp/work/
5.2.23. build/tmp/work/tunearch/recipename/version/
5.2.24. build/tmp/work-shared/
5.3. The Metadata - meta/
5.3.1. meta/classes/
5.3.2. meta/conf/
5.3.3. meta/conf/machine/
5.3.4. meta/conf/distro/
5.3.5. meta/conf/machine-sdk/
5.3.6. meta/files/
5.3.7. meta/lib/
5.3.8. meta/recipes-bsp/
5.3.9. meta/recipes-connectivity/
5.3.10. meta/recipes-core/
5.3.11. meta/recipes-devtools/
5.3.12. meta/recipes-extended/
5.3.13. meta/recipes-gnome/
5.3.14. meta/recipes-graphics/
5.3.15. meta/recipes-kernel/
5.3.16. meta/recipes-lsb4/
5.3.17. meta/recipes-multimedia/
5.3.18. meta/recipes-rt/
5.3.19. meta/recipes-sato/
5.3.20. meta/recipes-support/
5.3.21. meta/site/
5.3.22. meta/recipes.txt
6. Classes
6.1. allarch.bbclass
6.2. archiver.bbclass
6.3. autotools*.bbclass
6.4. base.bbclass
6.5. bash-completion.bbclass
6.6. bin_package.bbclass
6.7. binconfig.bbclass
6.8. binconfig-disabled.bbclass
6.9. blacklist.bbclass
6.10. bluetooth.bbclass
6.11. bugzilla.bbclass
6.12. buildhistory.bbclass
6.13. buildstats.bbclass
6.14. buildstats-summary.bbclass
6.15. ccache.bbclass
6.16. chrpath.bbclass
6.17. clutter.bbclass
6.18. cmake.bbclass
6.19. cml1.bbclass
6.20. compress_doc.bbclass
6.21. copyleft_compliance.bbclass
6.22. copyleft_filter.bbclass
6.23. core-image.bbclass
6.24. cpan*.bbclass
6.25. cross.bbclass
6.26. cross-canadian.bbclass
6.27. crosssdk.bbclass
6.28. debian.bbclass
6.29. deploy.bbclass
6.30. devshell.bbclass
6.31. devupstream.bbclass
6.32. distro_features_check.bbclass
6.33. distrodata.bbclass
6.34. distutils*.bbclass
6.35. distutils3*.bbclass
6.36. externalsrc.bbclass
6.37. extrausers.bbclass
6.38. fontcache.bbclass
6.39. fs-uuid.bbclass
6.40. gconf.bbclass
6.41. gettext.bbclass
6.42. gnome.bbclass
6.43. gnomebase.bbclass
6.44. gobject-introspection.bbclass
6.45. grub-efi.bbclass
6.46. gsettings.bbclass
6.47. gtk-doc.bbclass
6.48. gtk-icon-cache.bbclass
6.49. gtk-immodules-cache.bbclass
6.50. gzipnative.bbclass
6.51. icecc.bbclass
6.52. image.bbclass
6.53. image-buildinfo.bbclass
6.54. image_types.bbclass
6.55. image-live.bbclass
6.56. image-mklibs.bbclass
6.57. image-prelink.bbclass
6.58. insane.bbclass
6.59. insserv.bbclass
6.60. kernel.bbclass
6.61. kernel-arch.bbclass
6.62. kernel-devicetree.bbclass
6.63. kernel-fitimage.bbclass
6.64. kernel-grub.bbclass
6.65. kernel-module-split.bbclass
6.66. kernel-uboot.bbclass
6.67. kernel-uimage.bbclass
6.68. kernel-yocto.bbclass
6.69. kernelsrc.bbclass
6.70. lib_package.bbclass
6.71. libc*.bbclass
6.72. license.bbclass
6.73. linux-kernel-base.bbclass
6.74. linuxloader.bbclass
6.75. logging.bbclass
6.76. meta.bbclass
6.77. metadata_scm.bbclass
6.78. migrate_localcount.bbclass
6.79. mime.bbclass
6.80. mirrors.bbclass
6.81. module.bbclass
6.82. module-base.bbclass
6.83. multilib*.bbclass
6.84. native.bbclass
6.85. nativesdk.bbclass
6.86. nopackages.bbclass
6.87. npm.bbclass
6.88. oelint.bbclass
6.89. own-mirrors.bbclass
6.90. package.bbclass
6.91. package_deb.bbclass
6.92. package_ipk.bbclass
6.93. package_rpm.bbclass
6.94. package_tar.bbclass
6.95. packagedata.bbclass
6.96. packagegroup.bbclass
6.97. patch.bbclass
6.98. perlnative.bbclass
6.99. pixbufcache.bbclass
6.100. pkgconfig.bbclass
6.101. populate_sdk.bbclass
6.102. populate_sdk_*.bbclass
6.103. prexport.bbclass
6.104. primport.bbclass
6.105. prserv.bbclass
6.106. ptest.bbclass
6.107. ptest-gnome.bbclass
6.108. python-dir.bbclass
6.109. python3native.bbclass
6.110. pythonnative.bbclass
6.111. qemu.bbclass
6.112. recipe_sanity.bbclass
6.113. relocatable.bbclass
6.114. remove-libtool.bbclass
6.115. report-error.bbclass
6.116. rm_work.bbclass
6.117. rootfs*.bbclass
6.118. sanity.bbclass
6.119. scons.bbclass
6.120. sdl.bbclass
6.121. setuptools.bbclass
6.122. setuptools3.bbclass
6.123. sign_rpm.bbclass
6.124. sip.bbclass
6.125. siteconfig.bbclass
6.126. siteinfo.bbclass
6.127. spdx.bbclass
6.128. sstate.bbclass
6.129. staging.bbclass
6.130. syslinux.bbclass
6.131. systemd.bbclass
6.132. systemd-boot.bbclass
6.133. terminal.bbclass
6.134. testimage*.bbclass
6.135. testsdk.bbclass
6.136. texinfo.bbclass
6.137. tinderclient.bbclass
6.138. toaster.bbclass
6.139. toolchain-scripts.bbclass
6.140. typecheck.bbclass
6.141. uboot-config.bbclass
6.142. uninative.bbclass
6.143. update-alternatives.bbclass
6.144. update-rc.d.bbclass
6.145. useradd*.bbclass
6.146. utility-tasks.bbclass
6.147. utils.bbclass
6.148. vala.bbclass
6.149. waf.bbclass
7. Tasks
7.1. Normal Recipe Build Tasks
7.1.1. do_build
7.1.2. do_compile
7.1.3. do_compile_ptest_base
7.1.4. do_configure
7.1.5. do_configure_ptest_base
7.1.6. do_deploy
7.1.7. do_distrodata
7.1.8. do_fetch
7.1.9. do_image
7.1.10. do_image_complete
7.1.11. do_install
7.1.12. do_install_ptest_base
7.1.13. do_package
7.1.14. do_package_qa
7.1.15. do_package_write_deb
7.1.16. do_package_write_ipk
7.1.17. do_package_write_rpm
7.1.18. do_package_write_tar
7.1.19. do_packagedata
7.1.20. do_patch
7.1.21. do_populate_lic
7.1.22. do_populate_sdk
7.1.23. do_populate_sysroot
7.1.24. do_prepare_recipe_sysroot
7.1.25. do_rm_work
7.1.26. do_unpack
7.2. Manually Called Tasks
7.2.1. do_checkpkg
7.2.2. do_checkuri
7.2.3. do_clean
7.2.4. do_cleanall
7.2.5. do_cleansstate
7.2.6. do_devpyshell
7.2.7. do_devshell
7.2.8. do_listtasks
7.2.9. do_package_index
7.3. Image-Related Tasks
7.3.1. do_bootimg
7.3.2. do_bundle_initramfs
7.3.3. do_rootfs
7.3.4. do_testimage
7.3.5. do_testimage_auto
7.4. Kernel-Related Tasks
7.4.1. do_compile_kernelmodules
7.4.2. do_diffconfig
7.4.3. do_kernel_checkout
7.4.4. do_kernel_configcheck
7.4.5. do_kernel_configme
7.4.6. do_kernel_menuconfig
7.4.7. do_kernel_metadata
7.4.8. do_menuconfig
7.4.9. do_savedefconfig
7.4.10. do_shared_workdir
7.4.11. do_sizecheck
7.4.12. do_strip
7.4.13. do_validate_branches
7.5. Miscellaneous Tasks
7.5.1. do_spdx
8. devtool Quick Reference
8.1. Getting Help
8.2. The Workspace Layer Structure
8.3. Adding a New Recipe to the Workspace Layer
8.4. Extracting the Source for an Existing Recipe
8.5. Synchronizing a Recipe's Extracted Source Tree
8.6. Modifying an Existing Recipe
8.7. Edit an Existing Recipe
8.8. Updating a Recipe
8.9. Upgrading a Recipe
8.10. Resetting a Recipe
8.11. Building Your Recipe
8.12. Building Your Image
8.13. Deploying Your Software on the Target Machine
8.14. Removing Your Software from the Target Machine
8.15. Creating the Workspace Layer in an Alternative Location
8.16. Get the Status of the Recipes in Your Workspace
8.17. Search for Available Target Recipes
9. OpenEmbedded Kickstart (.wks) Reference
9.1. Introduction
9.2. Command: part or partition
9.3. Command: bootloader
10. QA Error and Warning Messages
10.1. Introduction
10.2. Errors and Warnings
10.3. Configuring and Disabling QA Checks
11. Images
12. Features
12.1. Machine Features
12.2. Distro Features
12.3. Image Features
12.4. Feature Backfilling
13. Variables Glossary
Glossary
14. Variable Context
14.1. Configuration
14.1.1. Distribution (Distro)
14.1.2. Machine
14.1.3. Local
14.2. Recipes
14.2.1. Required
14.2.2. Dependencies
14.2.3. Paths
14.2.4. Extra Build Information
15. FAQ
16. Contributions and Additional Information
16.1. Introduction
16.2. Contributions
16.3. Yocto Project Bugzilla
16.4. Mailing lists
16.5. Internet Relay Chat (IRC)
16.6. Links and Related Documentation

Chapter 1. System Requirements

Welcome to the Yocto Project Reference Manual! This manual provides reference information for the current release of the Yocto Project. The manual is best used after you have an understanding of the basics of the Yocto Project. The manual is neither meant to be read as a starting point to the Yocto Project nor read from start to finish. Use this manual to find variable definitions, class descriptions, and so forth as needed during the course of using the Yocto Project.

For introductory information on the Yocto Project, see the Yocto Project Website and the "Yocto Project Development Environment" chapter in the Yocto Project Overview and Concepts Manual.

If you want to use the Yocto Project to quickly build an image without having to understand concepts, work through the Yocto Project Quick Build document. You can find "how-to" information in the Yocto Project Development Tasks Manual. You can find Yocto Project overview and conceptual information in the Yocto Project Overview and Concepts Manual.

Tip

For more information about the Yocto Project Documentation set, see the "Links and Related Documentation" section.

1.1. Supported Linux Distributions

Currently, the Yocto Project is supported on the following distributions:

Notes

  • Yocto Project releases are tested against the stable Linux distributions in the following list. The Yocto Project should work on other distributions but validation is not performed against them.

  • In particular, the Yocto Project does not support and currently has no plans to support rolling-releases or development distributions due to their constantly changing nature. We welcome patches and bug reports, but keep in mind that our priority is on the supported platforms listed below.

  • The Yocto Project is not compatible with the Windows Subsystem for Linux (WSL). You cannot use a build host that is running WSL.

  • If you encounter problems, please go to Yocto Project Bugzilla and submit a bug. We are interested in hearing about your experience. For information on how to submit a bug, see the Yocto Project Bugzilla wiki page and the "Submitting a Defect Against the Yocto Project" section in the Yocto Project Development Tasks Manual.

  • Ubuntu 16.04 (LTS)

  • Ubuntu 16.10 (LTS)

  • Ubuntu 17.04

  • Fedora release 26

  • CentOS release 7.x

  • Debian GNU/Linux 8.x (Jessie)

  • Debian GNU/Linux 9.x (Stretch)

  • openSUSE 42.1

  • openSUSE 42.2

Note

While the Yocto Project Team attempts to ensure all Yocto Project releases are one hundred percent compatible with each officially supported Linux distribution, instances might exist where you encounter a problem while using the Yocto Project on a specific distribution.

1.2. Required Packages for the Build Host

The list of packages you need on the host development system can be large when covering all build scenarios using the Yocto Project. This section provides required packages according to Linux distribution and function.

1.2.1. Ubuntu and Debian

The following list shows the required packages by function given a supported Ubuntu or Debian Linux distribution:

Note

If your build system has the oss4-dev package installed, you might experience QEMU build failures due to the package installing its own custom /usr/include/linux/soundcard.h on the Debian system. If you run into this situation, either of the following solutions exist:
     $ sudo apt-get build-dep qemu
     $ sudo apt-get remove oss4-dev
                    

  • Essentials: Packages needed to build an image on a headless system:

         $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
         build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
         xz-utils debianutils iputils-ping
                            
  • Graphical and Eclipse Plug-In Extras: Packages recommended if the host system has graphics support or if you are going to use the Eclipse IDE:

         $ sudo apt-get install libsdl1.2-dev xterm
                            
  • Documentation: Packages needed if you are going to build out the Yocto Project documentation manuals:

         $ sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto
                            
  • OpenEmbedded Self-Test (oe-selftest): Packages needed if you are going to run oe-selftest:

         $ sudo apt-get install python-git
                            

1.2.2. Fedora Packages

The following list shows the required packages by function given a supported Fedora Linux distribution:

  • Essentials: Packages needed to build an image for a headless system:

         $ sudo dnf install gawk make wget tar bzip2 gzip python3 unzip perl patch \
         diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
         ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat \
         python3-pexpect findutils which file cpio python python3-pip xz
                            
  • Graphical and Eclipse Plug-In Extras: Packages recommended if the host system has graphics support or if you are going to use the Eclipse IDE:

         $ sudo dnf install SDL-devel xterm
                            
  • Documentation: Packages needed if you are going to build out the Yocto Project documentation manuals:

         $ sudo dnf install make docbook-style-dsssl docbook-style-xsl \
         docbook-dtds docbook-utils fop libxslt dblatex xmlto
                            
  • OpenEmbedded Self-Test (oe-selftest): Packages needed if you are going to run oe-selftest:

         $ sudo dnf install python3-GitPython
                            

1.2.3. openSUSE Packages

The following list shows the required packages by function given a supported openSUSE Linux distribution:

  • Essentials: Packages needed to build an image for a headless system:

         $ sudo zypper install python gcc gcc-c++ git chrpath make wget python-xml \
         diffstat makeinfo python-curses patch socat python3 python3-curses tar python3-pip \
         python3-pexpect xz which
                            
  • Graphical and Eclipse Plug-In Extras: Packages recommended if the host system has graphics support or if you are going to use the Eclipse IDE:

         $ sudo zypper install libSDL-devel xterm
                            
  • Documentation: Packages needed if you are going to build out the Yocto Project documentation manuals:

         $ sudo zypper install make dblatex xmlto
                            
  • OpenEmbedded Self-Test (oe-selftest): Packages needed if you are going to run oe-selftest:

         $ sudo zypper install python-GitPython
                            

Note

Sanity testing, through the testimage classes, does not work on systems using the Wicked network manager.

1.2.4. CentOS Packages

The following list shows the required packages by function given a supported CentOS Linux distribution:

  • Essentials: Packages needed to build an image for a headless system:

         $ sudo yum install -y epel-release
         $ sudo yum makecache
         $ sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
         diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \
         perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python34-pip xz \
         which SDL-devel xterm
                            

    Notes

    • Extra Packages for Enterprise Linux (i.e. epel-release) is a collection of packages from Fedora built on RHEL/CentOS for easy installation of packages not included in enterprise Linux by default. You need to install these packages separately.

    • The makecache command consumes additional Metadata from epel-release.

  • Graphical and Eclipse Plug-In Extras: Packages recommended if the host system has graphics support or if you are going to use the Eclipse IDE:

         $ sudo yum install SDL-devel xterm
                            
  • Documentation: Packages needed if you are going to build out the Yocto Project documentation manuals:

         $ sudo yum install make docbook-style-dsssl docbook-style-xsl \
         docbook-dtds docbook-utils fop libxslt dblatex xmlto
                            
  • OpenEmbedded Self-Test (oe-selftest): Packages needed if you are going to run oe-selftest:

         $ sudo yum install GitPython
                            

1.3. Required Git, tar, and Python Versions

In order to use the build system, your host development system must meet the following version requirements for Git, tar, and Python:

  • Git 1.8.3.1 or greater

  • tar 1.27 or greater

  • Python 3.4.0 or greater

If your host development system does not meet all these requirements, you can resolve this by installing a buildtools tarball that contains these tools. You can get the tarball one of two ways: download a pre-built tarball or use BitBake to build the tarball.

1.3.1. Downloading a Pre-Built buildtools Tarball

Downloading and running a pre-built buildtools installer is the easiest of the two methods by which you can get these tools:

  1. Locate and download the *.sh at http://downloads.yoctoproject.org/releases/yocto/yocto-2.6/buildtools/.

  2. Execute the installation script. Here is an example:

         $ sh ~/Downloads/x86_64-buildtools-nativesdk-standalone-2.6.sh
                            

    During execution, a prompt appears that allows you to choose the installation directory. For example, you could choose the following:

         /home/your-username/buildtools
                            

  3. Source the tools environment setup script by using a command like the following:

         $ source /home/your_username/buildtools/environment-setup-i586-poky-linux
                            

    Of course, you need to supply your installation directory and be sure to use the right file (i.e. i585 or x86-64).

    After you have sourced the setup script, the tools are added to PATH and any other environment variables required to run the tools are initialized. The results are working versions versions of Git, tar, Python and chrpath.

1.3.2. Building Your Own buildtools Tarball

Building and running your own buildtools installer applies only when you have a build host that can already run BitBake. In this case, you use that machine to build the .sh file and then take steps to transfer and run it on a machine that does not meet the minimal Git, tar, and Python requirements.

Here are the steps to take to build and run your own buildtools installer:

  1. On the machine that is able to run BitBake, be sure you have set up your build environment with the setup script (oe-init-build-env).

  2. Run the BitBake command to build the tarball:

         $ bitbake buildtools-tarball
                            

    Note

    The SDKMACHINE variable in your local.conf file determines whether you build tools for a 32-bit or 64-bit system.

    Once the build completes, you can find the .sh file that installs the tools in the tmp/deploy/sdk subdirectory of the Build Directory. The installer file has the string "buildtools" in the name.

  3. Transfer the .sh file from the build host to the machine that does not meet the Git, tar, or Python requirements.

  4. On the machine that does not meet the requirements, run the .sh file to install the tools. Here is an example:

         $ sh ~/Downloads/x86_64-buildtools-nativesdk-standalone-2.6.sh
                           

    During execution, a prompt appears that allows you to choose the installation directory. For example, you could choose the following:

         /home/your_username/buildtools
                           

  5. Source the tools environment setup script by using a command like the following:

         $ source /home/your_username/buildtools/environment-setup-i586-poky-linux
                            

    Of course, you need to supply your installation directory and be sure to use the right file (i.e. i585 or x86-64).

    After you have sourced the setup script, the tools are added to PATH and any other environment variables required to run the tools are initialized. The results are working versions versions of Git, tar, Python and chrpath.

Chapter 2. Yocto Project Terms

Following is a list of terms and definitions users new to the Yocto Project development environment might find helpful. While some of these terms are universal, the list includes them just in case:

  • Append Files: Files that append build information to a recipe file. Append files are known as BitBake append files and .bbappend files. The OpenEmbedded build system expects every append file to have a corresponding recipe (.bb) file. Furthermore, the append file and corresponding recipe file must use the same root filename. The filenames can differ only in the file type suffix used (e.g. formfactor_0.0.bb and formfactor_0.0.bbappend).

    Information in append files extends or overrides the information in the similarly-named recipe file. For an example of an append file in use, see the "Using .bbappend Files in Your Layer" section in the Yocto Project Development Tasks Manual.

    When you name an append file, you can use the "%" wildcard character to allow for matching recipe names. For example, suppose you have an append file named as follows:

         busybox_1.21.%.bbappend
                    

    That append file would match any busybox_1.21.x.bb version of the recipe. So, the append file would match the following recipe names:

         busybox_1.21.1.bb
         busybox_1.21.2.bb
         busybox_1.21.3.bb
                    

    Important

    The use of the "%" character is limited in that it only works directly in front of the .bbappend portion of the append file's name. You cannot use the wildcard character in any other location of the name.

  • BitBake: The task executor and scheduler used by the OpenEmbedded build system to build images. For more information on BitBake, see the BitBake User Manual.

  • Board Support Package (BSP): A group of drivers, definitions, and other components that provide support for a specific hardware configuration. For more information on BSPs, see the Yocto Project Board Support Package (BSP) Developer's Guide.

  • Build Directory: This term refers to the area used by the OpenEmbedded build system for builds. The area is created when you source the setup environment script that is found in the Source Directory (i.e. oe-init-build-env). The TOPDIR variable points to the Build Directory.

    You have a lot of flexibility when creating the Build Directory. Following are some examples that show how to create the directory. The examples assume your Source Directory is named poky:

    • Create the Build Directory inside your Source Directory and let the name of the Build Directory default to build:

           $ cd $HOME/poky
           $ source oe-init-build-env
                              

    • Create the Build Directory inside your home directory and specifically name it test-builds:

           $ cd $HOME
           $ source poky/oe-init-build-env test-builds
                              

    • Provide a directory path and specifically name the Build Directory. Any intermediate folders in the pathname must exist. This next example creates a Build Directory named YP-21.0.0 in your home directory within the existing directory mybuilds:

           $cd $HOME
           $ source $HOME/poky/oe-init-build-env $HOME/mybuilds/YP-21.0.0
                              

    Note

    By default, the Build Directory contains TMPDIR, which is a temporary directory the build system uses for its work. TMPDIR cannot be under NFS. Thus, by default, the Build Directory cannot be under NFS. However, if you need the Build Directory to be under NFS, you can set this up by setting TMPDIR in your local.conf file to use a local drive. Doing so effectively separates TMPDIR from TOPDIR, which is the Build Directory.

  • Build Host: The system used to build images in a Yocto Project Development environment. The build system is sometimes referred to as the development host.

  • Classes: Files that provide for logic encapsulation and inheritance so that commonly used patterns can be defined once and then easily used in multiple recipes. For reference information on the Yocto Project classes, see the "Classes" chapter. Class files end with the .bbclass filename extension.

  • Configuration File: Files that hold global definitions of variables, user-defined variables, and hardware configuration information. These files tell the OpenEmbedded build system what to build and what to put into the image to support a particular platform.

    Configuration files end with a .conf filename extension. The conf/local.conf configuration file in the Build Directory contains user-defined variables that affect every build. The meta-poky/conf/distro/poky.conf configuration file defines Yocto "distro" configuration variables used only when building with this policy. Machine configuration files, which are located throughout the Source Directory, define variables for specific hardware and are only used when building for that target (e.g. the machine/beaglebone.conf configuration file defines variables for the Texas Instruments ARM Cortex-A8 development board).

  • Container Layer: Layers that hold other layers. An example of a container layer is the meta-intel layer. This layer contains BSP layers for the Intel-core2-32 Intel® Common Core (Intel-core2-32) and the Intel-corei7-64 Intel® Common Core (Intel-corei7-64). the meta-intel layer also contains the common/ directory, which contains common content across those layers.

  • Cross-Development Toolchain: In general, a cross-development toolchain is a collection of software development tools and utilities that run on one architecture and allow you to develop software for a different, or targeted, architecture. These toolchains contain cross-compilers, linkers, and debuggers that are specific to the target architecture.

    The Yocto Project supports two different cross-development toolchains:

    • A toolchain only used by and within BitBake when building an image for a target architecture.

    • A relocatable toolchain used outside of BitBake by developers when developing applications that will run on a targeted device.

    Creation of these toolchains is simple and automated. For information on toolchain concepts as they apply to the Yocto Project, see the "Cross-Development Toolchain Generation" section in the Yocto Project Overview and Concepts Manual. You can also find more information on using the relocatable toolchain in the Yocto Project Application Development and the Extensible Software Development Kit (eSDK) manual.

  • Extensible Software Development Kit (eSDK): A custom SDK for application developers. This eSDK allows developers to incorporate their library and programming changes back into the image to make their code available to other application developers.

    For information on the eSDK, see the Yocto Project Application Development and the Extensible Software Development Kit (eSDK) manual.

  • Image: An image is an artifact of the BitBake build process given a collection of recipes and related Metadata. Images are the binary output that run on specific hardware or QEMU and are used for specific use-cases. For a list of the supported image types that the Yocto Project provides, see the "Images" chapter.

  • Layer: A collection of related recipes. Layers allow you to consolidate related metadata to customize your build. Layers also isolate information used when building for multiple architectures. Layers are hierarchical in their ability to override previous specifications. You can include any number of available layers from the Yocto Project and customize the build by adding your layers after them. You can search the Layer Index for layers used within Yocto Project.

    For introductory information on layers, see the "The Yocto Project Layer Model" section in the Yocto Project Overview and Concepts Manual. For more detailed information on layers, see the "Understanding and Creating Layers" section in the Yocto Project Development Tasks Manual. For a discussion specifically on BSP Layers, see the "BSP Layers" section in the Yocto Project Board Support Packages (BSP) Developer's Guide.

  • Metadata: A key element of the Yocto Project is the Metadata that is used to construct a Linux distribution and is contained in the files that the OpenEmbedded build system parses when building an image. In general, Metadata includes recipes, configuration files, and other information that refers to the build instructions themselves, as well as the data used to control what things get built and the effects of the build. Metadata also includes commands and data used to indicate what versions of software are used, from where they are obtained, and changes or additions to the software itself (patches or auxiliary files) that are used to fix bugs or customize the software for use in a particular situation. OpenEmbedded-Core is an important set of validated metadata.

    In the context of the kernel ("kernel Metadata"), the term refers to the kernel config fragments and features contained in the yocto-kernel-cache Git repository.

  • OpenEmbedded-Core (OE-Core): OE-Core is metadata comprised of foundational recipes, classes, and associated files that are meant to be common among many different OpenEmbedded-derived systems, including the Yocto Project. OE-Core is a curated subset of an original repository developed by the OpenEmbedded community that has been pared down into a smaller, core set of continuously validated recipes. The result is a tightly controlled and an quality-assured core set of recipes.

    You can see the Metadata in the meta directory of the Yocto Project Source Repositories.

  • OpenEmbedded Build System: The build system specific to the Yocto Project. The OpenEmbedded build system is based on another project known as "Poky", which uses BitBake as the task executor. Throughout the Yocto Project documentation set, the OpenEmbedded build system is sometimes referred to simply as "the build system". If other build systems, such as a host or target build system are referenced, the documentation clearly states the difference.

    Note

    For some historical information about Poky, see the Poky term.

  • Package: In the context of the Yocto Project, this term refers to a recipe's packaged output produced by BitBake (i.e. a "baked recipe"). A package is generally the compiled binaries produced from the recipe's sources. You "bake" something by running it through BitBake.

    It is worth noting that the term "package" can, in general, have subtle meanings. For example, the packages referred to in the "Required Packages for the Build Host" section are compiled binaries that, when installed, add functionality to your Linux distribution.

    Another point worth noting is that historically within the Yocto Project, recipes were referred to as packages - thus, the existence of several BitBake variables that are seemingly mis-named, (e.g. PR, PV, and PE).

  • Package Groups: Arbitrary groups of software Recipes. You use package groups to hold recipes that, when built, usually accomplish a single task. For example, a package group could contain the recipes for a company’s proprietary or value-add software. Or, the package group could contain the recipes that enable graphics. A package group is really just another recipe. Because package group files are recipes, they end with the .bb filename extension.

  • Poky: Poky, which is pronounced Pock-ee, is a reference embedded distribution and a reference test configuration. Poky provides the following:

    • A base-level functional distro used to illustrate how to customize a distribution.

    • A means by which to test the Yocto Project components (i.e. Poky is used to validate the Yocto Project).

    • A vehicle through which you can download the Yocto Project.

    Poky is not a product level distro. Rather, it is a good starting point for customization.

    Note

    Poky began an open-source project initially developed by OpenedHand. OpenedHand developed Poky from the existing OpenEmbedded build system to create a commercially supportable build system for embedded Linux. After Intel Corporation acquired OpenedHand, the poky project became the basis for the Yocto Project's build system.

  • Recipe: A set of instructions for building packages. A recipe describes where you get source code, which patches to apply, how to configure the source, how to compile it and so on. Recipes also describe dependencies for libraries or for other recipes. Recipes represent the logical unit of execution, the software to build, the images to build, and use the .bb file extension.

  • Reference Kit: A working example of a system, which includes a BSP as well as a build host and other components, that can work on specific hardware.

  • Source Directory: This term refers to the directory structure created as a result of creating a local copy of the poky Git repository git://git.yoctoproject.org/poky or expanding a released poky tarball.

    Note

    Creating a local copy of the poky Git repository is the recommended method for setting up your Source Directory.

    Sometimes you might hear the term "poky directory" used to refer to this directory structure.

    Note

    The OpenEmbedded build system does not support file or directory names that contain spaces. Be sure that the Source Directory you use does not contain these types of names.

    The Source Directory contains BitBake, Documentation, Metadata and other files that all support the Yocto Project. Consequently, you must have the Source Directory in place on your development system in order to do any development using the Yocto Project.

    When you create a local copy of the Git repository, you can name the repository anything you like. Throughout much of the documentation, "poky" is used as the name of the top-level folder of the local copy of the poky Git repository. So, for example, cloning the poky Git repository results in a local Git repository whose top-level folder is also named "poky".

    While it is not recommended that you use tarball expansion to set up the Source Directory, if you do, the top-level directory name of the Source Directory is derived from the Yocto Project release tarball. For example, downloading and unpacking poky-thud-21.0.0.tar.bz2 results in a Source Directory whose root folder is named poky-thud-21.0.0.

    It is important to understand the differences between the Source Directory created by unpacking a released tarball as compared to cloning git://git.yoctoproject.org/poky. When you unpack a tarball, you have an exact copy of the files based on the time of release - a fixed release point. Any changes you make to your local files in the Source Directory are on top of the release and will remain local only. On the other hand, when you clone the poky Git repository, you have an active development repository with access to the upstream repository's branches and tags. In this case, any local changes you make to the local Source Directory can be later applied to active development branches of the upstream poky Git repository.

    For more information on concepts related to Git repositories, branches, and tags, see the "Repositories, Tags, and Branches" section in the Yocto Project Overview and Concepts Manual.

  • Task: A unit of execution for BitBake (e.g. do_compile, do_fetch, do_patch, and so forth).

  • Toaster: A web interface to the Yocto Project's OpenEmbedded Build System. The interface enables you to configure and run your builds. Information about builds is collected and stored in a database. For information on Toaster, see the Toaster User Manual.

  • Upstream: A reference to source code or repositories that are not local to the development system but located in a master area that is controlled by the maintainer of the source code. For example, in order for a developer to work on a particular piece of code, they need to first get a copy of it from an "upstream" source.

Chapter 3. Yocto Project Releases and the Stable Release Process

The Yocto Project release process is predictable and consists of both major and minor (point) releases. This brief chapter provides information on how releases are named, their life cycle, and their stability.

3.1. Major and Minor Release Cadence

The Yocto Project delivers major releases (e.g. 2.6) using a six month cadence roughly timed each April and October of the year. Following are examples of some major YP releases with their codenames also shown. See the "Major Release Codenames" section for information on codenames used with major releases.

    2.2 (Morty)
    2.1 (Krogoth)
    2.0 (Jethro)
        

While the cadence is never perfect, this timescale facilitates regular releases that have strong QA cycles while not overwhelming users with too many new releases. The cadence is predictable and avoids many major holidays in various geographies.

The Yocto project delivers minor (point) releases on an unscheduled basis and are usually driven by the accumulation of enough significant fixes or enhancements to the associated major release. Following are some example past point releases:

    2.1.1
    2.1.2
    2.2.1
        

The point release indicates a point in the major release branch where a full QA cycle and release process validates the content of the new branch.

Note

Realize that there can be patches merged onto the stable release branches as and when they become available.

3.2. Major Release Codenames

Each major release receives a codename that identifies the release in the Yocto Project Source Repositories. The concept is that branches of Metadata with the same codename are likely to be compatible and thus work together.

Note

Codenames are associated with major releases because a Yocto Project release number (e.g. 2.6) could conflict with a given layer or company versioning scheme. Codenames are unique, interesting, and easily identifiable.

Releases are given a nominal release version as well but the codename is used in repositories for this reason. You can find information on Yocto Project releases and codenames at https://wiki.yoctoproject.org/wiki/Releases.

3.3. Stable Release Process

Once released, the release enters the stable release process at which time a person is assigned as the maintainer for that stable release. This maintainer monitors activity for the release by investigating and handling nominated patches and backport activity. Only fixes and enhancements that have first been applied on the "master" branch (i.e. the current, in-development branch) are considered for backporting to a stable release.

Note

The current Yocto Project policy regarding backporting is to consider bug fixes and security fixes only. Policy dictates that features are not backported to a stable release. This policy means generic recipe version upgrades are unlikely to be accepted for backporting. The exception to this policy occurs when a strong reason exists such as the fix happens to also be the preferred upstream approach.

Stable release branches have strong maintenance for about a year after their initial release. Should significant issues be found for any release regardless of its age, fixes could be backported to older releases. For issues that are not backported given an older release, Community LTS trees and branches exist where community members share patches for older releases. However, these types of patches do not go through the same release process as do point releases. You can find more information about stable branch maintenance at https://wiki.yoctoproject.org/wiki/Stable_branch_maintenance.

3.4. Testing and Quality Assurance

Part of the Yocto Project development and release process is quality assurance through the execution of test strategies. Test strategies provide the Yocto Project team a way to ensure a release is validated. Additionally, because the test strategies are visible to you as a developer, you can validate your projects. This section overviews the available test infrastructure used in the Yocto Project. For information on how to run available tests on your projects, see the "Performing Automated Runtime Testing" section in the Yocto Project Development Tasks Manual.

The QA/testing infrastructure is woven into the project to the point where core developers take some of it for granted. The infrastructure consists of the following pieces:

  • bitbake-selftest: A standalone command that runs unit tests on key pieces of BitBake and its fetchers.

  • sanity.bbclass: This automatically included class checks the build environment for missing tools (e.g. gcc) or common misconfigurations such as MACHINE set incorrectly.

  • insane.bbclass: This class checks the generated output from builds for sanity. For example, if building for an ARM target, did the build produce ARM binaries. If, for example, the build produced PPC binaries then there is a problem.

  • testimage.bbclass: This class performs runtime testing of images after they are built. The tests are usually used with QEMU to boot the images and check the combined runtime result boot operation and functions. However, the test can also use the IP address of a machine to test.

  • ptest: Runs tests against packages produced during the build for a given piece of software. The test allows the packages to be be run within a target image.

  • oe-selftest: Tests combination BitBake invocations. These tests operate outside the OpenEmbedded build system itself. The oe-selftest can run all tests by default or can run selected tests or test suites.

    Note

    Running oe-selftest requires host packages beyond the "Essential" grouping. See the "Required Packages for the Build Host" section for more information.

Originally, much of this testing was done manually. However, significant effort has been made to automate the tests so that more people can use them and the Yocto Project development team can run them faster and more efficiently.

The Yocto Project's main Autobuilder (autobuilder.yoctoproject.org) publicly tests each Yocto Project release's code in the OE-Core, Poky, and BitBake repositories. The testing occurs for both the current state of the "master" branch and also for submitted patches. Testing for submitted patches usually occurs in the "ross/mut" branch in the poky-contrib repository (i.e. the master-under-test branch) or in the "master-next" branch in the poky repository.

Note

You can find all these branches in the Yocto Project Source Repositories.

Testing within these public branches ensures in a publicly visible way that all of the main supposed architectures and recipes in OE-Core successfully build and behave properly.

Various features such as multilib, sub architectures (e.g. x32, poky-tiny, musl, no-x11 and and so forth), bitbake-selftest, and oe-selftest are tested as part of the QA process of a release. Complete testing and validation for a release takes the Autobuilder workers several hours.

Note

The Autobuilder workers are non-homogeneous, which means regular testing across a variety of Linux distributions occurs. The Autobuilder is limited to only testing QEMU-based setups and not real hardware.

Finally, in addition to the Autobuilder's tests, the Yocto Project QA team also performs testing on a variety of platforms, which includes actual hardware, to ensure expected results.

Chapter 4. Migrating to a Newer Yocto Project Release

Table of Contents

4.1. General Migration Considerations
4.2. Moving to the Yocto Project 1.3 Release
4.2.1. Local Configuration
4.2.2. Recipes
4.2.3. Linux Kernel Naming
4.3. Moving to the Yocto Project 1.4 Release
4.3.1. BitBake
4.3.2. Build Behavior
4.3.3. Proxies and Fetching Source
4.3.4. Custom Interfaces File (netbase change)
4.3.5. Remote Debugging
4.3.6. Variables
4.3.7. Target Package Management with RPM
4.3.8. Recipes Moved
4.3.9. Removals and Renames
4.4. Moving to the Yocto Project 1.5 Release
4.4.1. Host Dependency Changes
4.4.2. atom-pc Board Support Package (BSP)
4.4.3. BitBake
4.4.4. QA Warnings
4.4.5. Directory Layout Changes
4.4.6. Shortened Git SRCREV Values
4.4.7. IMAGE_FEATURES
4.4.8. /run
4.4.9. Removal of Package Manager Database Within Image Recipes
4.4.10. Images Now Rebuild Only on Changes Instead of Every Time
4.4.11. Task Recipes
4.4.12. BusyBox
4.4.13. Automated Image Testing
4.4.14. Build History
4.4.15. udev
4.4.16. Removed and Renamed Recipes
4.4.17. Other Changes
4.5. Moving to the Yocto Project 1.6 Release
4.5.1. archiver Class
4.5.2. Packaging Changes
4.5.3. BitBake
4.5.4. Changes to Variables
4.5.5. Package Test (ptest)
4.5.6. Build Changes
4.5.7. qemu-native
4.5.8. core-image-basic
4.5.9. Licensing
4.5.10. CFLAGS Options
4.5.11. Custom Image Output Types
4.5.12. Tasks
4.5.13. update-alternative Provider
4.5.14. virtclass Overrides
4.5.15. Removed and Renamed Recipes
4.5.16. Removed Classes
4.5.17. Reference Board Support Packages (BSPs)
4.6. Moving to the Yocto Project 1.7 Release
4.6.1. Changes to Setting QEMU PACKAGECONFIG Options in local.conf
4.6.2. Minimum Git version
4.6.3. Autotools Class Changes
4.6.4. Binary Configuration Scripts Disabled
4.6.5. eglibc 2.19 Replaced with glibc 2.20
4.6.6. Kernel Module Autoloading
4.6.7. QA Check Changes
4.6.8. Removed Recipes
4.6.9. Miscellaneous Changes
4.7. Moving to the Yocto Project 1.8 Release
4.7.1. Removed Recipes
4.7.2. BlueZ 4.x / 5.x Selection
4.7.3. Kernel Build Changes
4.7.4. SSL 3.0 is Now Disabled in OpenSSL
4.7.5. Default Sysroot Poisoning
4.7.6. Rebuild Improvements
4.7.7. QA Check and Validation Changes
4.7.8. Miscellaneous Changes
4.8. Moving to the Yocto Project 2.0 Release
4.8.1. GCC 5
4.8.2. Gstreamer 0.10 Removed
4.8.3. Removed Recipes
4.8.4. BitBake datastore improvements
4.8.5. Shell Message Function Changes
4.8.6. Extra Development/Debug Package Cleanup
4.8.7. Recipe Maintenance Tracking Data Moved to OE-Core
4.8.8. Automatic Stale Sysroot File Cleanup
4.8.9. linux-yocto Kernel Metadata Repository Now Split from Source
4.8.10. Additional QA checks
4.8.11. Miscellaneous Changes
4.9. Moving to the Yocto Project 2.1 Release
4.9.1. Variable Expansion in Python Functions
4.9.2. Overrides Must Now be Lower-Case
4.9.3. Expand Parameter to getVar() and getVarFlag() is Now Mandatory
4.9.4. Makefile Environment Changes
4.9.5. libexecdir Reverted to ${prefix}/libexec
4.9.6. ac_cv_sizeof_off_t is No Longer Cached in Site Files
4.9.7. Image Generation is Now Split Out from Filesystem Generation
4.9.8. Removed Recipes
4.9.9. Class Changes
4.9.10. Build System User Interface Changes
4.9.11. ADT Removed
4.9.12. Poky Reference Distribution Changes
4.9.13. Packaging Changes
4.9.14. Tuning File Changes
4.9.15. Supporting GObject Introspection
4.9.16. Miscellaneous Changes
4.10. Moving to the Yocto Project 2.2 Release
4.10.1. Minimum Kernel Version
4.10.2. Staging Directories in Sysroot Has Been Simplified
4.10.3. Removal of Old Images and Other Files in tmp/deploy Now Enabled
4.10.4. Python Changes
4.10.5. uClibc Replaced by musl
4.10.6. ${B} No Longer Default Working Directory for Tasks
4.10.7. runqemu Ported to Python
4.10.8. Default Linker Hash Style Changed
4.10.9. KERNEL_IMAGE_BASE_NAME no Longer Uses KERNEL_IMAGETYPE
4.10.10. BitBake Changes
4.10.11. Swabber has Been Removed
4.10.12. Removed Recipes
4.10.13. Removed Classes
4.10.14. Minor Packaging Changes
4.10.15. Miscellaneous Changes
4.11. Moving to the Yocto Project 2.3 Release
4.11.1. Recipe-specific Sysroots
4.11.2. PATH Variable
4.11.3. Changes to Scripts
4.11.4. Changes to Functions
4.11.5. BitBake Changes
4.11.6. Absolute Symbolic Links
4.11.7. GPLv2 Versions of GPLv3 Recipes Moved
4.11.8. Package Management Changes
4.11.9. Removed Recipes
4.11.10. Wic Changes
4.11.11. QA Changes
4.11.12. Miscellaneous Changes
4.12. Moving to the Yocto Project 2.4 Release
4.12.1. Memory Resident Mode
4.12.2. Packaging Changes
4.12.3. Removed Recipes
4.12.4. Kernel Device Tree Move
4.12.5. Package QA Changes
4.12.6. README File Changes
4.12.7. Miscellaneous Changes
4.13. Moving to the Yocto Project 2.5 Release
4.13.1. Packaging Changes
4.13.2. Removed Recipes
4.13.3. Scripts and Tools Changes
4.13.4. BitBake Changes
4.13.5. Python and Python 3 Changes
4.13.6. Miscellaneous Changes
4.14. Moving to the Yocto Project 2.6 Release
4.14.1. GCC 8.2 is Now Used by Default
4.14.2. Removed Recipes
4.14.3. Packaging Changes
4.14.4. XOrg Protocol dependencies
4.14.5. distutils and distutils3 Now Prevent Fetching Dependencies During the do_configure Task
4.14.6. linux-yocto Configuration Audit Issues Now Correctly Reported
4.14.7. Image/Kernel Artifact Naming Changes
4.14.8. SERIAL_CONSOLE Deprecated
4.14.9. Configure Script Reports Unknown Options as Errors
4.14.10. Override Changes
4.14.11. systemd Configuration is Now Split Into systemd-conf
4.14.12. Automatic Testing Changes
4.14.13. OpenSSL Changes
4.14.14. BitBake Changes
4.14.15. Security Changes
4.14.16. Post Installation Changes
4.14.17. Python 3 Profile-Guided Optimization
4.14.18. Miscellaneous Changes

This chapter provides information you can use to migrate work to a newer Yocto Project release. You can find the same information in the release notes for a given release.

4.1. General Migration Considerations

Some considerations are not tied to a specific Yocto Project release. This section presents information you should consider when migrating to any new Yocto Project release.

  • Dealing with Customized Recipes: Issues could arise if you take older recipes that contain customizations and simply copy them forward expecting them to work after you migrate to new Yocto Project metadata. For example, suppose you have a recipe in your layer that is a customized version of a core recipe copied from the earlier release, rather than through the use of an append file. When you migrate to a newer version of Yocto Project, the metadata (e.g. perhaps an include file used by the recipe) could have changed in a way that would break the build. Say, for example, a function is removed from an include file and the customized recipe tries to call that function.

    You could "forward-port" all your customizations in your recipe so that everything works for the new release. However, this is not the optimal solution as you would have to repeat this process with each new release if changes occur that give rise to problems.

    The better solution (where practical) is to use append files (*.bbappend) to capture any customizations you want to make to a recipe. Doing so, isolates your changes from the main recipe making them much more manageable. However, sometimes it is not practical to use an append file. A good example of this is when introducing a newer or older version of a recipe in another layer.

  • Updating Append Files: Since append files generally only contain your customizations, they often do not need to be adjusted for new releases. However, if the .bbappend file is specific to a particular version of the recipe (i.e. its name does not use the % wildcard) and the version of the recipe to which it is appending has changed, then you will at a minimum need to rename the append file to match the name of the recipe file. A mismatch between an append file and its corresponding recipe file (.bb) will trigger an error during parsing.

    Depending on the type of customization the append file applies, other incompatibilities might occur when you upgrade. For example, if your append file applies a patch and the recipe to which it is appending is updated to a newer version, the patch might no longer apply. If this is the case and assuming the patch is still needed, you must modify the patch file so that it does apply.

4.2. Moving to the Yocto Project 1.3 Release

This section provides migration information for moving to the Yocto Project 1.3 Release from the prior release.

4.2.1. Local Configuration

Differences include changes for SSTATE_MIRRORS and bblayers.conf.

4.2.1.1. SSTATE_MIRRORS

The shared state cache (sstate-cache), as pointed to by SSTATE_DIR, by default now has two-character subdirectories to prevent issues arising from too many files in the same directory. Also, native sstate-cache packages, which are built to run on the host system, will go into a subdirectory named using the distro ID string. If you copy the newly structured sstate-cache to a mirror location (either local or remote) and then point to it in SSTATE_MIRRORS, you need to append "PATH" to the end of the mirror URL so that the path used by BitBake before the mirror substitution is appended to the path used to access the mirror. Here is an example:

     SSTATE_MIRRORS = "file://.* http://someserver.tld/share/sstate/PATH"
                

4.2.1.2. bblayers.conf

The meta-yocto layer consists of two parts that correspond to the Poky reference distribution and the reference hardware Board Support Packages (BSPs), respectively: meta-yocto and meta-yocto-bsp. When running BitBake for the first time after upgrading, your conf/bblayers.conf file will be updated to handle this change and you will be asked to re-run or restart for the changes to take effect.

4.2.2. Recipes

Differences include changes for the following:

  • Python function whitespace

  • proto= in SRC_URI

  • nativesdk

  • Task recipes

  • IMAGE_FEATURES

  • Removed recipes

4.2.2.1. Python Function Whitespace

All Python functions must now use four spaces for indentation. Previously, an inconsistent mix of spaces and tabs existed, which made extending these functions using _append or _prepend complicated given that Python treats whitespace as syntactically significant. If you are defining or extending any Python functions (e.g. populate_packages, do_unpack, do_patch and so forth) in custom recipes or classes, you need to ensure you are using consistent four-space indentation.

4.2.2.2. proto= in SRC_URI

Any use of proto= in SRC_URI needs to be changed to protocol=. In particular, this applies to the following URIs:

  • svn://

  • bzr://

  • hg://

  • osc://

Other URIs were already using protocol=. This change improves consistency.

4.2.2.3. nativesdk

The suffix nativesdk is now implemented as a prefix, which simplifies a lot of the packaging code for nativesdk recipes. All custom nativesdk recipes, which are relocatable packages that are native to SDK_ARCH, and any references need to be updated to use nativesdk-* instead of *-nativesdk.

4.2.2.4. Task Recipes

"Task" recipes are now known as "Package groups" and have been renamed from task-*.bb to packagegroup-*.bb. Existing references to the previous task-* names should work in most cases as there is an automatic upgrade path for most packages. However, you should update references in your own recipes and configurations as they could be removed in future releases. You should also rename any custom task-* recipes to packagegroup-*, and change them to inherit packagegroup instead of task, as well as taking the opportunity to remove anything now handled by packagegroup.bbclass, such as providing -dev and -dbg packages, setting LIC_FILES_CHKSUM, and so forth. See the "packagegroup.bbclass" section for further details.

4.2.2.5. IMAGE_FEATURES

Image recipes that previously included "apps-console-core" in IMAGE_FEATURES should now include "splash" instead to enable the boot-up splash screen. Retaining "apps-console-core" will still include the splash screen but generates a warning. The "apps-x11-core" and "apps-x11-games" IMAGE_FEATURES features have been removed.

4.2.2.6. Removed Recipes

The following recipes have been removed. For most of them, it is unlikely that you would have any references to them in your own Metadata. However, you should check your metadata against this list to be sure:

  • libx11-trim: Replaced by libx11, which has a negligible size difference with modern Xorg.

  • xserver-xorg-lite: Use xserver-xorg, which has a negligible size difference when DRI and GLX modules are not installed.

  • xserver-kdrive: Effectively unmaintained for many years.

  • mesa-xlib: No longer serves any purpose.

  • galago: Replaced by telepathy.

  • gail: Functionality was integrated into GTK+ 2.13.

  • eggdbus: No longer needed.

  • gcc-*-intermediate: The build has been restructured to avoid the need for this step.

  • libgsmd: Unmaintained for many years. Functionality now provided by ofono instead.

  • contacts, dates, tasks, eds-tools: Largely unmaintained PIM application suite. It has been moved to meta-gnome in meta-openembedded.

In addition to the previously listed changes, the meta-demoapps directory has also been removed because the recipes in it were not being maintained and many had become obsolete or broken. Additionally, these recipes were not parsed in the default configuration. Many of these recipes are already provided in an updated and maintained form within the OpenEmbedded community layers such as meta-oe and meta-gnome. For the remainder, you can now find them in the meta-extras repository, which is in the Yocto Project Source Repositories.

4.2.3. Linux Kernel Naming

The naming scheme for kernel output binaries has been changed to now include PE as part of the filename:

     KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
            

Because the PE variable is not set by default, these binary files could result with names that include two dash characters. Here is an example:

     bzImage--3.10.9+git0+cd502a8814_7144bcc4b8-r0-qemux86-64-20130830085431.bin
            

4.3. Moving to the Yocto Project 1.4 Release

This section provides migration information for moving to the Yocto Project 1.4 Release from the prior release.

4.3.1. BitBake

Differences include the following:

  • Comment Continuation: If a comment ends with a line continuation (\) character, then the next line must also be a comment. Any instance where this is not the case, now triggers a warning. You must either remove the continuation character, or be sure the next line is a comment.

  • Package Name Overrides: The runtime package specific variables RDEPENDS, RRECOMMENDS, RSUGGESTS, RPROVIDES, RCONFLICTS, RREPLACES, FILES, ALLOW_EMPTY, and the pre, post, install, and uninstall script functions pkg_preinst, pkg_postinst, pkg_prerm, and pkg_postrm should always have a package name override. For example, use RDEPENDS_${PN} for the main package instead of RDEPENDS. BitBake uses more strict checks when it parses recipes.

4.3.2. Build Behavior

Differences include the following:

  • Shared State Code: The shared state code has been optimized to avoid running unnecessary tasks. For example, the following no longer populates the target sysroot since that is not necessary:

         $ bitbake -c rootfs some-image
                        

    Instead, the system just needs to extract the output package contents, re-create the packages, and construct the root filesystem. This change is unlikely to cause any problems unless you have missing declared dependencies.

  • Scanning Directory Names: When scanning for files in SRC_URI, the build system now uses FILESOVERRIDES instead of OVERRIDES for the directory names. In general, the values previously in OVERRIDES are now in FILESOVERRIDES as well. However, if you relied upon an additional value you previously added to OVERRIDES, you might now need to add it to FILESOVERRIDES unless you are already adding it through the MACHINEOVERRIDES or DISTROOVERRIDES variables, as appropriate. For more related changes, see the "Variables" section.

4.3.3. Proxies and Fetching Source

A new oe-git-proxy script has been added to replace previous methods of handling proxies and fetching source from Git. See the meta-yocto/conf/site.conf.sample file for information on how to use this script.

4.3.4. Custom Interfaces File (netbase change)

If you have created your own custom etc/network/interfaces file by creating an append file for the netbase recipe, you now need to create an append file for the init-ifupdown recipe instead, which you can find in the Source Directory at meta/recipes-core/init-ifupdown. For information on how to use append files, see the "Using .bbappend Files" section in the Yocto Project Development Tasks Manual.

4.3.5. Remote Debugging

Support for remote debugging with the Eclipse IDE is now separated into an image feature (eclipse-debug) that corresponds to the packagegroup-core-eclipse-debug package group. Previously, the debugging feature was included through the tools-debug image feature, which corresponds to the packagegroup-core-tools-debug package group.

4.3.6. Variables

The following variables have changed:

  • SANITY_TESTED_DISTROS: This variable now uses a distribution ID, which is composed of the host distributor ID followed by the release. Previously, SANITY_TESTED_DISTROS was composed of the description field. For example, "Ubuntu 12.10" becomes "Ubuntu-12.10". You do not need to worry about this change if you are not specifically setting this variable, or if you are specifically setting it to "".

  • SRC_URI: The ${PN}, ${PF}, ${P}, and FILE_DIRNAME directories have been dropped from the default value of the FILESPATH variable, which is used as the search path for finding files referred to in SRC_URI. If you have a recipe that relied upon these directories, which would be unusual, then you will need to add the appropriate paths within the recipe or, alternatively, rearrange the files. The most common locations are still covered by ${BP}, ${BPN}, and "files", which all remain in the default value of FILESPATH.

4.3.7. Target Package Management with RPM

If runtime package management is enabled and the RPM backend is selected, Smart is now installed for package download, dependency resolution, and upgrades instead of Zypper. For more information on how to use Smart, run the following command on the target:

     smart --help
            

4.3.8. Recipes Moved

The following recipes were moved from their previous locations because they are no longer used by anything in the OpenEmbedded-Core:

  • clutter-box2d: Now resides in the meta-oe layer.

  • evolution-data-server: Now resides in the meta-gnome layer.

  • gthumb: Now resides in the meta-gnome layer.

  • gtkhtml2: Now resides in the meta-oe layer.

  • gupnp: Now resides in the meta-multimedia layer.

  • gypsy: Now resides in the meta-oe layer.

  • libcanberra: Now resides in the meta-gnome layer.

  • libgdata: Now resides in the meta-gnome layer.

  • libmusicbrainz: Now resides in the meta-multimedia layer.

  • metacity: Now resides in the meta-gnome layer.

  • polkit: Now resides in the meta-oe layer.

  • zeroconf: Now resides in the meta-networking layer.

4.3.9. Removals and Renames

The following list shows what has been removed or renamed:

  • evieext: Removed because it has been removed from xserver since 2008.

  • Gtk+ DirectFB: Removed support because upstream Gtk+ no longer supports it as of version 2.18.

  • libxfontcache / xfontcacheproto: Removed because they were removed from the Xorg server in 2008.

  • libxp / libxprintapputil / libxprintutil / printproto: Removed because the XPrint server was removed from Xorg in 2008.

  • libxtrap / xtrapproto: Removed because their functionality was broken upstream.

  • linux-yocto 3.0 kernel: Removed with linux-yocto 3.8 kernel being added. The linux-yocto 3.2 and linux-yocto 3.4 kernels remain as part of the release.

  • lsbsetup: Removed with functionality now provided by lsbtest.

  • matchbox-stroke: Removed because it was never more than a proof-of-concept.

  • matchbox-wm-2 / matchbox-theme-sato-2: Removed because they are not maintained. However, matchbox-wm and matchbox-theme-sato are still provided.

  • mesa-dri: Renamed to mesa.

  • mesa-xlib: Removed because it was no longer useful.

  • mutter: Removed because nothing ever uses it and the recipe is very old.

  • orinoco-conf: Removed because it has become obsolete.

  • update-modules: Removed because it is no longer used. The kernel module postinstall and postrm scripts can now do the same task without the use of this script.

  • web: Removed because it is not maintained. Superseded by web-webkit.

  • xf86bigfontproto: Removed because upstream it has been disabled by default since 2007. Nothing uses xf86bigfontproto.

  • xf86rushproto: Removed because its dependency in xserver was spurious and it was removed in 2005.

  • zypper / libzypp / sat-solver: Removed and been functionally replaced with Smart (python-smartpm) when RPM packaging is used and package management is enabled on the target.

4.4. Moving to the Yocto Project 1.5 Release

This section provides migration information for moving to the Yocto Project 1.5 Release from the prior release.

4.4.1. Host Dependency Changes

The OpenEmbedded build system now has some additional requirements on the host system:

  • Python 2.7.3+

  • Tar 1.24+

  • Git 1.7.8+

  • Patched version of Make if you are using 3.82. Most distributions that provide Make 3.82 use the patched version.

If the Linux distribution you are using on your build host does not provide packages for these, you can install and use the Buildtools tarball, which provides an SDK-like environment containing them.

For more information on this requirement, see the "Required Git, tar, and Python Versions" section.

4.4.2. atom-pc Board Support Package (BSP)

The atom-pc hardware reference BSP has been replaced by a genericx86 BSP. This BSP is not necessarily guaranteed to work on all x86 hardware, but it will run on a wider range of systems than the atom-pc did.

Note

Additionally, a genericx86-64 BSP has been added for 64-bit Atom systems.

4.4.3. BitBake

The following changes have been made that relate to BitBake:

  • BitBake now supports a _remove operator. The addition of this operator means you will have to rename any items in recipe space (functions, variables) whose names currently contain _remove_ or end with _remove to avoid unexpected behavior.

  • BitBake's global method pool has been removed. This method is not particularly useful and led to clashes between recipes containing functions that had the same name.

  • The "none" server backend has been removed. The "process" server backend has been serving well as the default for a long time now.

  • The bitbake-runtask script has been removed.

  • ${P} and ${PF} are no longer added to PROVIDES by default in bitbake.conf. These version-specific PROVIDES items were seldom used. Attempting to use them could result in two versions being built simultaneously rather than just one version due to the way BitBake resolves dependencies.

4.4.4. QA Warnings

The following changes have been made to the package QA checks:

  • If you have customized ERROR_QA or WARN_QA values in your configuration, check that they contain all of the issues that you wish to be reported. Previous Yocto Project versions contained a bug that meant that any item not mentioned in ERROR_QA or WARN_QA would be treated as a warning. Consequently, several important items were not already in the default value of WARN_QA. All of the possible QA checks are now documented in the "insane.bbclass" section.

  • An additional QA check has been added to check if /usr/share/info/dir is being installed. Your recipe should delete this file within do_install if "make install" is installing it.

  • If you are using the buildhistory class, the check for the package version going backwards is now controlled using a standard QA check. Thus, if you have customized your ERROR_QA or WARN_QA values and still wish to have this check performed, you should add "version-going-backwards" to your value for one or the other variables depending on how you wish it to be handled. See the documented QA checks in the "insane.bbclass" section.

4.4.5. Directory Layout Changes

The following directory changes exist:

  • Output SDK installer files are now named to include the image name and tuning architecture through the SDK_NAME variable.

  • Images and related files are now installed into a directory that is specific to the machine, instead of a parent directory containing output files for multiple machines. The DEPLOY_DIR_IMAGE variable continues to point to the directory containing images for the current MACHINE and should be used anywhere there is a need to refer to this directory. The runqemu script now uses this variable to find images and kernel binaries and will use BitBake to determine the directory. Alternatively, you can set the DEPLOY_DIR_IMAGE variable in the external environment.

  • When buildhistory is enabled, its output is now written under the Build Directory rather than TMPDIR. Doing so makes it easier to delete TMPDIR and preserve the build history. Additionally, data for produced SDKs is now split by IMAGE_NAME.

  • The pkgdata directory produced as part of the packaging process has been collapsed into a single machine-specific directory. This directory is located under sysroots and uses a machine-specific name (i.e. tmp/sysroots/machine/pkgdata).

4.4.6. Shortened Git SRCREV Values

BitBake will now shorten revisions from Git repositories from the normal 40 characters down to 10 characters within SRCPV for improved usability in path and file names. This change should be safe within contexts where these revisions are used because the chances of spatially close collisions is very low. Distant collisions are not a major issue in the way the values are used.

4.4.7. IMAGE_FEATURES

The following changes have been made that relate to IMAGE_FEATURES:

  • The value of IMAGE_FEATURES is now validated to ensure invalid feature items are not added. Some users mistakenly add package names to this variable instead of using IMAGE_INSTALL in order to have the package added to the image, which does not work. This change is intended to catch those kinds of situations. Valid IMAGE_FEATURES are drawn from PACKAGE_GROUP definitions, COMPLEMENTARY_GLOB and a new "validitems" varflag on IMAGE_FEATURES. The "validitems" varflag change allows additional features to be added if they are not provided using the previous two mechanisms.

  • The previously deprecated "apps-console-core" IMAGE_FEATURES item is no longer supported. Add "splash" to IMAGE_FEATURES if you wish to have the splash screen enabled, since this is all that apps-console-core was doing.

4.4.8. /run

The /run directory from the Filesystem Hierarchy Standard 3.0 has been introduced. You can find some of the implications for this change here. The change also means that recipes that install files to /var/run must be changed. You can find a guide on how to make these changes here.

4.4.9. Removal of Package Manager Database Within Image Recipes

The image core-image-minimal no longer adds remove_packaging_data_files to ROOTFS_POSTPROCESS_COMMAND. This addition is now handled automatically when "package-management" is not in IMAGE_FEATURES. If you have custom image recipes that make this addition, you should remove the lines, as they are not needed and might interfere with correct operation of postinstall scripts.

4.4.10. Images Now Rebuild Only on Changes Instead of Every Time

The do_rootfs and other related image construction tasks are no longer marked as "nostamp". Consequently, they will only be re-executed when their inputs have changed. Previous versions of the OpenEmbedded build system always rebuilt the image when requested rather when necessary.

4.4.11. Task Recipes

The previously deprecated task.bbclass has now been dropped. For recipes that previously inherited from this class, you should rename them from task-* to packagegroup-* and inherit packagegroup instead.

For more information, see the "packagegroup.bbclass" section.

4.4.12. BusyBox

By default, we now split BusyBox into two binaries: one that is suid root for those components that need it, and another for the rest of the components. Splitting BusyBox allows for optimization that eliminates the tinylogin recipe as recommended by upstream. You can disable this split by setting BUSYBOX_SPLIT_SUID to "0".

4.4.13. Automated Image Testing

A new automated image testing framework has been added through the testimage.bbclass class. This framework replaces the older imagetest-qemu framework.

You can learn more about performing automated image tests in the "Performing Automated Runtime Testing" section in the Yocto Project Development Tasks Manual.

4.4.14. Build History

Following are changes to Build History:

  • Installed package sizes: installed-package-sizes.txt for an image now records the size of the files installed by each package instead of the size of each compressed package archive file.

  • The dependency graphs (depends*.dot) now use the actual package names instead of replacing dashes, dots and plus signs with underscores.

  • The buildhistory-diff and buildhistory-collect-srcrevs utilities have improved command-line handling. Use the --help option for each utility for more information on the new syntax.

For more information on Build History, see the "Maintaining Build Output Quality" section in the Yocto Project Development Tasks Manual.

4.4.15. udev

Following are changes to udev:

  • udev no longer brings in udev-extraconf automatically through RRECOMMENDS, since this was originally intended to be optional. If you need the extra rules, then add udev-extraconf to your image.

  • udev no longer brings in pciutils-ids or usbutils-ids through RRECOMMENDS. These are not needed by udev itself and removing them saves around 350KB.

4.4.16. Removed and Renamed Recipes

  • The linux-yocto 3.2 kernel has been removed.

  • libtool-nativesdk has been renamed to nativesdk-libtool.

  • tinylogin has been removed. It has been replaced by a suid portion of Busybox. See the "BusyBox" section for more information.

  • external-python-tarball has been renamed to buildtools-tarball.

  • web-webkit has been removed. It has been functionally replaced by midori.

  • imake has been removed. It is no longer needed by any other recipe.

  • transfig-native has been removed. It is no longer needed by any other recipe.

  • anjuta-remote-run has been removed. Anjuta IDE integration has not been officially supported for several releases.

4.4.17. Other Changes

Following is a list of short entries describing other changes:

  • run-postinsts: Make this generic.

  • base-files: Remove the unnecessary media/xxx directories.

  • alsa-state: Provide an empty asound.conf by default.

  • classes/image: Ensure BAD_RECOMMENDATIONS supports pre-renamed package names.

  • classes/rootfs_rpm: Implement BAD_RECOMMENDATIONS for RPM.

  • systemd: Remove systemd_unitdir if systemd is not in DISTRO_FEATURES.

  • systemd: Remove init.d dir if systemd unit file is present and sysvinit is not a distro feature.

  • libpam: Deny all services for the OTHER entries.

  • image.bbclass: Move runtime_mapping_rename to avoid conflict with multilib. See YOCTO #4993 in Bugzilla for more information.

  • linux-dtb: Use kernel build system to generate the dtb files.

  • kern-tools: Switch from guilt to new kgit-s2q tool.

4.5. Moving to the Yocto Project 1.6 Release

This section provides migration information for moving to the Yocto Project 1.6 Release from the prior release.

4.5.1. archiver Class

The archiver class has been rewritten and its configuration has been simplified. For more details on the source archiver, see the "Maintaining Open Source License Compliance During Your Product's Lifecycle" section in the Yocto Project Development Tasks Manual.

4.5.2. Packaging Changes

The following packaging changes have been made:

  • The binutils recipe no longer produces a binutils-symlinks package. update-alternatives is now used to handle the preferred binutils variant on the target instead.

  • The tc (traffic control) utilities have been split out of the main iproute2 package and put into the iproute2-tc package.

  • The gtk-engines schemas have been moved to a dedicated gtk-engines-schemas package.

  • The armv7a with thumb package architecture suffix has changed. The suffix for these packages with the thumb optimization enabled is "t2" as it should be. Use of this suffix was not the case in the 1.5 release. Architecture names will change within package feeds as a result.

4.5.3. BitBake

The following changes have been made to BitBake.

4.5.3.1. Matching Branch Requirement for Git Fetching

When fetching source from a Git repository using SRC_URI, BitBake will now validate the SRCREV value against the branch. You can specify the branch using the following form:

     SRC_URI = "git://server.name/repository;branch=branchname"
                

If you do not specify a branch, BitBake looks in the default "master" branch.

Alternatively, if you need to bypass this check (e.g. if you are fetching a revision corresponding to a tag that is not on any branch), you can add ";nobranch=1" to the end of the URL within SRC_URI.

4.5.3.2. Python Definition substitutions

BitBake had some previously deprecated Python definitions within its bb module removed. You should use their sub-module counterparts instead:

  • bb.MalformedUrl: Use bb.fetch.MalformedUrl.

  • bb.encodeurl: Use bb.fetch.encodeurl.

  • bb.decodeurl: Use bb.fetch.decodeurl

  • bb.mkdirhier: Use bb.utils.mkdirhier.

  • bb.movefile: Use bb.utils.movefile.

  • bb.copyfile: Use bb.utils.copyfile.

  • bb.which: Use bb.utils.which.

  • bb.vercmp_string: Use bb.utils.vercmp_string.

  • bb.vercmp: Use bb.utils.vercmp.

4.5.3.3. SVK Fetcher

The SVK fetcher has been removed from BitBake.

4.5.3.4. Console Output Error Redirection

The BitBake console UI will now output errors to stderr instead of stdout. Consequently, if you are piping or redirecting the output of bitbake to somewhere else, and you wish to retain the errors, you will need to add 2>&1 (or something similar) to the end of your bitbake command line.

4.5.3.5. task-taskname Overrides

task-taskname overrides have been adjusted so that tasks whose names contain underscores have the underscores replaced by hyphens for the override so that they now function properly. For example, the task override for do_populate_sdk is task-populate-sdk.

4.5.4. Changes to Variables

The following variables have changed. For information on the OpenEmbedded build system variables, see the "Variables Glossary" Chapter.

4.5.4.1. TMPDIR

TMPDIR can no longer be on an NFS mount. NFS does not offer full POSIX locking and inode consistency and can cause unexpected issues if used to store TMPDIR.

The check for this occurs on startup. If TMPDIR is detected on an NFS mount, an error occurs.

4.5.4.2. PRINC

The PRINC variable has been deprecated and triggers a warning if detected during a build. For PR increments on changes, use the PR service instead. You can find out more about this service in the "Working With a PR Service" section in the Yocto Project Development Tasks Manual.

4.5.4.3. IMAGE_TYPES

The "sum.jffs2" option for IMAGE_TYPES has been replaced by the "jffs2.sum" option, which fits the processing order.

4.5.4.4. COPY_LIC_MANIFEST

The COPY_LIC_MANIFEST variable must now be set to "1" rather than any value in order to enable it.

4.5.4.5. COPY_LIC_DIRS

The COPY_LIC_DIRS variable must now be set to "1" rather than any value in order to enable it.

4.5.4.6. PACKAGE_GROUP

The PACKAGE_GROUP variable has been renamed to FEATURE_PACKAGES to more accurately reflect its purpose. You can still use PACKAGE_GROUP but the OpenEmbedded build system produces a warning message when it encounters the variable.

4.5.4.7. Preprocess and Post Process Command Variable Behavior

The following variables now expect a semicolon separated list of functions to call and not arbitrary shell commands:

     ROOTFS_PREPROCESS_COMMAND
     ROOTFS_POSTPROCESS_COMMAND
     SDK_POSTPROCESS_COMMAND
     POPULATE_SDK_POST_TARGET_COMMAND
     POPULATE_SDK_POST_HOST_COMMAND
     IMAGE_POSTPROCESS_COMMAND
     IMAGE_PREPROCESS_COMMAND
     ROOTFS_POSTUNINSTALL_COMMAND
     ROOTFS_POSTINSTALL_COMMAND
                

For migration purposes, you can simply wrap shell commands in a shell function and then call the function. Here is an example:

     my_postprocess_function() {
        echo "hello" > ${IMAGE_ROOTFS}/hello.txt
     }
     ROOTFS_POSTPROCESS_COMMAND += "my_postprocess_function; "
                

4.5.5. Package Test (ptest)

Package Tests (ptest) are built but not installed by default. For information on using Package Tests, see the "Testing Packages with ptest" section in the Yocto Project Development Tasks Manual. For information on the ptest class, see the "ptest.bbclass" section.

4.5.6. Build Changes

Separate build and source directories have been enabled by default for selected recipes where it is known to work (a whitelist) and for all recipes that inherit the cmake class. In future releases the autotools class will enable a separate build directory by default as well. Recipes building Autotools-based software that fails to build with a separate build directory should be changed to inherit from the autotools-brokensep class instead of the autotools or autotools_stageclasses.

4.5.7. qemu-native

qemu-native now builds without SDL-based graphical output support by default. The following additional lines are needed in your local.conf to enable it:

     PACKAGECONFIG_pn-qemu-native = "sdl"
     ASSUME_PROVIDED += "libsdl-native"
            

Note

The default local.conf contains these statements. Consequently, if you are building a headless system and using a default local.conf file, you will need comment these two lines out.

4.5.8. core-image-basic

core-image-basic has been renamed to core-image-full-cmdline.

In addition to core-image-basic being renamed, packagegroup-core-basic has been renamed to packagegroup-core-full-cmdline to match.

4.5.9. Licensing

The top-level LICENSE file has been changed to better describe the license of the various components of OE-Core. However, the licensing itself remains unchanged.

Normally, this change would not cause any side-effects. However, some recipes point to this file within LIC_FILES_CHKSUM (as ${COREBASE}/LICENSE) and thus the accompanying checksum must be changed from 3f40d7994397109285ec7b81fdeb3b58 to 4d92cd373abda3937c2bc47fbc49d690. A better alternative is to have LIC_FILES_CHKSUM point to a file describing the license that is distributed with the source that the recipe is building, if possible, rather than pointing to ${COREBASE}/LICENSE.

4.5.10. CFLAGS Options

The "-fpermissive" option has been removed from the default CFLAGS value. You need to take action on individual recipes that fail when building with this option. You need to either patch the recipes to fix the issues reported by the compiler, or you need to add "-fpermissive" to CFLAGS in the recipes.

4.5.11. Custom Image Output Types

Custom image output types, as selected using IMAGE_FSTYPES, must declare their dependencies on other image types (if any) using a new IMAGE_TYPEDEP variable.

4.5.12. Tasks

The do_package_write task has been removed. The task is no longer needed.

4.5.13. update-alternative Provider

The default update-alternatives provider has been changed from opkg to opkg-utils. This change resolves some troublesome circular dependencies. The runtime package has also been renamed from update-alternatives-cworth to update-alternatives-opkg.

4.5.14. virtclass Overrides

The virtclass overrides are now deprecated. Use the equivalent class overrides instead (e.g. virtclass-native becomes class-native.)

4.5.15. Removed and Renamed Recipes

The following recipes have been removed:

  • packagegroup-toolset-native - This recipe is largely unused.

  • linux-yocto-3.8 - Support for the Linux yocto 3.8 kernel has been dropped. Support for the 3.10 and 3.14 kernels have been added with the linux-yocto-3.10 and linux-yocto-3.14 recipes.

  • ocf-linux - This recipe has been functionally replaced using cryptodev-linux.

  • genext2fs - genext2fs is no longer used by the build system and is unmaintained upstream.

  • js - This provided an ancient version of Mozilla's javascript engine that is no longer needed.

  • zaurusd - The recipe has been moved to the meta-handheld layer.

  • eglibc 2.17 - Replaced by the eglibc 2.19 recipe.

  • gcc 4.7.2 - Replaced by the now stable gcc 4.8.2.

  • external-sourcery-toolchain - this recipe is now maintained in the meta-sourcery layer.

  • linux-libc-headers-yocto 3.4+git - Now using version 3.10 of the linux-libc-headers by default.

  • meta-toolchain-gmae - This recipe is obsolete.

  • packagegroup-core-sdk-gmae - This recipe is obsolete.

  • packagegroup-core-standalone-gmae-sdk-target - This recipe is obsolete.

4.5.16. Removed Classes

The following classes have become obsolete and have been removed:

  • module_strip

  • pkg_metainfo

  • pkg_distribute

  • image-empty

4.5.17. Reference Board Support Packages (BSPs)

The following reference BSPs changes occurred:

  • The BeagleBoard (beagleboard) ARM reference hardware has been replaced by the BeagleBone (beaglebone) hardware.

  • The RouterStation Pro (routerstationpro) MIPS reference hardware has been replaced by the EdgeRouter Lite (edgerouter) hardware.

The previous reference BSPs for the beagleboard and routerstationpro machines are still available in a new meta-yocto-bsp-old layer in the Source Repositories at http://git.yoctoproject.org/cgit/cgit.cgi/meta-yocto-bsp-old/.

4.6. Moving to the Yocto Project 1.7 Release

This section provides migration information for moving to the Yocto Project 1.7 Release from the prior release.

4.6.1. Changes to Setting QEMU PACKAGECONFIG Options in local.conf

The QEMU recipe now uses a number of PACKAGECONFIG options to enable various optional features. The method used to set defaults for these options means that existing local.conf files will need to be be modified to append to PACKAGECONFIG for qemu-native and nativesdk-qemu instead of setting it. In other words, to enable graphical output for QEMU, you should now have these lines in local.conf:

     PACKAGECONFIG_append_pn-qemu-native = " sdl"
     PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
            

4.6.2. Minimum Git version

The minimum Git version required on the build host is now 1.7.8 because the --list option is now required by BitBake's Git fetcher. As always, if your host distribution does not provide a version of Git that meets this requirement, you can use the buildtools-tarball that does. See the "Required Git, tar, and Python Versions" section for more information.

4.6.3. Autotools Class Changes

The following autotools class changes occurred:

  • A separate build directory is now used by default: The autotools class has been changed to use a directory for building (B), which is separate from the source directory (S). This is commonly referred to as B != S, or an out-of-tree build.

    If the software being built is already capable of building in a directory separate from the source, you do not need to do anything. However, if the software is not capable of being built in this manner, you will need to either patch the software so that it can build separately, or you will need to change the recipe to inherit the autotools-brokensep class instead of the autotools or autotools_stage classes.

  • The --foreign option is no longer passed to automake when running autoconf: This option tells automake that a particular software package does not follow the GNU standards and therefore should not be expected to distribute certain files such as ChangeLog, AUTHORS, and so forth. Because the majority of upstream software packages already tell automake to enable foreign mode themselves, the option is mostly superfluous. However, some recipes will need patches for this change. You can easily make the change by patching configure.ac so that it passes "foreign" to AM_INIT_AUTOMAKE(). See this commit for an example showing how to make the patch.

4.6.4. Binary Configuration Scripts Disabled

Some of the core recipes that package binary configuration scripts now disable the scripts due to the scripts previously requiring error-prone path substitution. Software that links against these libraries using these scripts should use the much more robust pkg-config instead. The list of recipes changed in this version (and their configuration scripts) is as follows:

     directfb (directfb-config)
     freetype (freetype-config)
     gpgme (gpgme-config)
     libassuan (libassuan-config)
     libcroco (croco-6.0-config)
     libgcrypt (libgcrypt-config)
     libgpg-error (gpg-error-config)
     libksba (ksba-config)
     libpcap (pcap-config)
     libpcre (pcre-config)
     libpng (libpng-config, libpng16-config)
     libsdl (sdl-config)
     libusb-compat (libusb-config)
     libxml2 (xml2-config)
     libxslt (xslt-config)
     ncurses (ncurses-config)
     neon (neon-config)
     npth (npth-config)
     pth (pth-config)
     taglib (taglib-config)
            

Additionally, support for pkg-config has been added to some recipes in the previous list in the rare cases where the upstream software package does not already provide it.

4.6.5. eglibc 2.19 Replaced with glibc 2.20

Because eglibc and glibc were already fairly close, this replacement should not require any significant changes to other software that links to eglibc. However, there were a number of minor changes in glibc 2.20 upstream that could require patching some software (e.g. the removal of the _BSD_SOURCE feature test macro).

glibc 2.20 requires version 2.6.32 or greater of the Linux kernel. Thus, older kernels will no longer be usable in conjunction with it.

For full details on the changes in glibc 2.20, see the upstream release notes here.

4.6.6. Kernel Module Autoloading

The module_autoload_* variable is now deprecated and a new KERNEL_MODULE_AUTOLOAD variable should be used instead. Also, module_conf_* must now be used in conjunction with a new KERNEL_MODULE_PROBECONF variable. The new variables no longer require you to specify the module name as part of the variable name. This change not only simplifies usage but also allows the values of these variables to be appropriately incorporated into task signatures and thus trigger the appropriate tasks to re-execute when changed. You should replace any references to module_autoload_* with KERNEL_MODULE_AUTOLOAD, and add any modules for which module_conf_* is specified to KERNEL_MODULE_PROBECONF.

4.6.7. QA Check Changes

The following changes have occurred to the QA check process:

  • Additional QA checks file-rdeps and build-deps have been added in order to verify that file dependencies are satisfied (e.g. package contains a script requiring /bin/bash) and build-time dependencies are declared, respectively. For more information, please see the "QA Error and Warning Messages" chapter.

  • Package QA checks are now performed during a new do_package_qa task rather than being part of the do_package task. This allows more parallel execution. This change is unlikely to be an issue except for highly customized recipes that disable packaging tasks themselves by marking them as noexec. For those packages, you will need to disable the do_package_qa task as well.

  • Files being overwritten during the do_populate_sysroot task now trigger an error instead of a warning. Recipes should not be overwriting files written to the sysroot by other recipes. If you have these types of recipes, you need to alter them so that they do not overwrite these files.

    You might now receive this error after changes in configuration or metadata resulting in orphaned files being left in the sysroot. If you do receive this error, the way to resolve the issue is to delete your TMPDIR or to move it out of the way and then re-start the build. Anything that has been fully built up to that point and does not need rebuilding will be restored from the shared state cache and the rest of the build will be able to proceed as normal.

4.6.8. Removed Recipes

The following recipes have been removed:

  • x-load: This recipe has been superseded by U-boot SPL for all Cortex-based TI SoCs. For legacy boards, the meta-ti layer, which contains a maintained recipe, should be used instead.

  • ubootchart: This recipe is obsolete. A bootchart2 recipe has been added to functionally replace it.

  • linux-yocto 3.4: Support for the linux-yocto 3.4 kernel has been dropped. Support for the 3.10 and 3.14 kernels remains, while support for version 3.17 has been added.

  • eglibc has been removed in favor of glibc. See the "eglibc 2.19 Replaced with glibc 2.20" section for more information.

4.6.9. Miscellaneous Changes

The following miscellaneous change occurred:

  • The build history feature now writes build-id.txt instead of build-id. Additionally, build-id.txt now contains the full build header as printed by BitBake upon starting the build. You should manually remove old "build-id" files from your existing build history repositories to avoid confusion. For information on the build history feature, see the "Maintaining Build Output Quality" section in the Yocto Project Development Tasks Manual.

4.7. Moving to the Yocto Project 1.8 Release

This section provides migration information for moving to the Yocto Project 1.8 Release from the prior release.

4.7.1. Removed Recipes

The following recipes have been removed:

  • owl-video: Functionality replaced by gst-player.

  • gaku: Functionality replaced by gst-player.

  • gnome-desktop: This recipe is now available in meta-gnome and is no longer needed.

  • gsettings-desktop-schemas: This recipe is now available in meta-gnome and is no longer needed.

  • python-argparse: The argparse module is already provided in the default Python distribution in a package named python-argparse. Consequently, the separate python-argparse recipe is no longer needed.

  • telepathy-python, libtelepathy, telepathy-glib, telepathy-idle, telepathy-mission-control: All these recipes have moved to meta-oe and are consequently no longer needed by any recipes in OpenEmbedded-Core.

  • linux-yocto_3.10 and linux-yocto_3.17: Support for the linux-yocto 3.10 and 3.17 kernels has been dropped. Support for the 3.14 kernel remains, while support for 3.19 kernel has been added.

  • poky-feed-config-opkg: This recipe has become obsolete and is no longer needed. Use distro-feed-config from meta-oe instead.

  • libav 0.8.x: libav 9.x is now used.

  • sed-native: No longer needed. A working version of sed is expected to be provided by the host distribution.

4.7.2. BlueZ 4.x / 5.x Selection

Proper built-in support for selecting BlueZ 5.x in preference to the default of 4.x now exists. To use BlueZ 5.x, simply add "bluez5" to your DISTRO_FEATURES value. If you had previously added append files (*.bbappend) to make this selection, you can now remove them.

Additionally, a bluetooth class has been added to make selection of the appropriate bluetooth support within a recipe a little easier. If you wish to make use of this class in a recipe, add something such as the following:

     inherit bluetooth
     PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)}
     PACKAGECONFIG[bluez4] = "--enable-bluetooth,--disable-bluetooth,bluez4"
     PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5"
            

4.7.3. Kernel Build Changes

The kernel build process was changed to place the source in a common shared work area and to place build artifacts separately in the source code tree. In theory, migration paths have been provided for most common usages in kernel recipes but this might not work in all cases. In particular, users need to ensure that ${S} (source files) and ${B} (build artifacts) are used correctly in functions such as do_configure and do_install. For kernel recipes that do not inherit from kernel-yocto or include linux-yocto.inc, you might wish to refer to the linux.inc file in the meta-oe layer for the kinds of changes you need to make. For reference, here is the commit where the linux.inc file in meta-oe was updated.

Recipes that rely on the kernel source code and do not inherit the module classes might need to add explicit dependencies on the do_shared_workdir kernel task, for example:

     do_configure[depends] += "virtual/kernel:do_shared_workdir"
            

4.7.4. SSL 3.0 is Now Disabled in OpenSSL

SSL 3.0 is now disabled when building OpenSSL. Disabling SSL 3.0 avoids any lingering instances of the POODLE vulnerability. If you feel you must re-enable SSL 3.0, then you can add an append file (*.bbappend) for the openssl recipe to remove "-no-ssl3" from EXTRA_OECONF.

4.7.5. Default Sysroot Poisoning

gcc's default sysroot and include directories are now "poisoned". In other words, the sysroot and include directories are being redirected to a non-existent location in order to catch when host directories are being used due to the correct options not being passed. This poisoning applies both to the cross-compiler used within the build and to the cross-compiler produced in the SDK.

If this change causes something in the build to fail, it almost certainly means the various compiler flags and commands are not being passed correctly to the underlying piece of software. In such cases, you need to take corrective steps.

4.7.6. Rebuild Improvements

Changes have been made to the base, autotools, and cmake classes to clean out generated files when the do_configure task needs to be re-executed.

One of the improvements is to attempt to run "make clean" during the do_configure task if a Makefile exists. Some software packages do not provide a working clean target within their make files. If you have such recipes, you need to set CLEANBROKEN to "1" within the recipe, for example:

     CLEANBROKEN = "1"
            

4.7.7. QA Check and Validation Changes

The following QA Check and Validation Changes have occurred:

  • Usage of PRINC previously triggered a warning. It now triggers an error. You should remove any remaining usage of PRINC in any recipe or append file.

  • An additional QA check has been added to detect usage of ${D} in FILES values where D values should not be used at all. The same check ensures that $D is used in pkg_preinst/pkg_postinst/pkg_prerm/pkg_postrm functions instead of ${D}.

  • S now needs to be set to a valid value within a recipe. If S is not set in the recipe, the directory is not automatically created. If S does not point to a directory that exists at the time the do_unpack task finishes, a warning will be shown.

  • LICENSE is now validated for correct formatting of multiple licenses. If the format is invalid (e.g. multiple licenses are specified with no operators to specify how the multiple licenses interact), then a warning will be shown.

4.7.8. Miscellaneous Changes

The following miscellaneous changes have occurred:

  • The send-error-report script now expects a "-s" option to be specified before the server address. This assumes a server address is being specified.

  • The oe-pkgdata-util script now expects a "-p" option to be specified before the pkgdata directory, which is now optional. If the pkgdata directory is not specified, the script will run BitBake to query PKGDATA_DIR from the build environment.

4.8. Moving to the Yocto Project 2.0 Release

This section provides migration information for moving to the Yocto Project 2.0 Release from the prior release.

4.8.1. GCC 5

The default compiler is now GCC 5.2. This change has required fixes for compilation errors in a number of other recipes.

One important example is a fix for when the Linux kernel freezes at boot time on ARM when built with GCC 5. If you are using your own kernel recipe or source tree and building for ARM, you will likely need to apply this patch. The standard linux-yocto kernel source tree already has a workaround for the same issue.

For further details, see https://gcc.gnu.org/gcc-5/changes.html and the porting guide at https://gcc.gnu.org/gcc-5/porting_to.html.

Alternatively, you can switch back to GCC 4.9 or 4.8 by setting GCCVERSION in your configuration, as follows:

     GCCVERSION = "4.9%"
            

4.8.2. Gstreamer 0.10 Removed

Gstreamer 0.10 has been removed in favor of Gstreamer 1.x. As part of the change, recipes for Gstreamer 0.10 and related software are now located in meta-multimedia. This change results in Qt4 having Phonon and Gstreamer support in QtWebkit disabled by default.

4.8.3. Removed Recipes

The following recipes have been moved or removed:

  • bluez4: The recipe is obsolete and has been moved due to bluez5 becoming fully integrated. The bluez4 recipe now resides in meta-oe.

  • gamin: The recipe is obsolete and has been removed.

  • gnome-icon-theme: The recipe's functionally has been replaced by adwaita-icon-theme.

  • Gstreamer 0.10 Recipes: Recipes for Gstreamer 0.10 have been removed in favor of the recipes for Gstreamer 1.x.

  • insserv: The recipe is obsolete and has been removed.

  • libunique: The recipe is no longer used and has been moved to meta-oe.

  • midori: The recipe's functionally has been replaced by epiphany.

  • python-gst: The recipe is obsolete and has been removed since it only contains bindings for Gstreamer 0.10.

  • qt-mobility: The recipe is obsolete and has been removed since it requires Gstreamer 0.10, which has been replaced.

  • subversion: All 1.6.x versions of this recipe have been removed.

  • webkit-gtk: The older 1.8.3 version of this recipe has been removed in favor of webkitgtk.

4.8.4. BitBake datastore improvements

The method by which BitBake's datastore handles overrides has changed. Overrides are now applied dynamically and bb.data.update_data() is now a no-op. Thus, bb.data.update_data() is no longer required in order to apply the correct overrides. In practice, this change is unlikely to require any changes to Metadata. However, these minor changes in behavior exist:

  • All potential overrides are now visible in the variable history as seen when you run the following:

         $ bitbake -e
                        

  • d.delVar('VARNAME') and d.setVar('VARNAME', None) result in the variable and all of its overrides being cleared out. Before the change, only the non-overridden values were cleared.

4.8.5. Shell Message Function Changes

The shell versions of the BitBake message functions (i.e. bbdebug, bbnote, bbwarn, bbplain, bberror, and bbfatal) are now connected through to their BitBake equivalents bb.debug(), bb.note(), bb.warn(), bb.plain(), bb.error(), and bb.fatal(), respectively. Thus, those message functions that you would expect to be printed by the BitBake UI are now actually printed. In practice, this change means two things:

  • If you now see messages on the console that you did not previously see as a result of this change, you might need to clean up the calls to bbwarn, bberror, and so forth. Or, you might want to simply remove the calls.

  • The bbfatal message function now suppresses the full error log in the UI, which means any calls to bbfatal where you still wish to see the full error log should be replaced by die or bbfatal_log.

4.8.6. Extra Development/Debug Package Cleanup

The following recipes have had extra dev/dbg packages removed:

  • acl

  • apmd

  • aspell

  • attr

  • augeas

  • bzip2

  • cogl

  • curl

  • elfutils

  • gcc-target

  • libgcc

  • libtool

  • libxmu

  • opkg

  • pciutils

  • rpm

  • sysfsutils

  • tiff

  • xz

All of the above recipes now conform to the standard packaging scheme where a single -dev, -dbg, and -staticdev package exists per recipe.

4.8.7. Recipe Maintenance Tracking Data Moved to OE-Core

Maintenance tracking data for recipes that was previously part of meta-yocto has been moved to OE-Core. The change includes package_regex.inc and distro_alias.inc, which are typically enabled when using the distrodata class. Additionally, the contents of upstream_tracking.inc has now been split out to the relevant recipes.

4.8.8. Automatic Stale Sysroot File Cleanup

Stale files from recipes that no longer exist in the current configuration are now automatically removed from sysroot as well as removed from any other place managed by shared state. This automatic cleanup means that the build system now properly handles situations such as renaming the build system side of recipes, removal of layers from bblayers.conf, and DISTRO_FEATURES changes.

Additionally, work directories for old versions of recipes are now pruned. If you wish to disable pruning old work directories, you can set the following variable in your configuration:

     SSTATE_PRUNE_OBSOLETEWORKDIR = "0"
            

4.8.9. linux-yocto Kernel Metadata Repository Now Split from Source

The linux-yocto tree has up to now been a combined set of kernel changes and configuration (meta) data carried in a single tree. While this format is effective at keeping kernel configuration and source modifications synchronized, it is not always obvious to developers how to manipulate the Metadata as compared to the source.

Metadata processing has now been removed from the kernel-yocto class and the external Metadata repository yocto-kernel-cache, which has always been used to seed the linux-yocto "meta" branch. This separate linux-yocto cache repository is now the primary location for this data. Due to this change, linux-yocto is no longer able to process combined trees. Thus, if you need to have your own combined kernel repository, you must do the split there as well and update your recipes accordingly. See the meta/recipes-kernel/linux/linux-yocto_4.1.bb recipe for an example.

4.8.10. Additional QA checks

The following QA checks have been added:

  • Added a "host-user-contaminated" check for ownership issues for packaged files outside of /home. The check looks for files that are incorrectly owned by the user that ran BitBake instead of owned by a valid user in the target system.

  • Added an "invalid-chars" check for invalid (non-UTF8) characters in recipe metadata variable values (i.e. DESCRIPTION, SUMMARY, LICENSE, and SECTION). Some package managers do not support these characters.

  • Added an "invalid-packageconfig" check for any options specified in PACKAGECONFIG that do not match any PACKAGECONFIG option defined for the recipe.

4.8.11. Miscellaneous Changes

These additional changes exist:

  • gtk-update-icon-cache has been renamed to gtk-icon-utils.

  • The tools-profile IMAGE_FEATURES item as well as its corresponding packagegroup and packagegroup-core-tools-profile no longer bring in oprofile. Bringing in oprofile was originally added to aid compilation on resource-constrained targets. However, this aid has not been widely used and is not likely to be used going forward due to the more powerful target platforms and the existence of better cross-compilation tools.

  • The IMAGE_FSTYPES variable's default value now specifies ext4 instead of ext3.

  • All support for the PRINC variable has been removed.

  • The packagegroup-core-full-cmdline packagegroup no longer brings in lighttpd due to the fact that bringing in lighttpd is not really in line with the packagegroup's purpose, which is to add full versions of command-line tools that by default are provided by busybox.

4.9. Moving to the Yocto Project 2.1 Release

This section provides migration information for moving to the Yocto Project 2.1 Release from the prior release.

4.9.1. Variable Expansion in Python Functions

Variable expressions, such as ${VARNAME} no longer expand automatically within Python functions. Suppressing expansion was done to allow Python functions to construct shell scripts or other code for situations in which you do not want such expressions expanded. For any existing code that relies on these expansions, you need to change the expansions to expand the value of individual variables through d.getVar(). To alternatively expand more complex expressions, use d.expand().

4.9.2. Overrides Must Now be Lower-Case

The convention for overrides has always been for them to be lower-case characters. This practice is now a requirement as BitBake's datastore now assumes lower-case characters in order to give a slight performance boost during parsing. In practical terms, this requirement means that anything that ends up in OVERRIDES must now appear in lower-case characters (e.g. values for MACHINE, TARGET_ARCH, DISTRO, and also recipe names if _pn-recipename overrides are to be effective).

4.9.3. Expand Parameter to getVar() and getVarFlag() is Now Mandatory

The expand parameter to getVar() and getVarFlag() previously defaulted to False if not specified. Now, however, no default exists so one must be specified. You must change any getVar() calls that do not specify the final expand parameter to calls that do specify the parameter. You can run the following sed command at the base of a layer to make this change:

     sed -e 's:\(\.getVar([^,()]*\)):\1, False):g' -i `grep -ril getVar *`
     sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, False):g' -i `grep -ril getVarFlag *`
            

Note

The reason for this change is that it prepares the way for changing the default to True in a future Yocto Project release. This future change is a much more sensible default than False. However, the change needs to be made gradually as a sudden change of the default would potentially cause side-effects that would be difficult to detect.

4.9.4. Makefile Environment Changes

EXTRA_OEMAKE now defaults to "" instead of "-e MAKEFLAGS=". Setting EXTRA_OEMAKE to "-e MAKEFLAGS=" by default was a historical accident that has required many classes (e.g. autotools, module) and recipes to override this default in order to work with sensible build systems. When upgrading to the release, you must edit any recipe that relies upon this old default by either setting EXTRA_OEMAKE back to "-e MAKEFLAGS=" or by explicitly setting any required variable value overrides using EXTRA_OEMAKE, which is typically only needed when a Makefile sets a default value for a variable that is inappropriate for cross-compilation using the "=" operator rather than the "?=" operator.

4.9.5. libexecdir Reverted to ${prefix}/libexec

The use of ${libdir}/${BPN} as libexecdir is different as compared to all other mainstream distributions, which either uses ${prefix}/libexec or ${libdir}. The use is also contrary to the GNU Coding Standards (i.e. https://www.gnu.org/prep/standards/html_node/Directory-Variables.html) that suggest ${prefix}/libexec and also notes that any package-specific nesting should be done by the package itself. Finally, having libexecdir change between recipes makes it very difficult for different recipes to invoke binaries that have been installed into libexecdir. The Filesystem Hierarchy Standard (i.e. http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html) now recognizes the use of ${prefix}/libexec/, giving distributions the choice between ${prefix}/lib or ${prefix}/libexec without breaking FHS.

4.9.6. ac_cv_sizeof_off_t is No Longer Cached in Site Files

For recipes inheriting the autotools class, ac_cv_sizeof_off_t is no longer cached in the site files for autoconf. The reason for this change is because the ac_cv_sizeof_off_t value is not necessarily static per architecture as was previously assumed. Rather, the value changes based on whether large file support is enabled. For most software that uses autoconf, this change should not be a problem. However, if you have a recipe that bypasses the standard do_configure task from the autotools class and the software the recipe is building uses a very old version of autoconf, the recipe might be incapable of determining the correct size of off_t during do_configure.

The best course of action is to patch the software as necessary to allow the default implementation from the autotools class to work such that autoreconf succeeds and produces a working configure script, and to remove the overridden do_configure task such that the default implementation does get used.

4.9.7. Image Generation is Now Split Out from Filesystem Generation

Previously, for image recipes the do_rootfs task assembled the filesystem and then from that filesystem generated images. With this Yocto Project release, image generation is split into separate do_image_* tasks for clarity both in operation and in the code.

For most cases, this change does not present any problems. However, if you have made customizations that directly modify the do_rootfs task or that mention do_rootfs, you might need to update those changes. In particular, if you had added any tasks after do_rootfs, you should make edits so that those tasks are after the do_image_complete task rather than after do_rootfs so that the your added tasks run at the correct time.

A minor part of this restructuring is that the post-processing definitions and functions have been moved from the image class to the rootfs-postcommands class. Functionally, however, they remain unchanged.

4.9.8. Removed Recipes

The following recipes have been removed in the 2.1 release:

  • gcc version 4.8: Versions 4.9 and 5.3 remain.

  • qt4: All support for Qt 4.x has been moved out to a separate meta-qt4 layer because Qt 4 is no longer supported upstream.

  • x11vnc: Moved to the meta-oe layer.

  • linux-yocto-3.14: No longer supported.

  • linux-yocto-3.19: No longer supported.

  • libjpeg: Replaced by the libjpeg-turbo recipe.

  • pth: Became obsolete.

  • liboil: Recipe is no longer needed and has been moved to the meta-multimedia layer.

  • gtk-theme-torturer: Recipe is no longer needed and has been moved to the meta-gnome layer.

  • gnome-mime-data: Recipe is no longer needed and has been moved to the meta-gnome layer.

  • udev: Replaced by the eudev recipe for compatibility when using sysvinit with newer kernels.

  • python-pygtk: Recipe became obsolete.

  • adt-installer: Recipe became obsolete. See the "ADT Removed" section for more information.

4.9.9. Class Changes

The following classes have changed:

  • autotools_stage: Removed because the autotools class now provides its functionality. Recipes that inherited from autotools_stage should now inherit from autotools instead.

  • boot-directdisk: Merged into the image-vm class. The boot-directdisk class was rarely directly used. Consequently, this change should not cause any issues.

  • bootimg: Merged into the image-live class. The bootimg class was rarely directly used. Consequently, this change should not cause any issues.

  • packageinfo: Removed due to its limited use by the Hob UI, which has itself been removed.

4.9.10. Build System User Interface Changes

The following changes have been made to the build system user interface:

  • Hob GTK+-based UI: Removed because it is unmaintained and based on the outdated GTK+ 2 library. The Toaster web-based UI is much more capable and is actively maintained. See the "Using the Toaster Web Interface" section in the Toaster User Manual for more information on this interface.

  • "puccho" BitBake UI: Removed because is unmaintained and no longer useful.

4.9.11. ADT Removed

The Application Development Toolkit (ADT) has been removed because its functionality almost completely overlapped with the standard SDK and the extensible SDK. For information on these SDKs and how to build and use them, see the Yocto Project Application Development and the Extensible Software Development Kit (eSDK) manual.

Note

The Yocto Project Eclipse IDE Plug-in is still supported and is not affected by this change.

4.9.12. Poky Reference Distribution Changes

The following changes have been made for the Poky distribution:

  • The meta-yocto layer has been renamed to meta-poky to better match its purpose, which is to provide the Poky reference distribution. The meta-yocto-bsp layer retains its original name since it provides reference machines for the Yocto Project and it is otherwise unrelated to Poky. References to meta-yocto in your conf/bblayers.conf should automatically be updated, so you should not need to change anything unless you are relying on this naming elsewhere.

  • The uninative class is now enabled by default in Poky. This class attempts to isolate the build system from the host distribution's C library and makes re-use of native shared state artifacts across different host distributions practical. With this class enabled, a tarball containing a pre-built C library is downloaded at the start of the build.

    The uninative class is enabled through the meta/conf/distro/include/yocto-uninative.inc file, which for those not using the Poky distribution, can include to easily enable the same functionality.

    Alternatively, if you wish to build your own uninative tarball, you can do so by building the uninative-tarball recipe, making it available to your build machines (e.g. over HTTP/HTTPS) and setting a similar configuration as the one set by yocto-uninative.inc.

  • Static library generation, for most cases, is now disabled by default in the Poky distribution. Disabling this generation saves some build time as well as the size used for build output artifacts.

    Disabling this library generation is accomplished through a meta/conf/distro/include/no-static-libs.inc, which for those not using the Poky distribution can easily include to enable the same functionality.

    Any recipe that needs to opt-out of having the "--disable-static" option specified on the configure command line either because it is not a supported option for the configure script or because static libraries are needed should set the following variable:

         DISABLE_STATIC = ""
                        

  • The separate poky-tiny distribution now uses the musl C library instead of a heavily pared down glibc. Using musl results in a smaller distribution and facilitates much greater maintainability because musl is designed to have a small footprint.

    If you have used poky-tiny and have customized the glibc configuration you will need to redo those customizations with musl when upgrading to the new release.

4.9.13. Packaging Changes

The following changes have been made to packaging:

  • The runuser and mountpoint binaries, which were previously in the main util-linux package, have been split out into the util-linux-runuser and util-linux-mountpoint packages, respectively.

  • The python-elementtree package has been merged into the python-xml package.

4.9.14. Tuning File Changes

The following changes have been made to the tuning files:

  • The "no-thumb-interwork" tuning feature has been dropped from the ARM tune include files. Because interworking is required for ARM EABI, attempting to disable it through a tuning feature no longer makes sense.

    Note

    Support for ARM OABI was deprecated in gcc 4.7.

  • The tune-cortexm*.inc and tune-cortexr4.inc files have been removed because they are poorly tested. Until the OpenEmbedded build system officially gains support for CPUs without an MMU, these tuning files would probably be better maintained in a separate layer if needed.

4.9.15. Supporting GObject Introspection

This release supports generation of GLib Introspective Repository (GIR) files through GObject introspection, which is the standard mechanism for accessing GObject-based software from runtime environments. You can enable, disable, and test the generation of this data. See the "Enabling GObject Introspection Support" section in the Yocto Project Development Tasks Manual for more information.

4.9.16. Miscellaneous Changes

These additional changes exist:

  • The minimum Git version has been increased to 1.8.3.1. If your host distribution does not provide a sufficiently recent version, you can install the buildtools, which will provide it. See the "Required Git, tar, and Python Versions" section for more information on the buildtools tarball.

  • The buggy and incomplete support for the RPM version 4 package manager has been removed. The well-tested and maintained support for RPM version 5 remains.

  • Previously, the following list of packages were removed if package-management was not in IMAGE_FEATURES, regardless of any dependencies:

         update-rc.d
         base-passwd
         shadow
         update-alternatives
         run-postinsts
                        

    With the Yocto Project 2.1 release, these packages are only removed if "read-only-rootfs" is in IMAGE_FEATURES, since they might still be needed for a read-write image even in the absence of a package manager (e.g. if users need to be added, modified, or removed at runtime).

  • The devtool modify command now defaults to extracting the source since that is most commonly expected. The "-x" or "--extract" options are now no-ops. If you wish to provide your own existing source tree, you will now need to specify either the "-n" or "--no-extract" options when running devtool modify.

  • If the formfactor for a machine is either not supplied or does not specify whether a keyboard is attached, then the default is to assume a keyboard is attached rather than assume no keyboard. This change primarily affects the Sato UI.

  • The .debug directory packaging is now automatic. If your recipe builds software that installs binaries into directories other than the standard ones, you no longer need to take care of setting FILES_${PN}-dbg to pick up the resulting .debug directories as these directories are automatically found and added.

  • Inaccurate disk and CPU percentage data has been dropped from buildstats output. This data has been replaced with getrusage() data and corrected IO statistics. You will probably need to update any custom code that reads the buildstats data.

  • The meta/conf/distro/include/package_regex.inc is now deprecated. The contents of this file have been moved to individual recipes.

    Tip

    Because this file will likely be removed in a future Yocto Project release, it is suggested that you remove any references to the file that might be in your configuration.

  • The v86d/uvesafb has been removed from the genericx86 and genericx86-64 reference machines, which are provided by the meta-yocto-bsp layer. Most modern x86 boards do not rely on this file and it only adds kernel error messages during startup. If you do still need to support uvesafb, you can simply add v86d to your image.

  • Build sysroot paths are now removed from debug symbol files. Removing these paths means that remote GDB using an unstripped build system sysroot will no longer work (although this was never documented to work). The supported method to accomplish something similar is to set IMAGE_GEN_DEBUGFS to "1", which will generate a companion debug image containing unstripped binaries and associated debug sources alongside the image.

4.10. Moving to the Yocto Project 2.2 Release

This section provides migration information for moving to the Yocto Project 2.2 Release from the prior release.

4.10.1. Minimum Kernel Version

The minimum kernel version for the target system and for SDK is now 3.2.0, due to the upgrade to glibc 2.24. Specifically, for AArch64-based targets the version is 3.14. For Nios II-based targets, the minimum kernel version is 3.19.

Note

For x86 and x86_64, you can reset OLDEST_KERNEL to anything down to 2.6.32 if desired.

4.10.2. Staging Directories in Sysroot Has Been Simplified

The way directories are staged in sysroot has been simplified and introduces the new SYSROOT_DIRS, SYSROOT_DIRS_NATIVE, and SYSROOT_DIRS_BLACKLIST. See the v2 patch series on the OE-Core Mailing List for additional information.

4.10.3. Removal of Old Images and Other Files in tmp/deploy Now Enabled

Removal of old images and other files in tmp/deploy/ is now enabled by default due to a new staging method used for those files. As a result of this change, the RM_OLD_IMAGE variable is now redundant.

4.10.4. Python Changes

The following changes for Python occurred:

4.10.4.1. BitBake Now Requires Python 3.4+

BitBake requires Python 3.4 or greater.

4.10.4.2. UTF-8 Locale Required on Build Host

A UTF-8 locale is required on the build host due to Python 3. Since C.UTF-8 is not a standard, the default is en_US.UTF-8.

4.10.4.3. Metadata Must Now Use Python 3 Syntax

The metadata is now required to use Python 3 syntax. For help preparing metadata, see any of the many Python 3 porting guides available. Alternatively, you can reference the conversion commits for Bitbake and you can use OE-Core as a guide for changes. Following are particular areas of interest:

     * subprocess command-line pipes needing locale decoding
     * the syntax for octal values changed
     * the iter*() functions changed name
     * iterators now return views, not lists
     * changed names for Python modules
                

4.10.4.4. Target Python Recipes Switched to Python 3

Most target Python recipes have now been switched to Python 3. Unfortunately, systems using RPM as a package manager and providing online package-manager support through SMART still require Python 2.

Note

Python 2 and recipes that use it can still be built for the target as with previous versions.

4.10.4.5. buildtools-tarball Includes Python 3

buildtools-tarball now includes Python 3.

4.10.5. uClibc Replaced by musl

uClibc has been removed in favor of musl. Musl has matured, is better maintained, and is compatible with a wider range of applications as compared to uClibc.

4.10.6. ${B} No Longer Default Working Directory for Tasks

${B} is no longer the default working directory for tasks. Consequently, any custom tasks you define now need to either have the [dirs] flag set, or the task needs to change into the appropriate working directory manually (e.g using cd for a shell task).

Note

The preferred method is to use the [dirs] flag.

4.10.7. runqemu Ported to Python

runqemu has been ported to Python and has changed behavior in some cases. Previous usage patterns continue to be supported.

The new runqemu is a Python script. Machine knowledge is no longer hardcoded into runqemu. You can choose to use the qemuboot configuration file to define the BSP's own arguments and to make it bootable with runqemu. If you use a configuration file, use the following form:

     image-name-machine.qemuboot.conf
            

The configuration file enables fine-grained tuning of options passed to QEMU without the runqemu script hard-coding any knowledge about different machines. Using a configuration file is particularly convenient when trying to use QEMU with machines other than the qemu* machines in OE-Core. The qemuboot.conf file is generated by the qemuboot class when the root filesystem is being build (i.e. build rootfs). QEMU boot arguments can be set in BSP's configuration file and the qemuboot class will save them to qemuboot.conf.

If you want to use runqemu without a configuration file, use the following command form:

     $ runqemu machine rootfs kernel [options]
            

Supported machines are as follows:

     qemuarm
     qemuarm64
     qemux86
     qemux86-64
     qemuppc
     qemumips
     qemumips64
     qemumipsel
     qemumips64el
            

Consider the following example, which uses the qemux86-64 machine, provides a root filesystem, provides an image, and uses the nographic option:

$ runqemu qemux86-64 tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.ext4 tmp/deploy/images/qemux86-64/bzImage nographic
            

Following is a list of variables that can be set in configuration files such as bsp.conf to enable the BSP to be booted by runqemu:

Note

"QB" means "QEMU Boot".

     QB_SYSTEM_NAME: QEMU name (e.g. "qemu-system-i386")
     QB_OPT_APPEND: Options to append to QEMU (e.g. "-show-cursor")
     QB_DEFAULT_KERNEL: Default kernel to boot (e.g. "bzImage")
     QB_DEFAULT_FSTYPE: Default FSTYPE to boot (e.g. "ext4")
     QB_MEM: Memory (e.g. "-m 512")
     QB_MACHINE: QEMU machine (e.g. "-machine virt")
     QB_CPU: QEMU cpu (e.g. "-cpu qemu32")
     QB_CPU_KVM: Similar to QB_CPU except used for kvm support (e.g. "-cpu kvm64")
     QB_KERNEL_CMDLINE_APPEND: Options to append to the kernel's -append
                               option (e.g. "console=ttyS0 console=tty")
     QB_DTB: QEMU dtb name
     QB_AUDIO_DRV: QEMU audio driver (e.g. "alsa", set it when support audio)
     QB_AUDIO_OPT: QEMU audio option (e.g. "-soundhw ac97,es1370"), which is used
                   when QB_AUDIO_DRV is set.
     QB_KERNEL_ROOT: Kernel's root (e.g. /dev/vda)
     QB_TAP_OPT: Network option for 'tap' mode (e.g.
                 "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -device virtio-net-device,netdev=net0").
                  runqemu will replace "@TAP@" with the one that is used, such as tap0, tap1 ...
     QB_SLIRP_OPT: Network option for SLIRP mode (e.g. "-netdev user,id=net0 -device virtio-net-device,netdev=net0")
     QB_ROOTFS_OPT: Used as rootfs (e.g.
                    "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0").
                    runqemu will replace "@ROOTFS@" with the one which is used, such as
                    core-image-minimal-qemuarm64.ext4.
     QB_SERIAL_OPT: Serial port (e.g. "-serial mon:stdio")
     QB_TCPSERIAL_OPT: tcp serial port option (e.g.
                       " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device      virtconsole,chardev=virtcon"
                       runqemu will replace "@PORT@" with the port number which is used.
            

To use runqemu, set IMAGE_CLASSES as follows and run runqemu:

Note

For command-line syntax, use runqemu help.

     IMAGE_CLASSES += "qemuboot"
            

4.10.8. Default Linker Hash Style Changed

The default linker hash style for gcc-cross is now "sysv" in order to catch recipes that are building software without using the OpenEmbedded LDFLAGS. This change could result in seeing some "No GNU_HASH in the elf binary" QA issues when building such recipes. You need to fix these recipes so that they use the expected LDFLAGS. Depending on how the software is built, the build system used by the software (e.g. a Makefile) might need to be patched. However, sometimes making this fix is as simple as adding the following to the recipe:

     TARGET_CC_ARCH += "${LDFLAGS}"
            

4.10.9. KERNEL_IMAGE_BASE_NAME no Longer Uses KERNEL_IMAGETYPE

The KERNEL_IMAGE_BASE_NAME variable no longer uses the KERNEL_IMAGETYPE variable to create the image's base name. Because the OpenEmbedded build system can now build multiple kernel image types, this part of the kernel image base name as been removed leaving only the following:

     KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}
            

If you have recipes or classes that use KERNEL_IMAGE_BASE_NAME directly, you might need to update the references to ensure they continue to work.

4.10.10. BitBake Changes

The following changes took place for BitBake:

  • The "goggle" UI and standalone image-writer tool have been removed as they both require GTK+ 2.0 and were not being maintained.

  • The Perforce fetcher now supports SRCREV for specifying the source revision to use, be it ${AUTOREV}, changelist number, p4date, or label, in preference to separate SRC_URI parameters to specify these. This change is more in-line with how the other fetchers work for source control systems. Recipes that fetch from Perforce will need to be updated to use SRCREV in place of specifying the source revision within SRC_URI.

  • Some of BitBake's internal code structures for accessing the recipe cache needed to be changed to support the new multi-configuration functionality. These changes will affect external tools that use BitBake's tinfoil module. For information on these changes, see the changes made to the scripts supplied with OpenEmbedded-Core: 1 and 2.

  • The task management code has been rewritten to avoid using ID indirection in order to improve performance. This change is unlikely to cause any problems for most users. However, the setscene verification function as pointed to by BB_SETSCENE_VERIFY_FUNCTION needed to change signature. Consequently, a new variable named BB_SETSCENE_VERIFY_FUNCTION2 has been added allowing multiple versions of BitBake to work with suitably written metadata, which includes OpenEmbedded-Core and Poky. Anyone with custom BitBake task scheduler code might also need to update the code to handle the new structure.

4.10.11. Swabber has Been Removed

Swabber, a tool that was intended to detect host contamination in the build process, has been removed, as it has been unmaintained and unused for some time and was never particularly effective. The OpenEmbedded build system has since incorporated a number of mechanisms including enhanced QA checks that mean that there is less of a need for such a tool.

4.10.12. Removed Recipes

The following recipes have been removed:

  • augeas: No longer needed and has been moved to meta-oe.

  • directfb: Unmaintained and has been moved to meta-oe.

  • gcc: Removed 4.9 version. Versions 5.4 and 6.2 are still present.

  • gnome-doc-utils: No longer needed.

  • gtk-doc-stub: Replaced by gtk-doc.

  • gtk-engines: No longer needed and has been moved to meta-gnome.

  • gtk-sato-engine: Became obsolete.

  • libglade: No longer needed and has been moved to meta-oe.

  • libmad: Unmaintained and functionally replaced by libmpg123. libmad has been moved to meta-oe.

  • libowl: Became obsolete.

  • libxsettings-client: No longer needed.

  • oh-puzzles: Functionally replaced by puzzles.

  • oprofileui: Became obsolete. OProfile has been largely supplanted by perf.

  • packagegroup-core-directfb.bb: Removed.

  • core-image-directfb.bb: Removed.

  • pointercal: No longer needed and has been moved to meta-oe.

  • python-imaging: No longer needed and moved to meta-python

  • python-pyrex: No longer needed and moved to meta-python.

  • sato-icon-theme: Became obsolete.

  • swabber-native: Swabber has been removed. See the entry on Swabber.

  • tslib: No longer needed and has been moved to meta-oe.

  • uclibc: Removed in favor of musl.

  • xtscal: No longer needed and moved to meta-oe

4.10.13. Removed Classes

The following classes have been removed:

  • distutils-native-base: No longer needed.

  • distutils3-native-base: No longer needed.

  • sdl: Only set DEPENDS and SECTION, which are better set within the recipe instead.

  • sip: Mostly unused.

  • swabber: See the entry on Swabber.

4.10.14. Minor Packaging Changes

The following minor packaging changes have occurred:

  • grub: Split grub-editenv into its own package.

  • systemd: Split container and vm related units into a new package, systemd-container.

  • util-linux: Moved prlimit to a separate util-linux-prlimit package.

4.10.15. Miscellaneous Changes

The following miscellaneous changes have occurred:

  • package_regex.inc: Removed because the definitions package_regex.inc previously contained have been moved to their respective recipes.

  • Both devtool add and recipetool create now use a fixed SRCREV by default when fetching from a Git repository. You can override this in either case to use ${AUTOREV} instead by using the -a or ‐‐autorev command-line option

  • distcc: GTK+ UI is now disabled by default.

  • packagegroup-core-tools-testapps: Removed Piglit.

  • image.bbclass: Renamed COMPRESS(ION) to CONVERSION. This change means that COMPRESSIONTYPES, COMPRESS_DEPENDS and COMPRESS_CMD are deprecated in favor of CONVERSIONTYPES, CONVERSION_DEPENDS and CONVERSION_CMD. The COMPRESS* variable names will still work in the 2.2 release but metadata that does not need to be backwards-compatible should be changed to use the new names as the COMPRESS* ones will be removed in a future release.

  • gtk-doc: A full version of gtk-doc is now made available. However, some old software might not be capable of using the current version of gtk-doc to build documentation. You need to change recipes that build such software so that they explicitly disable building documentation with gtk-doc.

4.11. Moving to the Yocto Project 2.3 Release

This section provides migration information for moving to the Yocto Project 2.3 Release from the prior release.

4.11.1. Recipe-specific Sysroots

The OpenEmbedded build system now uses one sysroot per recipe to resolve long-standing issues with configuration script auto-detection of undeclared dependencies. Consequently, you might find that some of your previously written custom recipes are missing declared dependencies, particularly those dependencies that are incidentally built earlier in a typical build process and thus are already likely to be present in the shared sysroot in previous releases.

Consider the following:

  • Declare Build-Time Dependencies: Because of this new feature, you must explicitly declare all build-time dependencies for your recipe. If you do not declare these dependencies, they are not populated into the sysroot for the recipe.

  • Specify Pre-Installation and Post-Installation Native Tool Dependencies: You must specifically specify any special native tool dependencies of pkg_preinst and pkg_postinst scripts by using the PACKAGE_WRITE_DEPS variable. Specifying these dependencies ensures that these tools are available if these scripts need to be run on the build host during the do_rootfs task.

    As an example, see the dbus recipe. You will see that this recipe has a pkg_postinst that calls systemctl if "systemd" is in DISTRO_FEATURES. In the example, systemd-systemctl-native is added to PACKAGE_WRITE_DEPS, which is also conditional on "systemd" being in DISTRO_FEATURES.

  • Examine Recipes that Use SSTATEPOSTINSTFUNCS: You need to examine any recipe that uses SSTATEPOSTINSTFUNCS and determine steps to take.

    Functions added to SSTATEPOSTINSTFUNCS are still called as they were in previous Yocto Project releases. However, since a separate sysroot is now being populated for every recipe and if existing functions being called through SSTATEPOSTINSTFUNCS are doing relocation, then you will need to change these to use a post-installation script that is installed by a function added to SYSROOT_PREPROCESS_FUNCS.

    For an example, see the pixbufcache class in meta/classes/ in the Yocto Project Source Repositories.

    Note

    The SSTATEPOSTINSTFUNCS variable itself is now deprecated in favor of the do_populate_sysroot[postfuncs] task. Consequently, if you do still have any function or functions that need to be called after the sysroot component is created for a recipe, then you would be well advised to take steps to use a post installation script as described previously. Taking these steps prepares your code for when SSTATEPOSTINSTFUNCS is removed in a future Yocto Project release.

  • Specify the Sysroot when Using Certain External Scripts: Because the shared sysroot is now gone, the scripts oe-find-native-sysroot and oe-run-native have been changed such that you need to specify which recipe's STAGING_DIR_NATIVE is used.

Note

You can find more information on how recipe-specific sysroots work in the "staging.bbclass" section.

4.11.2. PATH Variable

Within the environment used to run build tasks, the environment variable PATH is now sanitized such that the normal native binary paths (/bin, /sbin, /usr/bin and so forth) are removed and a directory containing symbolic links linking only to the binaries from the host mentioned in the HOSTTOOLS and HOSTTOOLS_NONFATAL variables is added to PATH.

Consequently, any native binaries provided by the host that you need to call needs to be in one of these two variables at the configuration level.

Alternatively, you can add a native recipe (i.e. -native) that provides the binary to the recipe's DEPENDS value.

Note

PATH is not sanitized in the same way within devshell. If it were, you would have difficulty running host tools for development and debugging within the shell.

4.11.3. Changes to Scripts

The following changes to scripts took place:

  • oe-find-native-sysroot: The usage for the oe-find-native-sysroot script has changed to the following:

         $ . oe-find-native-sysroot recipe
                        

    You must now supply a recipe for recipe as part of the command. Prior to the Yocto Project 2.6 release, it was not necessary to provide the script with the command.

  • oe-run-native: The usage for the oe-run-native script has changed to the following:

         $ oe-run-native native_recipe tool
                        

    You must supply the name of the native recipe and the tool you want to run as part of the command. Prior to the Yocto Project 2.6 release, it was not necessary to provide the native recipe with the command.

  • cleanup-workdir: The cleanup-workdir script has been removed because the script was found to be deleting files it should not have, which lead to broken build trees. Rather than trying to delete portions of TMPDIR and getting it wrong, it is recommended that you delete TMPDIR and have it restored from shared state (sstate) on subsequent builds.

  • wipe-sysroot: The wipe-sysroot script has been removed as it is no longer needed with recipe-specific sysroots.

4.11.4. Changes to Functions

The previously deprecated bb.data.getVar(), bb.data.setVar(), and related functions have been removed in favor of d.getVar(), d.setVar(), and so forth.

You need to fix any references to these old functions.

4.11.5. BitBake Changes

The following changes took place for BitBake:

  • BitBake's Graphical Dependency Explorer UI Replaced: BitBake's graphical dependency explorer UI depexp was replaced by taskexp ("Task Explorer"), which provides a graphical way of exploring the task-depends.dot file. The data presented by Task Explorer is much more accurate than the data that was presented by depexp. Being able to visualize the data is an often requested feature as standard *.dot file viewers cannot usual cope with the size of the task-depends.dot file.

  • BitBake "-g" Output Changes: The package-depends.dot and pn-depends.dot files as previously generated using the bitbake -g command have been removed. A recipe-depends.dot file is now generated as a collapsed version of task-depends.dot instead.

    The reason for this change is because package-depends.dot and pn-depends.dot largely date back to a time before task-based execution and do not take into account task-level dependencies between recipes, which could be misleading.

  • Mirror Variable Splitting Changes: Mirror variables including MIRRORS, PREMIRRORS, and SSTATE_MIRRORS can now separate values entirely with spaces. Consequently, you no longer need "\\n". BitBake looks for pairs of values, which simplifies usage. There should be no change required to existing mirror variable values themselves.

  • The Subversion (SVN) Fetcher Uses an "ssh" Parameter and Not an "rsh" Parameter: The SVN fetcher now takes an "ssh" parameter instead of an "rsh" parameter. This new optional parameter is used when the "protocol" parameter is set to "svn+ssh". You can only use the new parameter to specify the ssh program used by SVN. The SVN fetcher passes the new parameter through the SVN_SSH environment variable during the do_fetch task.

    See the "Subversion (SVN) Fetcher (svn://)" section in the BitBake User Manual for additional information.

  • BB_SETSCENE_VERIFY_FUNCTION and BB_SETSCENE_VERIFY_FUNCTION2 Removed: Because the mechanism they were part of is no longer necessary with recipe-specific sysroots, the BB_SETSCENE_VERIFY_FUNCTION and BB_SETSCENE_VERIFY_FUNCTION2 variables have been removed.

Absolute symbolic links (symlinks) within staged files are no longer permitted and now trigger an error. Any explicit creation of symlinks can use the lnr script, which is a replacement for ln -r.

If the build scripts in the software that the recipe is building are creating a number of absolute symlinks that need to be corrected, you can inherit relative_symlinks within the recipe to turn those absolute symlinks into relative symlinks.

4.11.7. GPLv2 Versions of GPLv3 Recipes Moved

Older GPLv2 versions of GPLv3 recipes have moved to a separate meta-gplv2 layer.

If you use INCOMPATIBLE_LICENSE to exclude GPLv3 or set PREFERRED_VERSION to substitute a GPLv2 version of a GPLv3 recipe, then you must add the meta-gplv2 layer to your configuration.

Note

You can find meta-gplv2 layer in the OpenEmbedded layer index at https://layers.openembedded.org/layerindex/branch/master/layer/meta-gplv2/.

These relocated GPLv2 recipes do not receive the same level of maintenance as other core recipes. The recipes do not get security fixes and upstream no longer maintains them. In fact, the upstream community is actively hostile towards people that use the old versions of the recipes. Moving these recipes into a separate layer both makes the different needs of the recipes clearer and clearly identifies the number of these recipes.

Note

The long-term solution might be to move to BSD-licensed replacements of the GPLv3 components for those that need to exclude GPLv3-licensed components from the target system. This solution will be investigated for future Yocto Project releases.

4.11.8. Package Management Changes

The following package management changes took place:

  • Smart package manager is replaced by DNF package manager. Smart has become unmaintained upstream, is not ported to Python 3.x. Consequently, Smart needed to be replaced. DNF is the only feasible candidate.

    The change in functionality is that the on-target runtime package management from remote package feeds is now done with a different tool that has a different set of command-line options. If you have scripts that call the tool directly, or use its API, they need to be fixed.

    For more information, see the DNF Documentation.

  • Rpm 5.x is replaced with Rpm 4.x. This is done for two major reasons:

    • DNF is API-incompatible with Rpm 5.x and porting it and maintaining the port is non-trivial.

    • Rpm 5.x itself has limited maintenance upstream, and the Yocto Project is one of the very few remaining users.

  • Berkeley DB 6.x is removed and Berkeley DB 5.x becomes the default:

    • Version 6.x of Berkeley DB has largely been rejected by the open source community due to its AGPLv3 license. As a result, most mainstream open source projects that require DB are still developed and tested with DB 5.x.

    • In OE-core, the only thing that was requiring DB 6.x was Rpm 5.x. Thus, no reason exists to continue carrying DB 6.x in OE-core.

  • createrepo is replaced with createrepo_c.

    createrepo_c is the current incarnation of the tool that generates remote repository metadata. It is written in C as compared to createrepo, which is written in Python. createrepo_c is faster and is maintained.

  • Architecture-independent RPM packages are "noarch" instead of "all".

    This change was made because too many places in DNF/RPM4 stack already make that assumption. Only the filenames and the architecture tag has changed. Nothing else has changed in OE-core system, particularly in the allarch.bbclass class.

  • Signing of remote package feeds using PACKAGE_FEED_SIGN is not currently supported. This issue will be fully addressed in a future Yocto Project release. See defect 11209 for more information on a solution to package feed signing with RPM in the Yocto Project 2.3 release.

  • OPKG now uses the libsolv backend for resolving package dependencies by default. This is vastly superior to OPKG's internal ad-hoc solver that was previously used. This change does have a small impact on disk (around 500 KB) and memory footprint.

    Note

    For further details on this change, see the commit message.

4.11.9. Removed Recipes

The following recipes have been removed:

  • linux-yocto 4.8: Version 4.8 has been removed. Versions 4.1 (LTSI), 4.4 (LTS), 4.9 (LTS/LTSI) and 4.10 are now present.

  • python-smartpm: Functionally replaced by dnf.

  • createrepo: Replaced by the createrepo-c recipe.

  • rpmresolve: No longer needed with the move to RPM 4 as RPM itself is used instead.

  • gstreamer: Removed the GStreamer Git version recipes as they have been stale. 1.10.x recipes are still present.

  • alsa-conf-base: Merged into alsa-conf since libasound depended on both. Essentially, no way existed to install only one of these.

  • tremor: Moved to meta-multimedia. Fixed-integer Vorbis decoding is not needed by current hardware. Thus, GStreamer's ivorbis plugin has been disabled by default eliminating the need for the tremor recipe in OE-Core.

  • gummiboot: Replaced by systemd-boot.

4.11.10. Wic Changes

The following changes have been made to Wic:

Note

For more information on Wic, see the "Creating Partitioned Images Using Wic" section in the Yocto Project Development Tasks Manual.

  • Default Output Directory Changed: Wic's default output directory is now the current directory by default instead of the unusual /var/tmp/wic.

    The "-o" and "--outdir" options remain unchanged and are used to specify your preferred output directory if you do not want to use the default directory.

  • fsimage Plug-in Removed: The Wic fsimage plug-in has been removed as it duplicates functionality of the rawcopy plug-in.

4.11.11. QA Changes

The following QA checks have changed:

  • unsafe-references-in-binaries: The unsafe-references-in-binaries QA check, which was disabled by default, has now been removed. This check was intended to detect binaries in /bin that link to libraries in /usr/lib and have the case where the user has /usr on a separate filesystem to /.

    The removed QA check was buggy. Additionally, /usr residing on a separate partition from / is now a rare configuration. Consequently, unsafe-references-in-binaries was removed.

  • file-rdeps: The file-rdeps QA check is now an error by default instead of a warning. Because it is an error instead of a warning, you need to address missing runtime dependencies.

    For additional information, see the insane class and the "Errors and Warnings" section.

4.11.12. Miscellaneous Changes

The following miscellaneous changes have occurred:

  • In this release, a number of recipes have been changed to ignore the largefile DISTRO_FEATURES item, enabling large file support unconditionally. This feature has always been enabled by default. Disabling the feature has not been widely tested.

    Note

    Future releases of the Yocto Project will remove entirely the ability to disable the largefile feature, which would make it unconditionally enabled everywhere.

  • If the DISTRO_VERSION value contains the value of the DATE variable, which is the default between Poky releases, the DATE value is explicitly excluded from /etc/issue and /etc/issue.net, which is displayed at the login prompt, in order to avoid conflicts with Multilib enabled. Regardless, the DATE value is inaccurate if the base-files recipe is restored from shared state (sstate) rather than rebuilt.

    If you need the build date recorded in /etc/issue* or anywhere else in your image, a better method is to define a post-processing function to do it and have the function called from ROOTFS_POSTPROCESS_COMMAND. Doing so ensures the value is always up-to-date with the created image.

  • Dropbear's init script now disables DSA host keys by default. This change is in line with the systemd service file, which supports RSA keys only, and with recent versions of OpenSSH, which deprecates DSA host keys.

  • The buildhistory class now correctly uses tabs as separators between all columns in installed-package-sizes.txt in order to aid import into other tools.

  • The USE_LDCONFIG variable has been replaced with the "ldconfig" DISTRO_FEATURES feature. Distributions that previously set:

         USE_LDCONFIG = "0"
                        

    should now instead use the following:

         DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " ldconfig"
                        

  • The default value of COPYLEFT_LICENSE_INCLUDE now includes all versions of AGPL licenses in addition to GPL and LGPL.

    Note

    The default list is not intended to be guaranteed as a complete safe list. You should seek legal advice based on what you are distributing if you are unsure.

  • Kernel module packages are now suffixed with the kernel version in order to allow module packages from multiple kernel versions to co-exist on a target system. If you wish to return to the previous naming scheme that does not include the version suffix, use the following:

         KERNEL_MODULE_PACKAGE_SUFFIX to ""
                        

  • Removal of libtool *.la files is now enabled by default. The *.la files are not actually needed on Linux and relocating them is an unnecessary burden.

    If you need to preserve these .la files (e.g. in a custom distribution), you must change INHERIT_DISTRO such that "remove-libtool" is not included in the value.

  • Extensible SDKs built for GCC 5+ now refuse to install on a distribution where the host GCC version is 4.8 or 4.9. This change resulted from the fact that the installation is known to fail due to the way the uninative shared state (sstate) package is built. See the uninative class for additional information.

  • All native and nativesdk recipes now use a separate DISTRO_FEATURES value instead of sharing the value used by recipes for the target, in order to avoid unnecessary rebuilds.

    The DISTRO_FEATURES for native recipes is DISTRO_FEATURES_NATIVE added to an intersection of DISTRO_FEATURES and DISTRO_FEATURES_FILTER_NATIVE.

    For nativesdk recipes, the corresponding variables are DISTRO_FEATURES_NATIVESDK and DISTRO_FEATURES_FILTER_NATIVESDK.

  • The FILESDIR variable, which was previously deprecated and rarely used, has now been removed. You should change any recipes that set FILESDIR to set FILESPATH instead.

  • The MULTIMACH_HOST_SYS variable has been removed as it is no longer needed with recipe-specific sysroots.

4.12. Moving to the Yocto Project 2.4 Release

This section provides migration information for moving to the Yocto Project 2.4 Release from the prior release.

4.12.1. Memory Resident Mode

A persistent mode is now available in BitBake's default operation, replacing its previous "memory resident mode" (i.e. oe-init-build-env-memres). Now you only need to set BB_SERVER_TIMEOUT to a timeout (in seconds) and BitBake's server stays resident for that amount of time between invocations. The oe-init-build-env-memres script has been removed since a separate environment setup script is no longer needed.

4.12.2. Packaging Changes

This section provides information about packaging changes that have ocurred:

  • python3 Changes:

    • The main "python3" package now brings in all of the standard Python 3 distribution rather than a subset. This behavior matches what is expected based on traditional Linux distributions. If you wish to install a subset of Python 3, specify python-core plus one or more of the individual packages that are still produced.

    • python3: The bz2.py, lzma.py, and _compression.py scripts have been moved from the python3-misc package to the python3-compression package.

  • binutils: The libbfd library is now packaged in a separate "libbfd" package. This packaging saves space when certain tools (e.g. perf) are installed. In such cases, the tools only need libbfd rather than all the packages in binutils.

  • util-linux Changes:

    • The su program is now packaged in a separate "util-linux-su" package, which is only built when "pam" is listed in the DISTRO_FEATURES variable. util-linux should not be installed unless it is needed because su is normally provided through the shadow file format. The main util-linux package has runtime dependencies (i.e. RDEPENDS) on the util-linux-su package when "pam" is in DISTRO_FEATURES.

    • The switch_root program is now packaged in a separate "util-linux-switch-root" package for small initramfs images that do not need the whole util-linux package or the busybox binary, which are both much larger than switch_root. The main util-linux package has a recommended runtime dependency (i.e. RRECOMMENDS) on the util-linux-switch-root package.

    • The ionice program is now packaged in a separate "util-linux-ionice" package. The main util-linux package has a recommended runtime dependency (i.e. RRECOMMENDS) on the util-linux-ionice package.

  • initscripts: The sushell program is now packaged in a separate "initscripts-sushell" package. This packaging change allows systems to pull sushell in when selinux is enabled. The change also eliminates needing to pull in the entire initscripts package. The main initscripts package has a runtime dependency (i.e. RDEPENDS) on the sushell package when "selinux" is in DISTRO_FEATURES.

  • glib-2.0: The glib-2.0 package now has a recommended runtime dependency (i.e. RRECOMMENDS) on the shared-mime-info package, since large portions of GIO are not useful without the MIME database. You can remove the dependency by using the BAD_RECOMMENDATIONS variable if shared-mime-info is too large and is not required.

  • Go Standard Runtime: The Go standard runtime has been split out from the main go recipe into a separate go-runtime recipe.

4.12.3. Removed Recipes

The following recipes have been removed:

  • acpitests: This recipe is not maintained.

  • autogen-native: No longer required by Grub, oe-core, or meta-oe.

  • bdwgc: Nothing in OpenEmbedded-Core requires this recipe. It has moved to meta-oe.

  • byacc: This recipe was only needed by rpm 5.x and has moved to meta-oe.

  • gcc (5.4): The 5.4 series dropped the recipe in favor of 6.3 / 7.2.

  • gnome-common: Deprecated upstream and no longer needed.

  • go-bootstrap-native: Go 1.9 does its own bootstrapping so this recipe has been removed.

  • guile: This recipe was only needed by autogen-native and remake. The recipe is no longer needed by either of these programs.

  • libclass-isa-perl: This recipe was previously needed for LSB 4, no longer needed.

  • libdumpvalue-perl: This recipe was previously needed for LSB 4, no longer needed.

  • libenv-perl: This recipe was previously needed for LSB 4, no longer needed.

  • libfile-checktree-perl: This recipe was previously needed for LSB 4, no longer needed.

  • libi18n-collate-perl: This recipe was previously needed for LSB 4, no longer needed.

  • libiconv: This recipe was only needed for uclibc, which was removed in the previous release. glibc and musl have their own implementations. meta-mingw still needs libiconv, so it has been moved to meta-mingw.

  • libpng12: This recipe was previously needed for LSB. The current libpng is 1.6.x.

  • libpod-plainer-perl: This recipe was previously needed for LSB 4, no longer needed.

  • linux-yocto (4.1): This recipe was removed in favor of 4.4, 4.9, 4.10 and 4.12.

  • mailx: This recipe was previously only needed for LSB compatibility, and upstream is defunct.

  • mesa (git version only): The git version recipe was stale with respect to the release version.

  • ofono (git version only): The git version recipe was stale with respect to the release version.

  • portmap: This recipe is obsolete and is superseded by rpcbind.

  • python3-pygpgme: This recipe is old and unmaintained. It was previously required by dnf, which has switched to official gpgme Python bindings.

  • python-async: This recipe has been removed in favor of the Python 3 version.

  • python-gitdb: This recipe has been removed in favor of the Python 3 version.

  • python-git: This recipe was removed in favor of the Python 3 version.

  • python-mako: This recipe was removed in favor of the Python 3 version.

  • python-pexpect: This recipe was removed in favor of the Python 3 version.

  • python-ptyprocess: This recipe was removed in favor of Python the 3 version.

  • python-pycurl: Nothing is using this recipe in OpenEmbedded-Core (i.e. meta-oe).

  • python-six: This recipe was removed in favor of the Python 3 version.

  • python-smmap: This recipe was removed in favor of the Python 3 version.

  • remake: Using remake as the provider of virtual/make is broken. Consequently, this recipe is not needed in OpenEmbedded-Core.

4.12.4. Kernel Device Tree Move

Kernel Device Tree support is now easier to enable in a kernel recipe. The Device Tree code has moved to a kernel-devicetree class. Functionality is automatically enabled for any recipe that inherits the kernel class and sets the KERNEL_DEVICETREE variable. The previous mechanism for doing this, meta/recipes-kernel/linux/linux-dtb.inc, is still available to avoid breakage, but triggers a deprecation warning. Future releases of the Yocto Project will remove meta/recipes-kernel/linux/linux-dtb.inc. It is advisable to remove any require statements that request meta/recipes-kernel/linux/linux-dtb.inc from any custom kernel recipes you might have. This will avoid breakage in post 2.4 releases.

4.12.5. Package QA Changes

The following package QA changes took place:

  • The "unsafe-references-in-scripts" QA check has been removed.

  • If you refer to ${COREBASE}/LICENSE within LIC_FILES_CHKSUM you receive a warning because this file is a description of the license for OE-Core. Use ${COMMON_LICENSE_DIR}/MIT if your recipe is MIT-licensed and you cannot use the preferred method of referring to a file within the source tree.

4.12.6. README File Changes

The following are changes to README files:

  • The main Poky README file has been moved to the meta-poky layer and has been renamed README.poky. A symlink has been created so that references to the old location work.

  • The README.hardware file has been moved to meta-yocto-bsp. A symlink has been created so that references to the old location work.

  • A README.qemu file has been created with coverage of the qemu* machines.

4.12.7. Miscellaneous Changes

The following are additional changes:

  • The ROOTFS_PKGMANAGE_BOOTSTRAP variable and any references to it have been removed. You should remove this variable from any custom recipes.

  • The meta-yocto directory has been removed.

    Note

    In the Yocto Project 2.1 release meta-yocto was renamed to meta-poky and the meta-yocto subdirectory remained to avoid breaking existing configurations.

  • The maintainers.inc file, which tracks maintainers by listing a primary person responsible for each recipe in OE-Core, has been moved from meta-poky to OE-Core (i.e. from meta-poky/conf/distro/include to meta/conf/distro/include).

  • The buildhistory class now makes a single commit per build rather than one commit per subdirectory in the repository. This behavior assumes the commits are enabled with BUILDHISTORY_COMMIT = "1", which is typical. Previously, the buildhistory class made one commit per subdirectory in the repository in order to make it easier to see the changes for a particular subdirectory. To view a particular change, specify that subdirectory as the last parameter on the git show or git diff commands.

  • The x86-base.inc file, which is included by all x86-based machine configurations, now sets IMAGE_FSTYPES using ?= to "live" rather than appending with +=. This change makes the default easier to override.

  • BitBake fires multiple "BuildStarted" events when multiconfig is enabled (one per configuration). For more information, see the "Events" section in the BitBake User Manual.

  • By default, the security_flags.inc file sets a GCCPIE variable with an option to enable Position Independent Executables (PIE) within gcc. Enabling PIE in the GNU C Compiler (GCC), makes Return Oriented Programming (ROP) attacks much more difficult to execute.

  • OE-Core now provides a bitbake-layers plugin that implements a "create-layer" subcommand. The implementation of this subcommand has resulted in the yocto-layer script being deprecated and will likely be removed in the next Yocto Project release.

  • The vmdk, vdi, and qcow2 image file types are now used in conjunction with the "wic" image type through CONVERSION_CMD. Consequently, the equivalent image types are now wic.vmdk, wic.vdi, and wic.qcow2, respectively.

  • do_image_<type>[depends] has replaced IMAGE_DEPENDS_<type>. If you have your own classes that implement custom image types, then you need to update them.

  • OpenSSL 1.1 has been introduced. However, the default is still 1.0.x through the PREFERRED_VERSION variable. This preference is set is due to the remaining compatibility issues with other software. The PROVIDES variable in the openssl 1.0 recipe now includes "openssl10" as a marker that can be used in DEPENDS within recipes that build software that still depend on OpenSSL 1.0.

  • To ensure consistent behavior, BitBake's "-r" and "-R" options (i.e. prefile and postfile), which are used to read or post-read additional configuration files from the command line, now only affect the current BitBake command. Before these BitBake changes, these options would "stick" for future executions.

4.13. Moving to the Yocto Project 2.5 Release

This section provides migration information for moving to the Yocto Project 2.5 Release from the prior release.

4.13.1. Packaging Changes

This section provides information about packaging changes that have occurred:

  • bind-libs: The libraries packaged by the bind recipe are in a separate bind-libs package.

  • libfm-gtk: The libfm GTK+ bindings are split into a separate libfm-gtk package.

  • flex-libfl: The flex recipe splits out libfl into a separate flex-libfl package to avoid too many dependencies being pulled in where only the library is needed.

  • grub-efi: The grub-efi configuration is split into a separate grub-bootconf recipe. However, the dependency relationship from grub-efi is through a virtual/grub-bootconf provider making it possible to have your own recipe provide the dependency. Alternatively, you can use a BitBake append file to bring the configuration back into the grub-efi recipe.

  • armv7a Legacy Package Feed Support: Legacy support is removed for transitioning from armv7a to armv7a-vfp-neon in package feeds, which was previously enabled by setting PKGARCHCOMPAT_ARMV7A. This transition occurred in 2011 and active package feeds should by now be updated to the new naming.

4.13.2. Removed Recipes

The following recipes have been removed:

  • gcc: The version 6.4 recipes are replaced by 7.x.

  • gst-player: Renamed to gst-examples as per upstream.

  • hostap-utils: This software package is obsolete.

  • latencytop: This recipe is no longer maintained upstream. The last release was in 2009.

  • libpfm4: The only file that requires this recipe is oprofile, which has been removed.

  • linux-yocto: The version 4.4, 4.9, and 4.10 recipes have been removed. Versions 4.12, 4.14, and 4.15 remain.

  • man: This recipe has been replaced by modern man-db

  • mkelfimage: This tool has been removed in the upstream coreboot project, and is no longer needed with the removal of the ELF image type.

  • nativesdk-postinst-intercept: This recipe is not maintained.

  • neon: This software package is no longer maintained upstream and is no longer needed by anything in OpenEmbedded-Core.

  • oprofile: The functionality of this recipe is replaced by perf and keeping compatibility on an ongoing basis with musl is difficult.

  • pax: This software package is obsolete.

  • stat: This software package is not maintained upstream. coreutils provides a modern stat binary.

  • zisofs-tools-native: This recipe is no longer needed because the compressed ISO image feature has been removed.

4.13.3. Scripts and Tools Changes

The following are changes to scripts and tools:

  • yocto-bsp, yocto-kernel, and yocto-layer: The yocto-bsp, yocto-kernel, and yocto-layer scripts previously shipped with poky but not in OpenEmbedded-Core have been removed. These scripts are not maintained and are outdated. In many cases, they are also limited in scope. The bitbake-layers create-layer command is a direct replacement for yocto-layer. See the documentation to create a BSP or kernel recipe in the "BSP Kernel Recipe Example" section.

  • devtool finish: devtool finish now exits with an error if there are uncommitted changes or a rebase/am in progress in the recipe's source repository. If this error occurs, there might be uncommitted changes that will not be included in updates to the patches applied by the recipe. A -f/--force option is provided for situations that the uncommitted changes are inconsequential and you want to proceed regardless.

  • scripts/oe-setup-rpmrepo script: The functionality of scripts/oe-setup-rpmrepo is replaced by bitbake package-index.

  • scripts/test-dependencies.sh script: The script is largely made obsolete by the recipe-specific sysroots functionality introduced in the previous release.

4.13.4. BitBake Changes

The following are BitBake changes:

  • The --runall option has changed. There are two different behaviors people might want:

    • Behavior A: For a given target (or set of targets) look through the task graph and run task X only if it is present and will be built.

    • Behavior B: For a given target (or set of targets) look through the task graph and run task X if any recipe in the taskgraph has such a target, even if it is not in the original task graph.

    The --runall option now performs "Behavior B". Previously --runall behaved like "Behavior A". A --runonly option has been added to retain the ability to perform "Behavior A".

  • Several explicit "run this task for all recipes in the dependency tree" tasks have been removed (e.g. fetchall, checkuriall, and the *all tasks provided by the distrodata and archiver classes). There is a BitBake option to complete this for any arbitrary task. For example:

         bitbake <target> -c fetchall
                        

    should now be replaced with:

         bitbake <target> --runall=fetch
                        

4.13.5. Python and Python 3 Changes

The following are auto-packaging changes to Python and Python 3:

The script-managed python-*-manifest.inc files that were previously used to generate Python and Python 3 packages have been replaced with a JSON-based file that is easier to read and maintain. A new task is available for maintainers of the Python recipes to update the JSON file when upgrading to new Python versions. You can now edit the file directly instead of having to edit a script and run it to update the file.

One particular change to note is that the Python recipes no longer have build-time provides for their packages. This assumes python-foo is one of the packages provided by the Python recipe. You can no longer run bitbake python-foo or have a DEPENDS on python-foo, but doing either of the following causes the package to work as expected:

     IMAGE_INSTALL_append = " python-foo"
            

or

     RDEPENDS_${PN} = "python-foo"
            

The earlier build-time provides behavior was a quirk of the way the Python manifest file was created. For more information on this change please see this commit.

4.13.6. Miscellaneous Changes

The following are additional changes:

  • The kernel class supports building packages for multiple kernels. If your kernel recipe or .bbappend file mentions packaging at all, you should replace references to the kernel in package names with ${KERNEL_PACKAGE_NAME}. For example, if you disable automatic installation of the kernel image using RDEPENDS_kernel-base = "" you can avoid warnings using RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "" instead.

  • The buildhistory class commits changes to the repository by default so you no longer need to set BUILDHISTORY_COMMIT = "1". If you want to disable commits you need to set BUILDHISTORY_COMMIT = "0" in your configuration.

  • The beaglebone reference machine has been renamed to beaglebone-yocto. The beaglebone-yocto BSP is a reference implementation using only mainline components available in OpenEmbedded-Core and meta-yocto-bsp, whereas Texas Instruments maintains a full-featured BSP in the meta-ti layer. This rename avoids the previous name clash that existed between the two BSPs.

  • The update-alternatives class no longer works with SysV init scripts because this usage has been problematic. Also, the sysklogd recipe no longer uses update-alternatives because it is incompatible with other implementations.

  • By default, the cmake class uses ninja instead of make for building. This improves build performance. If a recipe is broken with ninja, then the recipe can set OECMAKE_GENERATOR = "Unix Makefiles" to change back to make.

  • The previously deprecated base_* functions have been removed in favor of their replacements in meta/lib/oe and bitbake/lib/bb. These are typically used from recipes and classes. Any references to the old functions must be updated. The following table shows the removed functions and their replacements:

         Removed                                 Replacement
         ============================            ============================
         base_path_join()                        oe.path.join()
         base_path_relative()                    oe.path.relative()
         base_path_out()                         oe.path.format_display()
         base_read_file()                        oe.utils.read_file()
         base_ifelse()                           oe.utils.ifelse()
         base_conditional()                      oe.utils.conditional()
         base_less_or_equal()                    oe.utils.less_or_equal()
         base_version_less_or_equal()            oe.utils.version_less_or_equal()
         base_contains()                         bb.utils.contains()
         base_both_contain()                     oe.utils.both_contain()
         base_prune_suffix()                     oe.utils.prune_suffix()
         oe_filter()                             oe.utils.str_filter()
         oe_filter_out()                         oe.utils.str_filter_out() (or use the _remove operator).
                        

  • Using exit 1 to explicitly defer a postinstall script until first boot is now deprecated since it is not an obvious mechanism and can mask actual errors. If you want to explicitly defer a postinstall to first boot on the target rather than at rootfs creation time, use pkg_postinst_ontarget() or call postinst-intercepts defer_to_first_boot from pkg_postinst(). Any failure of a pkg_postinst() script (including exit 1) will trigger a warning during do_rootfs.

    For more information, see the "Post-Installation Scripts" section in the Yocto Project Development Tasks Manual.

  • The elf image type has been removed. This image type was removed because the mkelfimage tool that was required to create it is no longer provided by coreboot upstream and required updating every time binutils updated.

  • Support for .iso image compression (previously enabled through COMPRESSISO = "1") has been removed. The userspace tools (zisofs-tools) are unmaintained and squashfs provides better performance and compression. In order to build a live image with squashfs+lz4 compression enabled you should now set LIVE_ROOTFS_TYPE = "squashfs-lz4" and ensure that live is in IMAGE_FSTYPES.

  • Recipes with an unconditional dependency on libpam are only buildable with pam in DISTRO_FEATURES. If the dependency is truly optional then it is recommended that the dependency be conditional upon pam being in DISTRO_FEATURES.

  • For EFI-based machines, the bootloader (grub-efi by default) is installed into the image at /boot. Wic can be used to split the bootloader into separate boot and rootfs partitions if necessary.

  • Patches whose context does not match exactly (i.e. where patch reports "fuzz" when applying) will generate a warning. For an example of this see this commit.

  • Layers are expected to set LAYERSERIES_COMPAT_layername to match the version(s) of OpenEmbedded-Core they are compatible with. This is specified as codenames using spaces to separate multiple values (e.g. "rocko sumo"). If a layer does not set LAYERSERIES_COMPAT_layername, a warning will is shown. If a layer sets a value that does not include the current version ("sumo" for the 2.5 release), then an error will be produced.

  • The TZ environment variable is set to "UTC" within the build environment in order to fix reproducibility problems in some recipes.

4.14. Moving to the Yocto Project 2.6 Release

This section provides migration information for moving to the Yocto Project 2.6 Release from the prior release.

4.14.1. GCC 8.2 is Now Used by Default

The GNU Compiler Collection version 8.2 is now used by default for compilation. For more information on what has changed in the GCC 8.x release, see https://gcc.gnu.org/gcc-8/changes.html.

If you still need to compile with version 7.x, GCC 7.3 is also provided. You can select this version by setting the and can be selected by setting the GCCVERSION variable to "7.%" in your configuration.

4.14.2. Removed Recipes

The following recipes have been removed:

     beecrypt: No longer needed since moving to RPM 4.
     bigreqsproto: Replaced by xorgproto.
     calibrateproto: Removed in favor of xinput.
     compositeproto: Replaced by xorgproto.
     damageproto: Replaced by xorgproto.
     dmxproto: Replaced by xorgproto.
     dri2proto: Replaced by xorgproto.
     dri3proto: Replaced by xorgproto.
     eee-acpi-scripts: Became obsolete.
     fixesproto: Replaced by xorgproto.
     fontsproto: Replaced by xorgproto.
     fstests: Became obsolete.
     gccmakedep: No longer used.
     glproto: Replaced by xorgproto.
     gnome-desktop3: No longer needed.  This recipe has moved to meta-oe.
     icon-naming-utils: No longer used since the Sato theme was removed in 2016.
     inputproto: Replaced by xorgproto.
     kbproto: Replaced by xorgproto.
     libusb-compat: Became obsolete.
     libuser: Became obsolete.
     libnfsidmap: No longer an external requirement since nfs-utils 2.2.1.  libnfsidmap is now integrated.
     libxcalibrate: No longer needed with xinput
     mktemp: Became obsolete. The mktemp command is provided by both busybox and coreutils.
     ossp-uuid: Is not being maintained and has mostly been replaced by uuid.h in util-linux.
     pax-utils: No longer needed.  Previous QA tests that did use this recipe are now done at build time.
     pcmciautils: Became obsolete.
     pixz: No longer needed. xz now supports multi-threaded compression.
     presentproto: Replaced by xorgproto.
     randrproto: Replaced by xorgproto.
     recordproto: Replaced by xorgproto.
     renderproto: Replaced by xorgproto.
     resourceproto: Replaced by xorgproto.
     scrnsaverproto: Replaced by xorgproto.
     trace-cmd: Became obsolete.  perf replaced this recipe's functionally.
     videoproto: Replaced by xorgproto.
     wireless-tools: Became obsolete.  Superseded by iw.
     xcmiscproto: Replaced by xorgproto.
     xextproto: Replaced by xorgproto.
     xf86dgaproto: Replaced by xorgproto.
     xf86driproto: Replaced by xorgproto.
     xf86miscproto: Replaced by xorgproto.
     xf86-video-omapfb: Became obsolete.  Use kernel modesetting driver instead.
     xf86-video-omap: Became obsolete.  Use kernel modesetting driver instead.
     xf86vidmodeproto: Replaced by xorgproto.
     xineramaproto: Replaced by xorgproto.
     xproto: Replaced by xorgproto.
     yasm: No longer needed since previous usages are now satisfied by nasm.
            

4.14.3. Packaging Changes

The following packaging changes have been made:

  • cmake: cmake.m4 and toolchain files have been moved to the main package.

  • iptables: The iptables modules have been split into separate packages.

  • alsa-lib: libasound is now in the main alsa-lib package instead of libasound.

  • glibc: libnss-db is now in its own package along with a /var/db/makedbs.sh script to update databases.

  • python and python3: The main package has been removed from the recipe. You must install specific packages or python-modules / python3-modules for everything.

  • systemtap: Moved systemtap-exporter into its own package.

4.14.4. XOrg Protocol dependencies

The "*proto" upstream repositories have been combined into one "xorgproto" repository. Thus, the corresponding recipes have also been combined into a single xorgproto recipe. Any recipes that depend upon the older *proto recipes need to be changed to depend on the newer xorgproto recipe instead.

For names of recipes removed because of this repository change, see the Removed Recipes section.

4.14.5. distutils and distutils3 Now Prevent Fetching Dependencies During the do_configure Task

Previously, it was possible for Python recipes that inherited the distutils and distutils3 classes to fetch code during the do_configure task to satisfy dependencies mentioned in setup.py if those dependencies were not provided in the sysroot (i.e. recipes providing the dependencies were missing from DEPENDS).

Note

This change affects classes beyond just the two mentioned (i.e. distutils and distutils3). Any recipe that inherits distutils* classes are affected. For example, the setuptools and setuptools3 recipes are affected since they inherit the distutils* classes.

Fetching these types of dependencies that are not provided in the sysroot negatively affects the ability to reproduce builds. This type of fetching is now explicitly disabled. Consequently, any missing dependencies in Python recipes that use these classes now result in an error during the do_configure task.

4.14.6. linux-yocto Configuration Audit Issues Now Correctly Reported

Due to a bug, the kernel configuration audit functionality was not writing out any resulting warnings during the build. This issue is now corrected. You might notice these warnings now if you have a custom kernel configuration with a linux-yocto style kernel recipe.

4.14.7. Image/Kernel Artifact Naming Changes

The following changes have been made:

  • Name variables (e.g. IMAGE_NAME) use a new IMAGE_VERSION_SUFFIX variable instead of DATETIME. Using IMAGE_VERSION_SUFFIX allows easier and more direct changes.

    The IMAGE_VERSION_SUFFIX variable is set in the bitbake.conf configuration file as follows:

         IMAGE_VERSION_SUFFIX = "-${DATETIME}"
                        

  • Several variables have changed names for consistency:

        Old Variable Name               New Variable Name
        ========================================================
        KERNEL_IMAGE_BASE_NAME          KERNEL_IMAGE_NAME
        KERNEL_IMAGE_SYMLINK_NAME       KERNEL_IMAGE_LINK_NAME
        MODULE_TARBALL_BASE_NAME        MODULE_TARBALL_NAME
        MODULE_TARBALL_SYMLINK_NAME     MODULE_TARBALL_LINK_NAME
        INITRAMFS_BASE_NAME             INITRAMFS_NAME
                        

  • The MODULE_IMAGE_BASE_NAME variable has been removed. The module tarball name is now controlled directly with the MODULE_TARBALL_NAME variable.

  • The KERNEL_DTB_NAME and KERNEL_DTB_LINK_NAME variables have been introduced to control kernel Device Tree Binary (DTB) artifact names instead of mangling KERNEL_IMAGE_* variables.

  • The KERNEL_FIT_NAME and KERNEL_FIT_LINK_NAME variables have been introduced to specify the name of flattened image tree (FIT) kernel images similar to other deployed artifacts.

  • The MODULE_TARBALL_NAME and MODULE_TARBALL_LINK_NAME variable values no longer include the "module-" prefix or ".tgz" suffix. These parts are now hardcoded so that the values are consistent with other artifact naming variables.

  • Added the INITRAMFS_LINK_NAME variable so that the symlink can be controlled similarly to other artifact types.

  • INITRAMFS_NAME now uses "${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}" instead of "${PV}-${PR}-${MACHINE}-${DATETIME}", which makes it consistent with other variables.

4.14.8. SERIAL_CONSOLE Deprecated

The SERIAL_CONSOLE variable has been functionally replaced by the SERIAL_CONSOLES variable for some time. With the Yocto Project 2.6 release, SERIAL_CONSOLE has been officially deprecated.

SERIAL_CONSOLE will continue to work as before for the 2.6 release. However, for the sake of future compatibility, it is recommended that you replace all instances of SERIAL_CONSOLE with SERIAL_CONSOLES.

Note

The only difference in usage is that SERIAL_CONSOLES expects entries to be separated using semicolons as compared to SERIAL_CONSOLE, which expects spaces.

4.14.9. Configure Script Reports Unknown Options as Errors

If the configure script reports an unknown option, this now triggers a QA error instead of a warning. Any recipes that previously got away with specifying such unknown options now need to be fixed.

4.14.10. Override Changes

The following changes have occurred:

  • The virtclass-native and virtclass-nativesdk Overrides Have Been Removed: The virtclass-native and virtclass-nativesdk overrides have been deprecated since 2012 in favor of class-native and class-nativesdk, respectively. Both virtclass-native and virtclass-nativesdk are now dropped.

    Note

    The virtclass-multilib- overrides for multilib are still valid.

  • The forcevariable Override Now Has a Higher Priority Than libc Overrides: The forcevariable override is documented to be the highest priority override. However, due to a long-standing quirk of how OVERRIDES is set, the libc overrides (e.g. libc-glibc, libc-musl, and so forth) erroneously had a higher priority. This issue is now corrected.

    It is likely this change will not cause any problems. However, it is possible with some unusual configurations that you might see a change in behavior if you were relying on the previous behavior. Be sure to check how you use forcevariable and libc-* overrides in your custom layers and configuration files to ensure they make sense.

  • The build-${BUILD_OS} Override Has Been Removed: The build-${BUILD_OS}, which is typically build-linux, override has been removed because building on a host operating system other than a recent version of Linux is neither supported nor recommended. Dropping the override avoids giving the impression that other host operating systems might be supported.

  • The "_remove" operator now preserves whitespace. Consequently, when specifying list items to remove, be aware that leading and trailing whitespace resulting from the removal is retained.

    See the "Removal (Override Style Syntax)" section in the BitBake User Manual for a detailed example.

4.14.11. systemd Configuration is Now Split Into systemd-conf

The configuration for the systemd recipe has been moved into a system-conf recipe. Moving this configuration to a separate recipe avoids the systemd recipe from becoming machine-specific for cases where machine-specific configurations need to be applied (e.g. for qemu* machines).

Currently, the new recipe packages the following files:

     ${sysconfdir}/machine-id
     ${sysconfdir}/systemd/coredump.conf
     ${sysconfdir}/systemd/journald.conf
     ${sysconfdir}/systemd/logind.conf
     ${sysconfdir}/systemd/system.conf
     ${sysconfdir}/systemd/user.conf
            

If you previously used bbappend files to append the systemd recipe to change any of the listed files, you must do so for the systemd-conf recipe instead.

4.14.12. Automatic Testing Changes

This section provides information about automatic testing changes:

  • TEST_IMAGE Variable Removed: Prior to this release, you set the TEST_IMAGE variable to "1" to enable automatic testing for successfully built images. The TEST_IMAGE variable no longer exists and has been replaced by the TESTIMAGE_AUTO variable.

  • Inheriting the testimage and testsdk Classes: Best practices now dictate that you use the IMAGE_CLASSES variable rather than the INHERIT variable when you inherit the testimage and testsdk classes used for automatic testing.

4.14.13. OpenSSL Changes

OpenSSL has been upgraded from 1.0 to 1.1. By default, this upgrade could cause problems for recipes that have both versions in their dependency chains. The problem is that both versions cannot be installed together at build time.

Note

It is possible to have both versions of the library at runtime.

4.14.14. BitBake Changes

The server logfile bitbake-cookerdaemon.log is now always placed in the Build Directory instead of the current directory.

4.14.15. Security Changes

The Poky distribution now uses security compiler flags by default. Inclusion of these flags could cause new failures due to stricter checking for various potential security issues in code.

4.14.16. Post Installation Changes

You must explicitly mark post installs to defer to the target. If you want to explicitly defer a postinstall to first boot on the target rather than at rootfs creation time, use pkg_postinst_ontarget() or call postinst-intercepts defer_to_first_boot from pkg_postinst(). Any failure of a pkg_postinst() script (including exit 1) triggers an error during the do_rootfs task.

For more information on post-installation behavior, see the "Post-Installation Scripts" section in the Yocto Project Development Tasks Manual.

4.14.17. Python 3 Profile-Guided Optimization

The python3 recipe now enables profile-guided optimization. Using this optimization requires a little extra build time in exchange for improved performance on the target at runtime. Additionally, the optimization is only enabled if the current MACHINE has support for user-mode emulation in QEMU (i.e. "qemu-usermode" is in MACHINE_FEATURES, which it is by default).

If you wish to disable Python profile-guided optimization regardless of the value of MACHINE_FEATURES, then ensure that PACKAGECONFIG for the python3 recipe does not contain "pgo". You could accomplish the latter using the following at the configuration level:

     PACKAGECONFIG_remove_pn-python3 = "pgo"
            

Alternatively, you can set PACKAGECONFIG using an append file for the python3 recipe.

4.14.18. Miscellaneous Changes

The following miscellaneous changes occurred:

  • Default to using the Thumb-2 instruction set for armv7a and above. If you have any custom recipes that build software that needs to be built with the ARM instruction set, change the recipe to set the instruction set as follows:

         ARM_INSTRUCTION_SET = "arm"
                        

  • run-postinsts no longer uses /etc/*-postinsts for dpkg/opkg in favor of built-in postinst support. RPM behavior remains unchanged.

  • The NOISO and NOHDD variables are no longer used. You now control building *.iso and *.hddimg image types directly by using the IMAGE_FSTYPES variable.

  • The scripts/contrib/mkefidisk.sh has been removed in favor of Wic.

  • kernel-modules has been removed from RRECOMMENDS for qemumips and qemumips64 machines. Removal also impacts the x86-base.inc file.

    Note

    genericx86 and genericx86-64 retain kernel-modules as part of the RRECOMMENDS variable setting.

  • The LGPLv2_WHITELIST_GPL-3.0 variable has been removed. If you are setting this variable in your configuration, set or append it to the WHITELIST_GPL-3.0 variable instead.

  • ${ASNEEDED} is now included in the TARGET_LDFLAGS variable directly. The remaining definitions from meta/conf/distro/include/as-needed.inc have been moved to corresponding recipes.

  • Support for DSA host keys has been dropped from the OpenSSH recipes. If you are still using DSA keys, you must switch over to a more secure algorithm as recommended by OpenSSH upstream.

  • The dhcp recipe now uses the dhcpd6.conf configuration file in dhcpd6.service for IPv6 DHCP rather than re-using dhcpd.conf, which is now reserved for IPv4.

Chapter 5. Source Directory Structure

Table of Contents

5.1. Top-Level Core Components
5.1.1. bitbake/
5.1.2. build/
5.1.3. documentation/
5.1.4. meta/
5.1.5. meta-poky/
5.1.6. meta-yocto-bsp/
5.1.7. meta-selftest/
5.1.8. meta-skeleton/
5.1.9. scripts/
5.1.10. oe-init-build-env
5.1.11. LICENSE, README, and README.hardware
5.2. The Build Directory - build/
5.2.1. build/buildhistory
5.2.2. build/conf/local.conf
5.2.3. build/conf/bblayers.conf
5.2.4. build/conf/sanity_info
5.2.5. build/downloads/
5.2.6. build/sstate-cache/
5.2.7. build/tmp/
5.2.8. build/tmp/buildstats/
5.2.9. build/tmp/cache/
5.2.10. build/tmp/deploy/
5.2.11. build/tmp/deploy/deb/
5.2.12. build/tmp/deploy/rpm/
5.2.13. build/tmp/deploy/ipk/
5.2.14. build/tmp/deploy/licenses/
5.2.15. build/tmp/deploy/images/
5.2.16. build/tmp/deploy/sdk/
5.2.17. build/tmp/sstate-control/
5.2.18. build/tmp/sysroots-components/
5.2.19. build/tmp/sysroots/
5.2.20. build/tmp/stamps/
5.2.21. build/tmp/log/
5.2.22. build/tmp/work/
5.2.23. build/tmp/work/tunearch/recipename/version/
5.2.24. build/tmp/work-shared/
5.3. The Metadata - meta/
5.3.1. meta/classes/
5.3.2. meta/conf/
5.3.3. meta/conf/machine/
5.3.4. meta/conf/distro/
5.3.5. meta/conf/machine-sdk/
5.3.6. meta/files/
5.3.7. meta/lib/
5.3.8. meta/recipes-bsp/
5.3.9. meta/recipes-connectivity/
5.3.10. meta/recipes-core/
5.3.11. meta/recipes-devtools/
5.3.12. meta/recipes-extended/
5.3.13. meta/recipes-gnome/
5.3.14. meta/recipes-graphics/
5.3.15. meta/recipes-kernel/
5.3.16. meta/recipes-lsb4/
5.3.17. meta/recipes-multimedia/
5.3.18. meta/recipes-rt/
5.3.19. meta/recipes-sato/
5.3.20. meta/recipes-support/
5.3.21. meta/site/
5.3.22. meta/recipes.txt

The Source Directory consists of several components. Understanding them and knowing where they are located is key to using the Yocto Project well. This chapter describes the Source Directory and gives information about the various files and directories.

For information on how to establish a local Source Directory on your development system, see the "Locating Yocto Project Source Files" section in the Yocto Project Development Tasks Manual.

Note

The OpenEmbedded build system does not support file or directory names that contain spaces. Be sure that the Source Directory you use does not contain these types of names.

5.1. Top-Level Core Components

This section describes the top-level components of the Source Directory.

5.1.1. bitbake/

This directory includes a copy of BitBake for ease of use. The copy usually matches the current stable BitBake release from the BitBake project. BitBake, a Metadata interpreter, reads the Yocto Project Metadata and runs the tasks defined by that data. Failures are usually from the Metadata and not from BitBake itself. Consequently, most users do not need to worry about BitBake.

When you run the bitbake command, the main BitBake executable, which resides in the bitbake/bin/ directory, starts. Sourcing the environment setup script (i.e. oe-init-build-env) places the scripts and bitbake/bin directories (in that order) into the shell's PATH environment variable.

For more information on BitBake, see the BitBake User Manual.

5.1.2. build/

This directory contains user configuration files and the output generated by the OpenEmbedded build system in its standard configuration where the source tree is combined with the output. The Build Directory is created initially when you source the OpenEmbedded build environment setup script (i.e. oe-init-build-env).

It is also possible to place output and configuration files in a directory separate from the Source Directory by providing a directory name when you source the setup script. For information on separating output from your local Source Directory files, see the "oe-init-build-env" section.

5.1.3. documentation/

This directory holds the source for the Yocto Project documentation as well as templates and tools that allow you to generate PDF and HTML versions of the manuals. Each manual is contained in a sub-folder. For example, the files for this manual reside in the ref-manual/ directory.

5.1.4. meta/

This directory contains the OpenEmbedded-Core metadata. The directory holds recipes, common classes, and machine configuration for emulated targets (qemux86, qemuarm, and so forth.)

5.1.5. meta-poky/

This directory contains the configuration for the Poky reference distribution.

5.1.6. meta-yocto-bsp/

This directory contains the Yocto Project reference hardware Board Support Packages (BSPs). For more information on BSPs, see the Yocto Project Board Support Package (BSP) Developer's Guide.

5.1.7. meta-selftest/

This directory adds additional recipes and append files used by the OpenEmbedded selftests to verify the behavior of the build system.

You do not have to add this layer to your bblayers.conf file unless you want to run the selftests.

5.1.8. meta-skeleton/

This directory contains template recipes for BSP and kernel development.

5.1.9. scripts/

This directory contains various integration scripts that implement extra functionality in the Yocto Project environment (e.g. QEMU scripts). The oe-init-build-env script appends this directory to the shell's PATH environment variable.

The scripts directory has useful scripts that assist in contributing back to the Yocto Project, such as create-pull-request and send-pull-request.

5.1.10. oe-init-build-env

This script sets up the OpenEmbedded build environment. Running this script with the source command in a shell makes changes to PATH and sets other core BitBake variables based on the current working directory. You need to run an environment setup script before running BitBake commands. The script uses other scripts within the scripts directory to do the bulk of the work.

When you run this script, your Yocto Project environment is set up, a Build Directory is created, your working directory becomes the Build Directory, and you are presented with a list of common BitBake targets. Here is an example:

     $ source oe-init-build-env

     ### Shell environment set up for builds. ###

     You can now run 'bitbake <target>'

     Common targets are:
         core-image-minimal
         core-image-sato
         meta-toolchain
         meta-ide-support

     You can also run generated qemu images with a command like 'runqemu qemux86'
            

The script gets its default list of common targets from the conf-notes.txt file, which is found in the meta-poky directory within the Source Directory. Should you have custom distributions, it is very easy to modify this configuration file to include your targets for your distribution. See the "Creating a Custom Template Configuration Directory" section in the Yocto Project Development Tasks Manual for more information.

By default, running this script without a Build Directory argument creates the build directory in your current working directory. If you provide a Build Directory argument when you source the script, you direct the OpenEmbedded build system to create a Build Directory of your choice. For example, the following command creates a Build Directory named mybuilds that is outside of the Source Directory:

     $ source oe-init-build-env ~/mybuilds
            

The OpenEmbedded build system uses the template configuration files, which are found by default in the meta-poky/conf directory in the Source Directory. See the "Creating a Custom Template Configuration Directory" section in the Yocto Project Development Tasks Manual for more information.

Note

The OpenEmbedded build system does not support file or directory names that contain spaces. If you attempt to run the oe-init-build-env script from a Source Directory that contains spaces in either the filenames or directory names, the script returns an error indicating no such file or directory. Be sure to use a Source Directory free of names containing spaces.

5.1.11. LICENSE, README, and README.hardware

These files are standard top-level files.

5.2. The Build Directory - build/

The OpenEmbedded build system creates the Build Directory when you run the build environment setup scripts (i.e. oe-init-build-env).

If you do not give the Build Directory a specific name when you run a setup script, the name defaults to build.

The TOPDIR variable points to the Build Directory.

5.2.1. build/buildhistory

The OpenEmbedded build system creates this directory when you enable the build history feature. The directory tracks build information into image, packages, and SDK subdirectories. For information on the build history feature, see the "Maintaining Build Output Quality" section in the Yocto Project Development Tasks Manual.

5.2.2. build/conf/local.conf

This configuration file contains all the local user configurations for your build environment. The local.conf file contains documentation on the various configuration options. Any variable set here overrides any variable set elsewhere within the environment unless that variable is hard-coded within a file (e.g. by using '=' instead of '?='). Some variables are hard-coded for various reasons but these variables are relatively rare.

Edit this file to set the MACHINE for which you want to build, which package types you wish to use (PACKAGE_CLASSES), and the location from which you want to access downloaded files (DL_DIR).

If local.conf is not present when you start the build, the OpenEmbedded build system creates it from local.conf.sample when you source the top-level build environment setup script (i.e. oe-init-build-env).

The source local.conf.sample file used depends on the $TEMPLATECONF script variable, which defaults to meta-poky/conf when you are building from the Yocto Project development environment and defaults to meta/conf when you are building from the OpenEmbedded-Core environment. Because the script variable points to the source of the local.conf.sample file, this implies that you can configure your build environment from any layer by setting the variable in the top-level build environment setup script as follows:

     TEMPLATECONF=your_layer/conf
            

Once the build process gets the sample file, it uses sed to substitute final ${OEROOT} values for all ##OEROOT## values.

Note

You can see how the TEMPLATECONF variable is used by looking at the scripts/oe-setup-builddir script in the Source Directory. You can find the Yocto Project version of the local.conf.sample file in the meta-poky/conf directory.

5.2.3. build/conf/bblayers.conf

This configuration file defines layers, which are directory trees, traversed (or walked) by BitBake. The bblayers.conf file uses the BBLAYERS variable to list the layers BitBake tries to find.

If bblayers.conf is not present when you start the build, the OpenEmbedded build system creates it from bblayers.conf.sample when you source the top-level build environment setup script (i.e. oe-init-build-env).

The source bblayers.conf.sample file used depends on the $TEMPLATECONF script variable, which defaults to meta-poky/conf when you are building from the Yocto Project development environment and defaults to meta/conf when you are building from the OpenEmbedded-Core environment. Because the script variable points to the source of the bblayers.conf.sample file, this implies that you can base your build from any layer by setting the variable in the top-level build environment setup script as follows:

     TEMPLATECONF=your_layer/conf
            

Once the build process gets the sample file, it uses sed to substitute final ${OEROOT} values for all ##OEROOT## values.

Note

You can see how the TEMPLATECONF variable scripts/oe-setup-builddir script in the Source Directory. You can find the Yocto Project version of the bblayers.conf.sample file in the meta-poky/conf directory.

5.2.4. build/conf/sanity_info

This file indicates the state of the sanity checks and is created during the build.

5.2.5. build/downloads/

This directory contains downloaded upstream source tarballs. You can reuse the directory for multiple builds or move the directory to another location. You can control the location of this directory through the DL_DIR variable.

5.2.6. build/sstate-cache/

This directory contains the shared state cache. You can reuse the directory for multiple builds or move the directory to another location. You can control the location of this directory through the SSTATE_DIR variable.

5.2.7. build/tmp/

The OpenEmbedded build system creates and uses this directory for all the build system's output. The TMPDIR variable points to this directory.

BitBake creates this directory if it does not exist. As a last resort, to clean up a build and start it from scratch (other than the downloads), you can remove everything in the tmp directory or get rid of the directory completely. If you do, you should also completely remove the build/sstate-cache directory.

5.2.8. build/tmp/buildstats/

This directory stores the build statistics.

5.2.9. build/tmp/cache/

When BitBake parses the metadata (recipes and configuration files), it caches the results in build/tmp/cache/ to speed up future builds. The results are stored on a per-machine basis.

During subsequent builds, BitBake checks each recipe (together with, for example, any files included or appended to it) to see if they have been modified. Changes can be detected, for example, through file modification time (mtime) changes and hashing of file contents. If no changes to the file are detected, then the parsed result stored in the cache is reused. If the file has changed, it is reparsed.

5.2.10. build/tmp/deploy/

This directory contains any "end result" output from the OpenEmbedded build process. The DEPLOY_DIR variable points to this directory. For more detail on the contents of the deploy directory, see the "Images" and "Application Development SDK" sections in the Yocto Project Overview and Concepts Manual.

5.2.11. build/tmp/deploy/deb/

This directory receives any .deb packages produced by the build process. The packages are sorted into feeds for different architecture types.

5.2.12. build/tmp/deploy/rpm/

This directory receives any .rpm packages produced by the build process. The packages are sorted into feeds for different architecture types.

5.2.13. build/tmp/deploy/ipk/

This directory receives .ipk packages produced by the build process.

5.2.14. build/tmp/deploy/licenses/

This directory receives package licensing information. For example, the directory contains sub-directories for bash, busybox, and glibc (among others) that in turn contain appropriate COPYING license files with other licensing information. For information on licensing, see the "Maintaining Open Source License Compliance During Your Product's Lifecycle" section in the Yocto Project Development Tasks Manual.

5.2.15. build/tmp/deploy/images/

This directory receives complete filesystem images. If you want to flash the resulting image from a build onto a device, look here for the image.

Be careful when deleting files in this directory. You can safely delete old images from this directory (e.g. core-image-*). However, the kernel (*zImage*, *uImage*, etc.), bootloader and other supplementary files might be deployed here prior to building an image. Because these files are not directly produced from the image, if you delete them they will not be automatically re-created when you build the image again.

If you do accidentally delete files here, you will need to force them to be re-created. In order to do that, you will need to know the target that produced them. For example, these commands rebuild and re-create the kernel files:

     $ bitbake -c clean virtual/kernel
     $ bitbake virtual/kernel
            

5.2.16. build/tmp/deploy/sdk/

The OpenEmbedded build system creates this directory to hold toolchain installer scripts, which when executed, install the sysroot that matches your target hardware. You can find out more about these installers in the "Building an SDK Installer" section in the Yocto Project Application Development and the Extensible Software Development Kit (eSDK) manual.

5.2.17. build/tmp/sstate-control/

The OpenEmbedded build system uses this directory for the shared state manifest files. The shared state code uses these files to record the files installed by each sstate task so that the files can be removed when cleaning the recipe or when a newer version is about to be installed. The build system also uses the manifests to detect and produce a warning when files from one task are overwriting those from another.

5.2.18. build/tmp/sysroots-components/

This directory is the location of the sysroot contents that the task do_prepare_recipe_sysroot links or copies into the recipe-specific sysroot for each recipe listed in DEPENDS. Population of this directory is handled through shared state, while the path is specified by the COMPONENTS_DIR variable. Apart from a few unusual circumstances, handling of the sysroots-components directory should be automatic, and recipes should not directly reference build/tmp/sysroots-components.

5.2.19. build/tmp/sysroots/

Previous versions of the OpenEmbedded build system used to create a global shared sysroot per machine along with a native sysroot. Beginning with the 2.6 version of the Yocto Project, sysroots exist in recipe-specific WORKDIR directories. Thus, the build/tmp/sysroots/ directory is unused.

Note

The build/tmp/sysroots/ directory can still be populated using the bitbake build-sysroots command and can be used for compatibility in some cases. However, in general it is not recommended to populate this directory. Individual recipe-specific sysroots should be used.

5.2.20. build/tmp/stamps/

This directory holds information that BitBake uses for accounting purposes to track what tasks have run and when they have run. The directory is sub-divided by architecture, package name, and version. Following is an example:

     stamps/all-poky-linux/distcc-config/1.0-r0.do_build-2fdd....2do
            

Although the files in the directory are empty of data, BitBake uses the filenames and timestamps for tracking purposes.

For information on how BitBake uses stamp files to determine if a task should be rerun, see the "Stamp Files and the Rerunning of Tasks" section in the Yocto Project Overview and Concepts Manual.

5.2.21. build/tmp/log/

This directory contains general logs that are not otherwise placed using the package's WORKDIR. Examples of logs are the output from the do_check_pkg or do_distro_check tasks. Running a build does not necessarily mean this directory is created.

5.2.22. build/tmp/work/

This directory contains architecture-specific work sub-directories for packages built by BitBake. All tasks execute from the appropriate work directory. For example, the source for a particular package is unpacked, patched, configured and compiled all within its own work directory. Within the work directory, organization is based on the package group and version for which the source is being compiled as defined by the WORKDIR.

It is worth considering the structure of a typical work directory. As an example, consider linux-yocto-kernel-3.0 on the machine qemux86 built within the Yocto Project. For this package, a work directory of tmp/work/qemux86-poky-linux/linux-yocto/3.0+git1+<.....>, referred to as the WORKDIR, is created. Within this directory, the source is unpacked to linux-qemux86-standard-build and then patched by Quilt. (See the "Using Quilt in Your Workflow" section in the Yocto Project Development Tasks Manual for more information.) Within the linux-qemux86-standard-build directory, standard Quilt directories linux-3.0/patches and linux-3.0/.pc are created, and standard Quilt commands can be used.

There are other directories generated within WORKDIR. The most important directory is WORKDIR/temp/, which has log files for each task (log.do_*.pid) and contains the scripts BitBake runs for each task (run.do_*.pid). The WORKDIR/image/ directory is where "make install" places its output that is then split into sub-packages within WORKDIR/packages-split/.

5.2.23. build/tmp/work/tunearch/recipename/version/

The recipe work directory - ${WORKDIR}.

As described earlier in the "build/tmp/sysroots/" section, beginning with the 2.6 release of the Yocto Project, the OpenEmbedded build system builds each recipe in its own work directory (i.e. WORKDIR). The path to the work directory is constructed using the architecture of the given build (e.g. TUNE_PKGARCH, MACHINE_ARCH, or "allarch"), the recipe name, and the version of the recipe (i.e. PE:PV-PR).

A number of key subdirectories exist within each recipe work directory:

  • ${WORKDIR}/temp: Contains the log files of each task executed for this recipe, the "run" files for each executed task, which contain the code run, and a log.task_order file, which lists the order in which tasks were executed.

  • ${WORKDIR}/image: Contains the output of the do_install task, which corresponds to the ${D} variable in that task.

  • ${WORKDIR}/pseudo: Contains the pseudo database and log for any tasks executed under pseudo for the recipe.

  • ${WORKDIR}/sysroot-destdir: Contains the output of the do_populate_sysroot task.

  • ${WORKDIR}/package: Contains the output of the do_package task before the output is split into individual packages.

  • ${WORKDIR}/packages-split: Contains the output of the do_package task after the output has been split into individual packages. Subdirectories exist for each individual package created by the recipe.

  • ${WORKDIR}/recipe-sysroot: A directory populated with the target dependencies of the recipe. This directory looks like the target filesystem and contains libraries that the recipe might need to link against (e.g. the C library).

  • ${WORKDIR}/recipe-sysroot-native: A directory populated with the native dependencies of the recipe. This directory contains the tools the recipe needs to build (e.g. the compiler, Autoconf, libtool, and so forth).

  • ${WORKDIR}/build: This subdirectory applies only to recipes that support builds where the source is separate from the build artifacts. The OpenEmbedded build system uses this directory as a separate build directory (i.e. ${B}).

5.2.24. build/tmp/work-shared/

For efficiency, the OpenEmbedded build system creates and uses this directory to hold recipes that share a work directory with other recipes. In practice, this is only used for gcc and its variants (e.g. gcc-cross, libgcc, gcc-runtime, and so forth).

5.3. The Metadata - meta/

As mentioned previously, Metadata is the core of the Yocto Project. Metadata has several important subdivisions:

5.3.1. meta/classes/

This directory contains the *.bbclass files. Class files are used to abstract common code so it can be reused by multiple packages. Every package inherits the base.bbclass file. Examples of other important classes are autotools.bbclass, which in theory allows any Autotool-enabled package to work with the Yocto Project with minimal effort. Another example is kernel.bbclass that contains common code and functions for working with the Linux kernel. Functions like image generation or packaging also have their specific class files such as image.bbclass, rootfs_*.bbclass and package*.bbclass.

For reference information on classes, see the "Classes" chapter.

5.3.2. meta/conf/

This directory contains the core set of configuration files that start from bitbake.conf and from which all other configuration files are included. See the include statements at the end of the bitbake.conf file and you will note that even local.conf is loaded from there. While bitbake.conf sets up the defaults, you can often override these by using the (local.conf) file, machine file or the distribution configuration file.

5.3.3. meta/conf/machine/

This directory contains all the machine configuration files. If you set MACHINE = "qemux86", the OpenEmbedded build system looks for a qemux86.conf file in this directory. The include directory contains various data common to multiple machines. If you want to add support for a new machine to the Yocto Project, look in this directory.

5.3.4. meta/conf/distro/

The contents of this directory controls any distribution-specific configurations. For the Yocto Project, the defaultsetup.conf is the main file here. This directory includes the versions and the SRCDATE definitions for applications that are configured here. An example of an alternative configuration might be poky-bleeding.conf. Although this file mainly inherits its configuration from Poky.

5.3.5. meta/conf/machine-sdk/

The OpenEmbedded build system searches this directory for configuration files that correspond to the value of SDKMACHINE. By default, 32-bit and 64-bit x86 files ship with the Yocto Project that support some SDK hosts. However, it is possible to extend that support to other SDK hosts by adding additional configuration files in this subdirectory within another layer.

5.3.6. meta/files/

This directory contains common license files and several text files used by the build system. The text files contain minimal device information and lists of files and directories with known permissions.

5.3.7. meta/lib/

This directory contains OpenEmbedded Python library code used during the build process.

5.3.8. meta/recipes-bsp/

This directory contains anything linking to specific hardware or hardware configuration information such as "u-boot" and "grub".

5.3.9. meta/recipes-connectivity/

This directory contains libraries and applications related to communication with other devices.

5.3.10. meta/recipes-core/

This directory contains what is needed to build a basic working Linux image including commonly used dependencies.

5.3.11. meta/recipes-devtools/

This directory contains tools that are primarily used by the build system. The tools, however, can also be used on targets.

5.3.12. meta/recipes-extended/

This directory contains non-essential applications that add features compared to the alternatives in core. You might need this directory for full tool functionality or for Linux Standard Base (LSB) compliance.

5.3.13. meta/recipes-gnome/

This directory contains all things related to the GTK+ application framework.

5.3.14. meta/recipes-graphics/

This directory contains X and other graphically related system libraries

5.3.15. meta/recipes-kernel/

This directory contains the kernel and generic applications and libraries that have strong kernel dependencies.

5.3.16. meta/recipes-lsb4/

This directory contains recipes specifically added to support the Linux Standard Base (LSB) version 4.x.

5.3.17. meta/recipes-multimedia/

This directory contains codecs and support utilities for audio, images and video.

5.3.18. meta/recipes-rt/

This directory contains package and image recipes for using and testing the PREEMPT_RT kernel.

5.3.19. meta/recipes-sato/

This directory contains the Sato demo/reference UI/UX and its associated applications and configuration data.

5.3.20. meta/recipes-support/

This directory contains recipes used by other recipes, but that are not directly included in images (i.e. dependencies of other recipes).

5.3.21. meta/site/

This directory contains a list of cached results for various architectures. Because certain "autoconf" test results cannot be determined when cross-compiling due to the tests not able to run on a live system, the information in this directory is passed to "autoconf" for the various architectures.

5.3.22. meta/recipes.txt

This file is a description of the contents of recipes-*.

Chapter 6. Classes

Table of Contents

6.1. allarch.bbclass
6.2. archiver.bbclass
6.3. autotools*.bbclass
6.4. base.bbclass
6.5. bash-completion.bbclass
6.6. bin_package.bbclass
6.7. binconfig.bbclass
6.8. binconfig-disabled.bbclass
6.9. blacklist.bbclass
6.10. bluetooth.bbclass
6.11. bugzilla.bbclass
6.12. buildhistory.bbclass
6.13. buildstats.bbclass
6.14. buildstats-summary.bbclass
6.15. ccache.bbclass
6.16. chrpath.bbclass
6.17. clutter.bbclass
6.18. cmake.bbclass
6.19. cml1.bbclass
6.20. compress_doc.bbclass
6.21. copyleft_compliance.bbclass
6.22. copyleft_filter.bbclass
6.23. core-image.bbclass
6.24. cpan*.bbclass
6.25. cross.bbclass
6.26. cross-canadian.bbclass
6.27. crosssdk.bbclass
6.28. debian.bbclass
6.29. deploy.bbclass
6.30. devshell.bbclass
6.31. devupstream.bbclass
6.32. distro_features_check.bbclass
6.33. distrodata.bbclass
6.34. distutils*.bbclass
6.35. distutils3*.bbclass
6.36. externalsrc.bbclass
6.37. extrausers.bbclass
6.38. fontcache.bbclass
6.39. fs-uuid.bbclass
6.40. gconf.bbclass
6.41. gettext.bbclass
6.42. gnome.bbclass
6.43. gnomebase.bbclass
6.44. gobject-introspection.bbclass
6.45. grub-efi.bbclass
6.46. gsettings.bbclass
6.47. gtk-doc.bbclass
6.48. gtk-icon-cache.bbclass
6.49. gtk-immodules-cache.bbclass
6.50. gzipnative.bbclass
6.51. icecc.bbclass
6.52. image.bbclass
6.53. image-buildinfo.bbclass
6.54. image_types.bbclass
6.55. image-live.bbclass
6.56. image-mklibs.bbclass
6.57. image-prelink.bbclass
6.58. insane.bbclass
6.59. insserv.bbclass
6.60. kernel.bbclass
6.61. kernel-arch.bbclass
6.62. kernel-devicetree.bbclass
6.63. kernel-fitimage.bbclass
6.64. kernel-grub.bbclass
6.65. kernel-module-split.bbclass
6.66. kernel-uboot.bbclass
6.67. kernel-uimage.bbclass
6.68. kernel-yocto.bbclass
6.69. kernelsrc.bbclass
6.70. lib_package.bbclass
6.71. libc*.bbclass
6.72. license.bbclass
6.73. linux-kernel-base.bbclass
6.74. linuxloader.bbclass
6.75. logging.bbclass
6.76. meta.bbclass
6.77. metadata_scm.bbclass
6.78. migrate_localcount.bbclass
6.79. mime.bbclass
6.80. mirrors.bbclass
6.81. module.bbclass
6.82. module-base.bbclass
6.83. multilib*.bbclass
6.84. native.bbclass
6.85. nativesdk.bbclass
6.86. nopackages.bbclass
6.87. npm.bbclass
6.88. oelint.bbclass
6.89. own-mirrors.bbclass
6.90. package.bbclass
6.91. package_deb.bbclass
6.92. package_ipk.bbclass
6.93. package_rpm.bbclass
6.94. package_tar.bbclass
6.95. packagedata.bbclass
6.96. packagegroup.bbclass
6.97. patch.bbclass
6.98. perlnative.bbclass
6.99. pixbufcache.bbclass
6.100. pkgconfig.bbclass
6.101. populate_sdk.bbclass
6.102. populate_sdk_*.bbclass
6.103. prexport.bbclass
6.104. primport.bbclass
6.105. prserv.bbclass
6.106. ptest.bbclass
6.107. ptest-gnome.bbclass
6.108. python-dir.bbclass
6.109. python3native.bbclass
6.110. pythonnative.bbclass
6.111. qemu.bbclass
6.112. recipe_sanity.bbclass
6.113. relocatable.bbclass
6.114. remove-libtool.bbclass
6.115. report-error.bbclass
6.116. rm_work.bbclass
6.117. rootfs*.bbclass
6.118. sanity.bbclass
6.119. scons.bbclass
6.120. sdl.bbclass
6.121. setuptools.bbclass
6.122. setuptools3.bbclass
6.123. sign_rpm.bbclass
6.124. sip.bbclass
6.125. siteconfig.bbclass
6.126. siteinfo.bbclass
6.127. spdx.bbclass
6.128. sstate.bbclass
6.129. staging.bbclass
6.130. syslinux.bbclass
6.131. systemd.bbclass
6.132. systemd-boot.bbclass
6.133. terminal.bbclass
6.134. testimage*.bbclass
6.135. testsdk.bbclass
6.136. texinfo.bbclass
6.137. tinderclient.bbclass
6.138. toaster.bbclass
6.139. toolchain-scripts.bbclass
6.140. typecheck.bbclass
6.141. uboot-config.bbclass
6.142. uninative.bbclass
6.143. update-alternatives.bbclass
6.144. update-rc.d.bbclass
6.145. useradd*.bbclass
6.146. utility-tasks.bbclass
6.147. utils.bbclass
6.148. vala.bbclass
6.149. waf.bbclass

Class files are used to abstract common functionality and share it amongst multiple recipe (.bb) files. To use a class file, you simply make sure the recipe inherits the class. In most cases, when a recipe inherits a class it is enough to enable its features. There are cases, however, where in the recipe you might need to set variables or override some default behavior.

Any Metadata usually found in a recipe can also be placed in a class file. Class files are identified by the extension .bbclass and are usually placed in a classes/ directory beneath the meta*/ directory found in the Source Directory. Class files can also be pointed to by BUILDDIR (e.g. build/) in the same way as .conf files in the conf directory. Class files are searched for in BBPATH using the same method by which .conf files are searched.

This chapter discusses only the most useful and important classes. Other classes do exist within the meta/classes directory in the Source Directory. You can reference the .bbclass files directly for more information.

6.1. allarch.bbclass

The allarch class is inherited by recipes that do not produce architecture-specific output. The class disables functionality that is normally needed for recipes that produce executable binaries (such as building the cross-compiler and a C library as pre-requisites, and splitting out of debug symbols during packaging).

Note

Unlike some distro recipes (e.g. Debian), OpenEmbedded recipes that produce packages that depend on tunings through use of the RDEPENDS and TUNE_PKGARCH variables, should never be configured for all architectures using allarch. This is the case even if the recipes do not produce architecture-specific output.

Configuring such recipes for all architectures causes the do_package_write_* tasks to have different signatures for the machines with different tunings. Additionally, unnecessary rebuilds occur every time an image for a different MACHINE is built even when the recipe never changes.

By default, all recipes inherit the base and package classes, which enable functionality needed for recipes that produce executable output. If your recipe, for example, only produces packages that contain configuration files, media files, or scripts (e.g. Python and Perl), then it should inherit the allarch class.

6.2. archiver.bbclass

The archiver class supports releasing source code and other materials with the binaries.

For more details on the source archiver, see the "Maintaining Open Source License Compliance During Your Product's Lifecycle" section in the Yocto Project Development Tasks Manual. You can also see the ARCHIVER_MODE variable for information about the variable flags (varflags) that help control archive creation.

6.3. autotools*.bbclass

The autotools* classes support Autotooled packages.

The autoconf, automake, and libtool packages bring standardization. This class defines a set of tasks (e.g. configure, compile and so forth) that work for all Autotooled packages. It should usually be enough to define a few standard variables and then simply inherit autotools. These classes can also work with software that emulates Autotools. For more information, see the "Autotooled Package" section in the Yocto Project Development Tasks Manual.

By default, the autotools* classes use out-of-tree builds (i.e. autotools.bbclass building with B != S).

If the software being built by a recipe does not support using out-of-tree builds, you should have the recipe inherit the autotools-brokensep class. The autotools-brokensep class behaves the same as the autotools class but builds with B == S. This method is useful when out-of-tree build support is either not present or is broken.

Note

It is recommended that out-of-tree support be fixed and used if at all possible.

It's useful to have some idea of how the tasks defined by the autotools* classes work and what they do behind the scenes.

  • do_configure - Regenerates the configure script (using autoreconf) and then launches it with a standard set of arguments used during cross-compilation. You can pass additional parameters to configure through the EXTRA_OECONF or PACKAGECONFIG_CONFARGS variables.

  • do_compile - Runs make with arguments that specify the compiler and linker. You can pass additional arguments through the EXTRA_OEMAKE variable.

  • do_install - Runs make install and passes in ${D} as DESTDIR.

6.4. base.bbclass

The base class is special in that every .bb file implicitly inherits the class. This class contains definitions for standard basic tasks such as fetching, unpacking, configuring (empty by default), compiling (runs any Makefile present), installing (empty by default) and packaging (empty by default). These classes are often overridden or extended by other classes such as the autotools class or the package class.

The class also contains some commonly used functions such as oe_runmake, which runs make with the arguments specified in EXTRA_OEMAKE variable as well as the arguments passed directly to oe_runmake.

6.5. bash-completion.bbclass

Sets up packaging and dependencies appropriate for recipes that build software that includes bash-completion data.

6.6. bin_package.bbclass

The bin_package class is a helper class for recipes that extract the contents of a binary package (e.g. an RPM) and install those contents rather than building the binary from source. The binary package is extracted and new packages in the configured output package format are created. Extraction and installation of proprietary binaries is a good example use for this class.

Note

For RPMs and other packages that do not contain a subdirectory, you should specify an appropriate fetcher parameter to point to the subdirectory. For example, if BitBake is using the Git fetcher (git://), the "subpath" parameter limits the checkout to a specific subpath of the tree. Here is an example where ${BP} is used so that the files are extracted into the subdirectory expected by the default value of S:
     SRC_URI = "git://example.com/downloads/somepackage.rpm;subpath=${BP}"
            
See the "Fetchers" section in the BitBake User Manual for more information on supported BitBake Fetchers.

6.7. binconfig.bbclass

The binconfig class helps to correct paths in shell scripts.

Before pkg-config had become widespread, libraries shipped shell scripts to give information about the libraries and include paths needed to build software (usually named LIBNAME-config). This class assists any recipe using such scripts.

During staging, the OpenEmbedded build system installs such scripts into the sysroots/ directory. Inheriting this class results in all paths in these scripts being changed to point into the sysroots/ directory so that all builds that use the script use the correct directories for the cross compiling layout. See the BINCONFIG_GLOB variable for more information.

6.8. binconfig-disabled.bbclass

An alternative version of the binconfig class, which disables binary configuration scripts by making them return an error in favor of using pkg-config to query the information. The scripts to be disabled should be specified using the BINCONFIG variable within the recipe inheriting the class.

6.9. blacklist.bbclass

The blacklist class prevents the OpenEmbedded build system from building specific recipes (blacklists them). To use this class, inherit the class globally and set PNBLACKLIST for each recipe you wish to blacklist. Specify the PN value as a variable flag (varflag) and provide a reason, which is reported, if the package is requested to be built as the value. For example, if you want to blacklist a recipe called "exoticware", you add the following to your local.conf or distribution configuration:

     INHERIT += "blacklist"
     PNBLACKLIST[exoticware] = "Not supported by our organization."
        

6.10. bluetooth.bbclass

The bluetooth class defines a variable that expands to the recipe (package) providing core bluetooth support on the platform.

For details on how the class works, see the meta/classes/bluetooth.bbclass file in the Yocto Project Source Directory.

6.11. bugzilla.bbclass

The bugzilla class supports setting up an instance of Bugzilla in which you can automatically files bug reports in response to build failures. For this class to work, you need to enable the XML-RPC interface in the instance of Bugzilla.

6.12. buildhistory.bbclass

The buildhistory class records a history of build output metadata, which can be used to detect possible regressions as well as used for analysis of the build output. For more information on using Build History, see the "Maintaining Build Output Quality" section in the Yocto Project Development Tasks Manual.

6.13. buildstats.bbclass

The buildstats class records performance statistics about each task executed during the build (e.g. elapsed time, CPU usage, and I/O usage).

When you use this class, the output goes into the BUILDSTATS_BASE directory, which defaults to ${TMPDIR}/buildstats/. You can analyze the elapsed time using scripts/pybootchartgui/pybootchartgui.py, which produces a cascading chart of the entire build process and can be useful for highlighting bottlenecks.

Collecting build statistics is enabled by default through the USER_CLASSES variable from your local.conf file. Consequently, you do not have to do anything to enable the class. However, if you want to disable the class, simply remove "buildstats" from the USER_CLASSES list.

6.14. buildstats-summary.bbclass

When inherited globally, prints statistics at the end of the build on sstate re-use. In order to function, this class requires the buildstats class be enabled.

6.15. ccache.bbclass

The ccache class enables the C/C++ Compiler Cache for the build. This class is used to give a minor performance boost during the build. However, using the class can lead to unexpected side-effects. Thus, it is recommended that you do not use this class. See http://ccache.samba.org/ for information on the C/C++ Compiler Cache.

6.16. chrpath.bbclass

The chrpath class is a wrapper around the "chrpath" utility, which is used during the build process for nativesdk, cross, and cross-canadian recipes to change RPATH records within binaries in order to make them relocatable.

6.17. clutter.bbclass

The clutter class consolidates the major and minor version naming and other common items used by Clutter and related recipes.

Note

Unlike some other classes related to specific libraries, recipes building other software that uses Clutter do not need to inherit this class unless they use the same recipe versioning scheme that the Clutter and related recipes do.

6.18. cmake.bbclass

The cmake class allows for recipes that need to build software using the CMake build system. You can use the EXTRA_OECMAKE variable to specify additional configuration options to be passed using the cmake command line.

6.19. cml1.bbclass

The cml1 class provides basic support for the Linux kernel style build configuration system.

6.20. compress_doc.bbclass

Enables compression for man pages and info pages. This class is intended to be inherited globally. The default compression mechanism is gz (gzip) but you can select an alternative mechanism by setting the DOC_COMPRESS variable.

6.21. copyleft_compliance.bbclass

The copyleft_compliance class preserves source code for the purposes of license compliance. This class is an alternative to the archiver class and is still used by some users even though it has been deprecated in favor of the archiver class.

6.22. copyleft_filter.bbclass

A class used by the archiver and copyleft_compliance classes for filtering licenses. The copyleft_filter class is an internal class and is not intended to be used directly.

6.23. core-image.bbclass

The core-image class provides common definitions for the core-image-* image recipes, such as support for additional IMAGE_FEATURES.

6.24. cpan*.bbclass

The cpan* classes support Perl modules.

Recipes for Perl modules are simple. These recipes usually only need to point to the source's archive and then inherit the proper class file. Building is split into two methods depending on which method the module authors used.

  • Modules that use old Makefile.PL-based build system require cpan.bbclass in their recipes.

  • Modules that use Build.PL-based build system require using cpan_build.bbclass in their recipes.

Both build methods inherit the cpan-base class for basic Perl support.

6.25. cross.bbclass

The cross class provides support for the recipes that build the cross-compilation tools.

6.26. cross-canadian.bbclass

The cross-canadian class provides support for the recipes that build the Canadian Cross-compilation tools for SDKs. See the "Cross-Development Toolchain Generation" section in the Yocto Project Overview and Concepts Manual for more discussion on these cross-compilation tools.

6.27. crosssdk.bbclass

The crosssdk class provides support for the recipes that build the cross-compilation tools used for building SDKs. See the "Cross-Development Toolchain Generation" section in the Yocto Project Overview and Concepts Manual for more discussion on these cross-compilation tools.

6.28. debian.bbclass

The debian class renames output packages so that they follow the Debian naming policy (i.e. glibc becomes libc6 and glibc-devel becomes libc6-dev.) Renaming includes the library name and version as part of the package name.

If a recipe creates packages for multiple libraries (shared object files of .so type), use the LEAD_SONAME variable in the recipe to specify the library on which to apply the naming scheme.

6.29. deploy.bbclass

The deploy class handles deploying files to the DEPLOY_DIR_IMAGE directory. The main function of this class is to allow the deploy step to be accelerated by shared state. Recipes that inherit this class should define their own do_deploy function to copy the files to be deployed to DEPLOYDIR, and use addtask to add the task at the appropriate place, which is usually after do_compile or do_install. The class then takes care of staging the files from DEPLOYDIR to DEPLOY_DIR_IMAGE.

6.30. devshell.bbclass

The devshell class adds the do_devshell task. Distribution policy dictates whether to include this class. See the "Using a Development Shell" section in the Yocto Project Development Tasks Manual for more information about using devshell.

6.31. devupstream.bbclass

The devupstream class uses BBCLASSEXTEND to add a variant of the recipe that fetches from an alternative URI (e.g. Git) instead of a tarball. Following is an example:

     BBCLASSEXTEND = "devupstream:target"
     SRC_URI_class-devupstream = "git://git.example.com/example"
     SRCREV_class-devupstream = "abcd1234"
        

Adding the above statements to your recipe creates a variant that has DEFAULT_PREFERENCE set to "-1". Consequently, you need to select the variant of the recipe to use it. Any development-specific adjustments can be done by using the class-devupstream override. Here is an example:

     DEPENDS_append_class-devupstream = " gperf-native"

     do_configure_prepend_class-devupstream() {
        touch ${S}/README
     }
        

The class currently only supports creating a development variant of the target recipe, not native or nativesdk variants.

The BBCLASSEXTEND syntax (i.e. devupstream:target) provides support for native and nativesdk variants. Consequently, this functionality can be added in a future release.

Support for other version control systems such as Subversion is limited due to BitBake's automatic fetch dependencies (e.g. subversion-native).

6.32. distro_features_check.bbclass

The distro_features_check class allows individual recipes to check for required and conflicting DISTRO_FEATURES.

This class provides support for the REQUIRED_DISTRO_FEATURES and CONFLICT_DISTRO_FEATURES variables. If any conditions specified in the recipe using the above variables are not met, the recipe will be skipped.

6.33. distrodata.bbclass

The distrodata class provides for automatic checking for upstream recipe updates. The class creates a comma-separated value (CSV) spreadsheet that contains information about the recipes. The information provides the do_distrodata and do_distro_check tasks, which do upstream checking and also verify if a package is used in multiple major distributions.

The class is not included by default. To use it, you must set the INHERIT variable:

     INHERIT+= "distrodata"
        

The distrodata class also provides the do_checkpkg task, which can be used against a simple recipe or against an image to get all its recipe information.

6.34. distutils*.bbclass

The distutils* classes support recipes for Python version 2.x extensions, which are simple. These recipes usually only need to point to the source's archive and then inherit the proper class. Building is split into two methods depending on which method the module authors used.

  • Extensions that use an Autotools-based build system require Autotools and the classes based on distutils in their recipes.

  • Extensions that use build systems based on distutils require the distutils class in their recipes.

  • Extensions that use build systems based on setuptools require the setuptools class in their recipes.

The distutils-common-base class is required by some of the distutils* classes to provide common Python2 support.

The distutils-tools class supports recipes for additional "distutils" tools.

6.35. distutils3*.bbclass

The distutils3* classes support recipes for Python version 3.x extensions, which are simple. These recipes usually only need to point to the source's archive and then inherit the proper class. Building is split into three methods depending on which method the module authors used.

  • Extensions that use an Autotools-based build system require Autotools and distutils-based classes in their recipes.

  • Extensions that use distutils-based build systems require the distutils class in their recipes.

  • Extensions that use build systems based on setuptools3 require the setuptools3 class in their recipes.

The distutils3* classes either inherit their corresponding distutils* class or replicate them using a Python3 version instead (e.g. distutils3-base inherits distutils-common-base, which is the same as distutils-base but inherits python3native instead of pythonnative).

6.36. externalsrc.bbclass

The externalsrc class supports building software from source code that is external to the OpenEmbedded build system. Building software from an external source tree means that the build system's normal fetch, unpack, and patch process is not used.

By default, the OpenEmbedded build system uses the S and B variables to locate unpacked recipe source code and to build it, respectively. When your recipe inherits the externalsrc class, you use the EXTERNALSRC and EXTERNALSRC_BUILD variables to ultimately define S and B.

By default, this class expects the source code to support recipe builds that use the B variable to point to the directory in which the OpenEmbedded build system places the generated objects built from the recipes. By default, the B directory is set to the following, which is separate from the source directory (S):

     ${WORKDIR}/${BPN}/{PV}/
        

See these variables for more information: WORKDIR, BPN, and PV,

For more information on the externalsrc class, see the comments in meta/classes/externalsrc.bbclass in the Source Directory. For information on how to use the externalsrc class, see the "Building Software from an External Source" section in the Yocto Project Development Tasks Manual.

6.37. extrausers.bbclass

The extrausers class allows additional user and group configuration to be applied at the image level. Inheriting this class either globally or from an image recipe allows additional user and group operations to be performed using the EXTRA_USERS_PARAMS variable.

Note

The user and group operations added using the extrausers class are not tied to a specific recipe outside of the recipe for the image. Thus, the operations can be performed across the image as a whole. Use the useradd class to add user and group configuration to a specific recipe.

Here is an example that uses this class in an image recipe:

     inherit extrausers
     EXTRA_USERS_PARAMS = "\
         useradd -p '' tester; \
         groupadd developers; \
         userdel nobody; \
         groupdel -g video; \
         groupmod -g 1020 developers; \
         usermod -s /bin/sh tester; \
         "
        

Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns passwords:

     inherit extrausers
     EXTRA_USERS_PARAMS = "\
         useradd -P tester01 tester-jim; \
         useradd -P tester01 tester-sue; \
         "
        

Finally, here is an example that sets the root password to "1876*18":

     inherit extrausers
     EXTRA_USERS_PARAMS = "\
         usermod -P 1876*18 root; \
         "
        

6.38. fontcache.bbclass

The fontcache class generates the proper post-install and post-remove (postinst and postrm) scriptlets for font packages. These scriptlets call fc-cache (part of Fontconfig) to add the fonts to the font information cache. Since the cache files are architecture-specific, fc-cache runs using QEMU if the postinst scriptlets need to be run on the build host during image creation.

If the fonts being installed are in packages other than the main package, set FONT_PACKAGES to specify the packages containing the fonts.

6.39. fs-uuid.bbclass

The fs-uuid class extracts UUID from ${ROOTFS}, which must have been built by the time that this function gets called. The fs-uuid class only works on ext file systems and depends on tune2fs.

6.40. gconf.bbclass

The gconf class provides common functionality for recipes that need to install GConf schemas. The schemas will be put into a separate package (${PN}-gconf) that is created automatically when this class is inherited. This package uses the appropriate post-install and post-remove (postinst/postrm) scriptlets to register and unregister the schemas in the target image.

6.41. gettext.bbclass

The gettext class provides support for building software that uses the GNU gettext internationalization and localization system. All recipes building software that use gettext should inherit this class.

6.42. gnome.bbclass

The gnome class supports recipes that build software from the GNOME stack. This class inherits the gnomebase, gtk-icon-cache, gconf and mime classes. The class also disables GObject introspection where applicable.

6.43. gnomebase.bbclass

The gnomebase class is the base class for recipes that build software from the GNOME stack. This class sets SRC_URI to download the source from the GNOME mirrors as well as extending FILES with the typical GNOME installation paths.

6.44. gobject-introspection.bbclass

Provides support for recipes building software that supports GObject introspection. This functionality is only enabled if the "gobject-introspection-data" feature is in DISTRO_FEATURES as well as "qemu-usermode" being in MACHINE_FEATURES.

Note

This functionality is backfilled by default and, if not applicable, should be disabled through DISTRO_FEATURES_BACKFILL_CONSIDERED or MACHINE_FEATURES_BACKFILL_CONSIDERED, respectively.

6.45. grub-efi.bbclass

The grub-efi class provides grub-efi-specific functions for building bootable images.

This class supports several variables:

  • INITRD: Indicates list of filesystem images to concatenate and use as an initial RAM disk (initrd) (optional).

  • ROOTFS: Indicates a filesystem image to include as the root filesystem (optional).

  • GRUB_GFXSERIAL: Set this to "1" to have graphics and serial in the boot menu.

  • LABELS: A list of targets for the automatic configuration.

  • APPEND: An override list of append strings for each LABEL.

  • GRUB_OPTS: Additional options to add to the configuration (optional). Options are delimited using semi-colon characters (;).

  • GRUB_TIMEOUT: Timeout before executing the default LABEL (optional).

6.46. gsettings.bbclass

The gsettings class provides common functionality for recipes that need to install GSettings (glib) schemas. The schemas are assumed to be part of the main package. Appropriate post-install and post-remove (postinst/postrm) scriptlets are added to register and unregister the schemas in the target image.

6.47. gtk-doc.bbclass

The gtk-doc class is a helper class to pull in the appropriate gtk-doc dependencies and disable gtk-doc.

6.48. gtk-icon-cache.bbclass

The gtk-icon-cache class generates the proper post-install and post-remove (postinst/postrm) scriptlets for packages that use GTK+ and install icons. These scriptlets call gtk-update-icon-cache to add the fonts to GTK+'s icon cache. Since the cache files are architecture-specific, gtk-update-icon-cache is run using QEMU if the postinst scriptlets need to be run on the build host during image creation.

6.49. gtk-immodules-cache.bbclass

The gtk-immodules-cache class generates the proper post-install and post-remove (postinst/postrm) scriptlets for packages that install GTK+ input method modules for virtual keyboards. These scriptlets call gtk-update-icon-cache to add the input method modules to the cache. Since the cache files are architecture-specific, gtk-update-icon-cache is run using QEMU if the postinst scriptlets need to be run on the build host during image creation.

If the input method modules being installed are in packages other than the main package, set GTKIMMODULES_PACKAGES to specify the packages containing the modules.

6.50. gzipnative.bbclass

The gzipnative class enables the use of different native versions of gzip and pigz rather than the versions of these tools from the build host.

6.51. icecc.bbclass

The icecc class supports Icecream, which facilitates taking compile jobs and distributing them among remote machines.

The class stages directories with symlinks from gcc and g++ to icecc, for both native and cross compilers. Depending on each configure or compile, the OpenEmbedded build system adds the directories at the head of the PATH list and then sets the ICECC_CXX and ICEC_CC variables, which are the paths to the g++ and gcc compilers, respectively.

For the cross compiler, the class creates a tar.gz file that contains the Yocto Project toolchain and sets ICECC_VERSION, which is the version of the cross-compiler used in the cross-development toolchain, accordingly.

The class handles all three different compile stages (i.e native ,cross-kernel and target) and creates the necessary environment tar.gz file to be used by the remote machines. The class also supports SDK generation.

If ICECC_PATH is not set in your local.conf file, then the class tries to locate the icecc binary using which. If ICECC_ENV_EXEC is set in your local.conf file, the variable should point to the icecc-create-env script provided by the user. If you do not point to a user-provided script, the build system uses the default script provided by the recipe icecc-create-env-native.bb.

Note

This script is a modified version and not the one that comes with icecc.

If you do not want the Icecream distributed compile support to apply to specific recipes or classes, you can effectively "blacklist" them by listing the recipes and classes using the ICECC_USER_PACKAGE_BL and ICECC_USER_CLASS_BL, variables, respectively, in your local.conf file. Doing so causes the OpenEmbedded build system to handle these compilations locally.

Additionally, you can list recipes using the ICECC_USER_PACKAGE_WL variable in your local.conf file to force icecc to be enabled for recipes using an empty PARALLEL_MAKE variable.

Inheriting the icecc class changes all sstate signatures. Consequently, if a development team has a dedicated build system that populates STATE_MIRRORS and they want to reuse sstate from STATE_MIRRORS, then all developers and the build system need to either inherit the icecc class or nobody should.

At the distribution level, you can inherit the icecc class to be sure that all builders start with the same sstate signatures. After inheriting the class, you can then disable the feature by setting the ICECC_DISABLED variable to "1" as follows:

     INHERIT_DISTRO_append = " icecc"
     ICECC_DISABLED ??= "1"
        

This practice makes sure everyone is using the same signatures but also requires individuals that do want to use Icecream to enable the feature individually as follows in your local.conf file:

     ICECC_DISABLED = ""
        

6.52. image.bbclass

The image class helps support creating images in different formats. First, the root filesystem is created from packages using one of the rootfs*.bbclass files (depending on the package format used) and then one or more image files are created.

  • The IMAGE_FSTYPES variable controls the types of images to generate.

  • The IMAGE_INSTALL variable controls the list of packages to install into the image.

For information on customizing images, see the "Customizing Images" section in the Yocto Project Development Tasks Manual. For information on how images are created, see the "Images" section in the Yocto Project Overview and Concpets Manual.

6.53. image-buildinfo.bbclass

The image-buildinfo class writes information to the target filesystem on /etc/build.

6.54. image_types.bbclass

The image_types class defines all of the standard image output types that you can enable through the IMAGE_FSTYPES variable. You can use this class as a reference on how to add support for custom image output types.

By default, the image class automatically enables the image_types class. The image class uses the IMGCLASSES variable as follows:

     IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
     IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
     IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}"
     IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}"
     IMGCLASSES += "image_types_wic"
     IMGCLASSES += "rootfs-postcommands"
     IMGCLASSES += "image-postinst-intercepts"
     inherit ${IMGCLASSES}
        

The image_types class also handles conversion and compression of images.

Note

To build a VMware VMDK image, you need to add "wic.vmdk" to IMAGE_FSTYPES. This would also be similar for Virtual Box Virtual Disk Image ("vdi") and QEMU Copy On Write Version 2 ("qcow2") images.

6.55. image-live.bbclass

This class controls building "live" (i.e. HDDIMG and ISO) images. Live images contain syslinux for legacy booting, as well as the bootloader specified by EFI_PROVIDER if MACHINE_FEATURES contains "efi".

Normally, you do not use this class directly. Instead, you add "live" to IMAGE_FSTYPES.

6.56. image-mklibs.bbclass

The image-mklibs class enables the use of the mklibs utility during the do_rootfs task, which optimizes the size of libraries contained in the image.

By default, the class is enabled in the local.conf.template using the USER_CLASSES variable as follows:

     USER_CLASSES ?= "buildstats image-mklibs image-prelink"
        

The image-prelink class enables the use of the prelink utility during the do_rootfs task, which optimizes the dynamic linking of shared libraries to reduce executable startup time.

By default, the class is enabled in the local.conf.template using the USER_CLASSES variable as follows:

     USER_CLASSES ?= "buildstats image-mklibs image-prelink"
        

6.58. insane.bbclass

The insane class adds a step to the package generation process so that output quality assurance checks are generated by the OpenEmbedded build system. A range of checks are performed that check the build's output for common problems that show up during runtime. Distribution policy usually dictates whether to include this class.

You can configure the sanity checks so that specific test failures either raise a warning or an error message. Typically, failures for new tests generate a warning. Subsequent failures for the same test would then generate an error message once the metadata is in a known and good condition. See the "QA Error and Warning Messages" Chapter for a list of all the warning and error messages you might encounter using a default configuration.

Use the WARN_QA and ERROR_QA variables to control the behavior of these checks at the global level (i.e. in your custom distro configuration). However, to skip one or more checks in recipes, you should use INSANE_SKIP. For example, to skip the check for symbolic link .so files in the main package of a recipe, add the following to the recipe. You need to realize that the package name override, in this example ${PN}, must be used:

     INSANE_SKIP_${PN} += "dev-so"
        

Please keep in mind that the QA checks exist in order to detect real or potential problems in the packaged output. So exercise caution when disabling these checks.

The following list shows the tests you can list with the WARN_QA and ERROR_QA variables:

  • already-stripped: Checks that produced binaries have not already been stripped prior to the build system extracting debug symbols. It is common for upstream software projects to default to stripping debug symbols for output binaries. In order for debugging to work on the target using -dbg packages, this stripping must be disabled.

  • arch: Checks the Executable and Linkable Format (ELF) type, bit size, and endianness of any binaries to ensure they match the target architecture. This test fails if any binaries do not match the type since there would be an incompatibility. The test could indicate that the wrong compiler or compiler options have been used. Sometimes software, like bootloaders, might need to bypass this check.

  • buildpaths: Checks for paths to locations on the build host inside the output files. Currently, this test triggers too many false positives and thus is not normally enabled.

  • build-deps: Determines if a build-time dependency that is specified through DEPENDS, explicit RDEPENDS, or task-level dependencies exists to match any runtime dependency. This determination is particularly useful to discover where runtime dependencies are detected and added during packaging. If no explicit dependency has been specified within the metadata, at the packaging stage it is too late to ensure that the dependency is built, and thus you can end up with an error when the package is installed into the image during the do_rootfs task because the auto-detected dependency was not satisfied. An example of this would be where the update-rc.d class automatically adds a dependency on the initscripts-functions package to packages that install an initscript that refers to /etc/init.d/functions. The recipe should really have an explicit RDEPENDS for the package in question on initscripts-functions so that the OpenEmbedded build system is able to ensure that the initscripts recipe is actually built and thus the initscripts-functions package is made available.

  • compile-host-path: Checks the do_compile log for indications that paths to locations on the build host were used. Using such paths might result in host contamination of the build output.

  • debug-deps: Checks that all packages except -dbg packages do not depend on -dbg packages, which would cause a packaging bug.

  • debug-files: Checks for .debug directories in anything but the -dbg package. The debug files should all be in the -dbg package. Thus, anything packaged elsewhere is incorrect packaging.

  • dep-cmp: Checks for invalid version comparison statements in runtime dependency relationships between packages (i.e. in RDEPENDS, RRECOMMENDS, RSUGGESTS, RPROVIDES, RREPLACES, and RCONFLICTS variable values). Any invalid comparisons might trigger failures or undesirable behavior when passed to the package manager.

  • desktop: Runs the desktop-file-validate program against any .desktop files to validate their contents against the specification for .desktop files.

  • dev-deps: Checks that all packages except -dev or -staticdev packages do not depend on -dev packages, which would be a packaging bug.

  • dev-so: Checks that the .so symbolic links are in the -dev package and not in any of the other packages. In general, these symlinks are only useful for development purposes. Thus, the -dev package is the correct location for them. Some very rare cases do exist for dynamically loaded modules where these symlinks are needed instead in the main package.

  • file-rdeps: Checks that file-level dependencies identified by the OpenEmbedded build system at packaging time are satisfied. For example, a shell script might start with the line #!/bin/bash. This line would translate to a file dependency on /bin/bash. Of the three package managers that the OpenEmbedded build system supports, only RPM directly handles file-level dependencies, resolving them automatically to packages providing the files. However, the lack of that functionality in the other two package managers does not mean the dependencies do not still need resolving. This QA check attempts to ensure that explicitly declared RDEPENDS exist to handle any file-level dependency detected in packaged files.

  • files-invalid: Checks for FILES variable values that contain "//", which is invalid.

  • host-user-contaminated: Checks that no package produced by the recipe contains any files outside of /home with a user or group ID that matches the user running BitBake. A match usually indicates that the files are being installed with an incorrect UID/GID, since target IDs are independent from host IDs. For additional information, see the section describing the do_install task.

  • incompatible-license: Report when packages are excluded from being created due to being marked with a license that is in INCOMPATIBLE_LICENSE.

  • install-host-path: Checks the do_install log for indications that paths to locations on the build host were used. Using such paths might result in host contamination of the build output.

  • installed-vs-shipped: Reports when files have been installed within do_install but have not been included in any package by way of the FILES variable. Files that do not appear in any package cannot be present in an image later on in the build process. Ideally, all installed files should be packaged or not installed at all. These files can be deleted at the end of do_install if the files are not needed in any package.

  • invalid-chars: Checks that the recipe metadata variables DESCRIPTION, SUMMARY, LICENSE, and SECTION do not contain non-UTF-8 characters. Some package managers do not support such characters.

  • invalid-packageconfig: Checks that no undefined features are being added to PACKAGECONFIG. For example, any name "foo" for which the following form does not exist:

         PACKAGECONFIG[foo] = "..."
                    

  • la: Checks .la files for any TMPDIR paths. Any .la file containing these paths is incorrect since libtool adds the correct sysroot prefix when using the files automatically itself.

  • ldflags: Ensures that the binaries were linked with the LDFLAGS options provided by the build system. If this test fails, check that the LDFLAGS variable is being passed to the linker command.

  • libdir: Checks for libraries being installed into incorrect (possibly hardcoded) installation paths. For example, this test will catch recipes that install /lib/bar.so when ${base_libdir} is "lib32". Another example is when recipes install /usr/lib64/foo.so when ${libdir} is "/usr/lib".

  • libexec: Checks if a package contains files in /usr/libexec. This check is not performed if the libexecdir variable has been set explicitly to /usr/libexec.

  • packages-list: Checks for the same package being listed multiple times through the PACKAGES variable value. Installing the package in this manner can cause errors during packaging.

  • perm-config: Reports lines in fs-perms.txt that have an invalid format.

  • perm-line: Reports lines in fs-perms.txt that have an invalid format.

  • perm-link: Reports lines in fs-perms.txt that specify 'link' where the specified target already exists.

  • perms: Currently, this check is unused but reserved.

  • pkgconfig: Checks .pc files for any TMPDIR/WORKDIR paths. Any .pc file containing these paths is incorrect since pkg-config itself adds the correct sysroot prefix when the files are accessed.

  • pkgname: Checks that all packages in PACKAGES have names that do not contain invalid characters (i.e. characters other than 0-9, a-z, ., +, and -).

  • pkgv-undefined: Checks to see if the PKGV variable is undefined during do_package.

  • pkgvarcheck: Checks through the variables RDEPENDS, RRECOMMENDS, RSUGGESTS, RCONFLICTS, RPROVIDES, RREPLACES, FILES, ALLOW_EMPTY, pkg_preinst, pkg_postinst, pkg_prerm and pkg_postrm, and reports if there are variable sets that are not package-specific. Using these variables without a package suffix is bad practice, and might unnecessarily complicate dependencies of other packages within the same recipe or have other unintended consequences.

  • pn-overrides: Checks that a recipe does not have a name (PN) value that appears in OVERRIDES. If a recipe is named such that its PN value matches something already in OVERRIDES (e.g. PN happens to be the same as MACHINE or DISTRO), it can have unexpected consequences. For example, assignments such as FILES_${PN} = "xyz" effectively turn into FILES = "xyz".

  • rpaths: Checks for rpaths in the binaries that contain build system paths such as TMPDIR. If this test fails, bad -rpath options are being passed to the linker commands and your binaries have potential security issues.

  • split-strip: Reports that splitting or stripping debug symbols from binaries has failed.

  • staticdev: Checks for static library files (*.a) in non-staticdev packages.

  • symlink-to-sysroot: Checks for symlinks in packages that point into TMPDIR on the host. Such symlinks will work on the host, but are clearly invalid when running on the target.

  • textrel: Checks for ELF binaries that contain relocations in their .text sections, which can result in a performance impact at runtime. See the explanation for the ELF binary message for more information regarding runtime performance issues.

  • useless-rpaths: Checks for dynamic library load paths (rpaths) in the binaries that by default on a standard system are searched by the linker (e.g. /lib and /usr/lib). While these paths will not cause any breakage, they do waste space and are unnecessary.

  • var-undefined: Reports when variables fundamental to packaging (i.e. WORKDIR, DEPLOY_DIR, D, PN, and PKGD) are undefined during do_package.

  • version-going-backwards: If Build History is enabled, reports when a package being written out has a lower version than the previously written package under the same name. If you are placing output packages into a feed and upgrading packages on a target system using that feed, the version of a package going backwards can result in the target system not correctly upgrading to the "new" version of the package.

    Note

    If you are not using runtime package management on your target system, then you do not need to worry about this situation.

  • xorg-driver-abi: Checks that all packages containing Xorg drivers have ABI dependencies. The xserver-xorg recipe provides driver ABI names. All drivers should depend on the ABI versions that they have been built against. Driver recipes that include xorg-driver-input.inc or xorg-driver-video.inc will automatically get these versions. Consequently, you should only need to explicitly add dependencies to binary driver recipes.

6.59. insserv.bbclass

The insserv class uses the insserv utility to update the order of symbolic links in /etc/rc?.d/ within an image based on dependencies specified by LSB headers in the init.d scripts themselves.

6.60. kernel.bbclass

The kernel class handles building Linux kernels. The class contains code to build all kernel trees. All needed headers are staged into the STAGING_KERNEL_DIR directory to allow out-of-tree module builds using the module class.

This means that each built kernel module is packaged separately and inter-module dependencies are created by parsing the modinfo output. If all modules are required, then installing the kernel-modules package installs all packages with modules and various other kernel packages such as kernel-vmlinux.

The kernel class contains logic that allows you to embed an initial RAM filesystem (initramfs) image when you build the kernel image. For information on how to build an initramfs, see the "Building an Initial RAM Filesystem (initramfs) Image" section in the Yocto Project Development Tasks Manual.

Various other classes are used by the kernel and module classes internally including the kernel-arch, module-base, and linux-kernel-base classes.

6.61. kernel-arch.bbclass

The kernel-arch class sets the ARCH environment variable for Linux kernel compilation (including modules).

6.62. kernel-devicetree.bbclass

The kernel-devicetree class, which is inherited by the kernel class, supports device tree generation.

6.63. kernel-fitimage.bbclass

The kernel-fitimage class provides support to pack zImages.

6.64. kernel-grub.bbclass

The kernel-grub class updates the boot area and the boot menu with the kernel as the priority boot mechanism while installing a RPM to update the kernel on a deployed target.

6.65. kernel-module-split.bbclass

The kernel-module-split class provides common functionality for splitting Linux kernel modules into separate packages.

6.66. kernel-uboot.bbclass

The kernel-uboot class provides support for building from vmlinux-style kernel sources.

6.67. kernel-uimage.bbclass

The kernel-uimage class provides support to pack uImage.

6.68. kernel-yocto.bbclass

The kernel-yocto class provides common functionality for building from linux-yocto style kernel source repositories.

6.69. kernelsrc.bbclass

The kernelsrc class sets the Linux kernel source and version.

6.70. lib_package.bbclass

The lib_package class supports recipes that build libraries and produce executable binaries, where those binaries should not be installed by default along with the library. Instead, the binaries are added to a separate ${PN}-bin package to make their installation optional.

6.71. libc*.bbclass

The libc* classes support recipes that build packages with libc:

  • The libc-common class provides common support for building with libc.

  • The libc-package class supports packaging up glibc and eglibc.

6.72. license.bbclass

The license class provides license manifest creation and license exclusion. This class is enabled by default using the default value for the INHERIT_DISTRO variable.

6.73. linux-kernel-base.bbclass

The linux-kernel-base class provides common functionality for recipes that build out of the Linux kernel source tree. These builds goes beyond the kernel itself. For example, the Perf recipe also inherits this class.

6.74. linuxloader.bbclass

Provides the function linuxloader(), which gives the value of the dynamic loader/linker provided on the platform. This value is used by a number of other classes.

6.75. logging.bbclass

The logging class provides the standard shell functions used to log messages for various BitBake severity levels (i.e. bbplain, bbnote, bbwarn, bberror, bbfatal, and bbdebug).

This class is enabled by default since it is inherited by the base class.

6.76. meta.bbclass

The meta class is inherited by recipes that do not build any output packages themselves, but act as a "meta" target for building other recipes.

6.77. metadata_scm.bbclass

The metadata_scm class provides functionality for querying the branch and revision of a Source Code Manager (SCM) repository.

The base class uses this class to print the revisions of each layer before starting every build. The metadata_scm class is enabled by default because it is inherited by the base class.

6.78. migrate_localcount.bbclass

The migrate_localcount class verifies a recipe's localcount data and increments it appropriately.

6.79. mime.bbclass

The mime class generates the proper post-install and post-remove (postinst/postrm) scriptlets for packages that install MIME type files. These scriptlets call update-mime-database to add the MIME types to the shared database.

6.80. mirrors.bbclass

The mirrors class sets up some standard MIRRORS entries for source code mirrors. These mirrors provide a fall-back path in case the upstream source specified in SRC_URI within recipes is unavailable.

This class is enabled by default since it is inherited by the base class.

6.81. module.bbclass

The module class provides support for building out-of-tree Linux kernel modules. The class inherits the module-base and kernel-module-split classes, and implements the do_compile and do_install tasks. The class provides everything needed to build and package a kernel module.

For general information on out-of-tree Linux kernel modules, see the "Incorporating Out-of-Tree Modules" section in the Yocto Project Linux Kernel Development Manual.

6.82. module-base.bbclass

The module-base class provides the base functionality for building Linux kernel modules. Typically, a recipe that builds software that includes one or more kernel modules and has its own means of building the module inherits this class as opposed to inheriting the module class.

6.83. multilib*.bbclass

The multilib* classes provide support for building libraries with different target optimizations or target architectures and installing them side-by-side in the same image.

For more information on using the Multilib feature, see the "Combining Multiple Versions of Library Files into One Image" section in the Yocto Project Development Tasks Manual.

6.84. native.bbclass

The native class provides common functionality for recipes that build tools to run on the build host (i.e. tools that use the compiler or other tools from the build host).

You can create a recipe that builds tools that run natively on the host a couple different ways:

  • Create a myrecipe-native.bb recipe that inherits the native class. If you use this method, you must order the inherit statement in the recipe after all other inherit statements so that the native class is inherited last.

    Warning

    When creating a recipe this way, the recipe name must follow this naming convention:
         myrecipe-native.bb
                        
    Not using this naming convention can lead to subtle problems caused by existing code that depends on that naming convention.

  • Create or modify a target recipe that contains the following:

         BBCLASSEXTEND = "native"
                    

    Inside the recipe, use _class-native and _class-target overrides to specify any functionality specific to the respective native or target case.

Although applied differently, the native class is used with both methods. The advantage of the second method is that you do not need to have two separate recipes (assuming you need both) for native and target. All common parts of the recipe are automatically shared.

6.85. nativesdk.bbclass

The nativesdk class provides common functionality for recipes that wish to build tools to run as part of an SDK (i.e. tools that run on SDKMACHINE).

You can create a recipe that builds tools that run on the SDK machine a couple different ways:

  • Create a nativesdk-myrecipe.bb recipe that inherits the nativesdk class. If you use this method, you must order the inherit statement in the recipe after all other inherit statements so that the nativesdk class is inherited last.

  • Create a nativesdk variant of any recipe by adding the following:

         BBCLASSEXTEND = "nativesdk"
                    

    Inside the recipe, use _class-nativesdk and _class-target overrides to specify any functionality specific to the respective SDK machine or target case.

Warning

When creating a recipe, you must follow this naming convention:
     nativesdk-myrecipe.bb
            
Not doing so can lead to subtle problems because code exists that depends on the naming convention.

Although applied differently, the nativesdk class is used with both methods. The advantage of the second method is that you do not need to have two separate recipes (assuming you need both) for the SDK machine and the target. All common parts of the recipe are automatically shared.

6.86. nopackages.bbclass

Disables packaging tasks for those recipes and classes where packaging is not needed.

6.87. npm.bbclass

Provides support for building Node.js software fetched using the npm package manager.

Note

Currently, recipes inheriting this class must use the npm:// fetcher to have dependencies fetched and packaged automatically.

6.88. oelint.bbclass

The oelint class is an obsolete lint checking tool that exists in meta/classes in the Source Directory.

A number of classes exist that could be generally useful in OE-Core but are never actually used within OE-Core itself. The oelint class is one such example. However, being aware of this class can reduce the proliferation of different versions of similar classes across multiple layers.

6.89. own-mirrors.bbclass

The own-mirrors class makes it easier to set up your own PREMIRRORS from which to first fetch source before attempting to fetch it from the upstream specified in SRC_URI within each recipe.

To use this class, inherit it globally and specify SOURCE_MIRROR_URL. Here is an example:

     INHERIT += "own-mirrors"
     SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
        

You can specify only a single URL in SOURCE_MIRROR_URL.

6.90. package.bbclass

The package class supports generating packages from a build's output. The core generic functionality is in package.bbclass. The code specific to particular package types resides in these package-specific classes: package_deb, package_rpm, package_ipk, and package_tar.

Warning

The package_tar class is broken and not supported. It is recommended that you do not use this class.

You can control the list of resulting package formats by using the PACKAGE_CLASSES variable defined in your conf/local.conf configuration file, which is located in the Build Directory. When defining the variable, you can specify one or more package types. Since images are generated from packages, a packaging class is needed to enable image generation. The first class listed in this variable is used for image generation.

If you take the optional step to set up a repository (package feed) on the development host that can be used by DNF, you can install packages from the feed while you are running the image on the target (i.e. runtime installation of packages). For more information, see the "Using Runtime Package Management" section in the Yocto Project Development Tasks Manual.

The package-specific class you choose can affect build-time performance and has space ramifications. In general, building a package with IPK takes about thirty percent less time as compared to using RPM to build the same or similar package. This comparison takes into account a complete build of the package with all dependencies previously built. The reason for this discrepancy is because the RPM package manager creates and processes more Metadata than the IPK package manager. Consequently, you might consider setting PACKAGE_CLASSES to "package_ipk" if you are building smaller systems.

Before making your package manager decision, however, you should consider some further things about using RPM:

  • RPM starts to provide more abilities than IPK due to the fact that it processes more Metadata. For example, this information includes individual file types, file checksum generation and evaluation on install, sparse file support, conflict detection and resolution for Multilib systems, ACID style upgrade, and repackaging abilities for rollbacks.

  • For smaller systems, the extra space used for the Berkeley Database and the amount of metadata when using RPM can affect your ability to perform on-device upgrades.

You can find additional information on the effects of the package class at these two Yocto Project mailing list links:

6.91. package_deb.bbclass

The package_deb class provides support for creating packages that use the Debian (i.e. .deb) file format. The class ensures the packages are written out in a .deb file format to the ${DEPLOY_DIR_DEB} directory.

This class inherits the package class and is enabled through the PACKAGE_CLASSES variable in the local.conf file.

6.92. package_ipk.bbclass

The package_ipk class provides support for creating packages that use the IPK (i.e. .ipk) file format. The class ensures the packages are written out in a .ipk file format to the ${DEPLOY_DIR_IPK} directory.

This class inherits the package class and is enabled through the PACKAGE_CLASSES variable in the local.conf file.

6.93. package_rpm.bbclass

The package_rpm class provides support for creating packages that use the RPM (i.e. .rpm) file format. The class ensures the packages are written out in a .rpm file format to the ${DEPLOY_DIR_RPM} directory.

This class inherits the package class and is enabled through the PACKAGE_CLASSES variable in the local.conf file.

6.94. package_tar.bbclass

The package_tar class provides support for creating tarballs. The class ensures the packages are written out in a tarball format to the ${DEPLOY_DIR_TAR} directory.

This class inherits the package class and is enabled through the PACKAGE_CLASSES variable in the local.conf file.

Note

You cannot specify the package_tar class first using the PACKAGE_CLASSES variable. You must use .deb, .ipk, or .rpm file formats for your image or SDK.

6.95. packagedata.bbclass

The packagedata class provides common functionality for reading pkgdata files found in PKGDATA_DIR. These files contain information about each output package produced by the OpenEmbedded build system.

This class is enabled by default because it is inherited by the package class.

6.96. packagegroup.bbclass

The packagegroup class sets default values appropriate for package group recipes (e.g. PACKAGES, PACKAGE_ARCH, ALLOW_EMPTY, and so forth). It is highly recommended that all package group recipes inherit this class.

For information on how to use this class, see the "Customizing Images Using Custom Package Groups" section in the Yocto Project Development Tasks Manual.

Previously, this class was called the task class.

6.97. patch.bbclass

The patch class provides all functionality for applying patches during the do_patch task.

This class is enabled by default because it is inherited by the base class.

6.98. perlnative.bbclass

When inherited by a recipe, the perlnative class supports using the native version of Perl built by the build system rather than using the version provided by the build host.

6.99. pixbufcache.bbclass

The pixbufcache class generates the proper post-install and post-remove (postinst/postrm) scriptlets for packages that install pixbuf loaders, which are used with gdk-pixbuf. These scriptlets call update_pixbuf_cache to add the pixbuf loaders to the cache. Since the cache files are architecture-specific, update_pixbuf_cache is run using QEMU if the postinst scriptlets need to be run on the build host during image creation.

If the pixbuf loaders being installed are in packages other than the recipe's main package, set PIXBUF_PACKAGES to specify the packages containing the loaders.

6.100. pkgconfig.bbclass

The pkgconfig class provides a standard way to get header and library information by using pkg-config. This class aims to smooth integration of pkg-config into libraries that use it.

During staging, BitBake installs pkg-config data into the sysroots/ directory. By making use of sysroot functionality within pkg-config, the pkgconfig class no longer has to manipulate the files.

6.101. populate_sdk.bbclass

The populate_sdk class provides support for SDK-only recipes. For information on advantages gained when building a cross-development toolchain using the do_populate_sdk task, see the "Building an SDK Installer" section in the Yocto Project Application Development and the Extensible Software Development Kit (eSDK) manual.

6.102. populate_sdk_*.bbclass

The populate_sdk_* classes support SDK creation and consist of the following classes:

  • populate_sdk_base: The base class supporting SDK creation under all package managers (i.e. DEB, RPM, and opkg).

  • populate_sdk_deb: Supports creation of the SDK given the Debian package manager.

  • populate_sdk_rpm: Supports creation of the SDK given the RPM package manager.

  • populate_sdk_ipk: Supports creation of the SDK given the opkg (IPK format) package manager.

  • populate_sdk_ext: Supports extensible SDK creation under all package managers.

The populate_sdk_base class inherits the appropriate populate_sdk_* (i.e. deb, rpm, and ipk) based on IMAGE_PKGTYPE.

The base class ensures all source and destination directories are established and then populates the SDK. After populating the SDK, the populate_sdk_base class constructs two sysroots: ${SDK_ARCH}-nativesdk, which contains the cross-compiler and associated tooling, and the target, which contains a target root filesystem that is configured for the SDK usage. These two images reside in SDK_OUTPUT, which consists of the following:

     ${SDK_OUTPUT}/${SDK_ARCH}-nativesdk-pkgs
     ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/target-pkgs
        

Finally, the base populate SDK class creates the toolchain environment setup script, the tarball of the SDK, and the installer.

The respective populate_sdk_deb, populate_sdk_rpm, and populate_sdk_ipk classes each support the specific type of SDK. These classes are inherited by and used with the populate_sdk_base class.

For more information on the cross-development toolchain generation, see the "Cross-Development Toolchain Generation" section in the Yocto Project Overview and Concepts Manual. For information on advantages gained when building a cross-development toolchain using the do_populate_sdk task, see the "Building an SDK Installer" section in the Yocto Project Application Development and the Extensible Software Development Kit (eSDK) manual.

6.103. prexport.bbclass

The prexport class provides functionality for exporting PR values.

Note

This class is not intended to be used directly. Rather, it is enabled when using "bitbake-prserv-tool export".

6.104. primport.bbclass

The primport class provides functionality for importing PR values.

Note

This class is not intended to be used directly. Rather, it is enabled when using "bitbake-prserv-tool import".

6.105. prserv.bbclass

The prserv class provides functionality for using a PR service in order to automatically manage the incrementing of the PR variable for each recipe.

This class is enabled by default because it is inherited by the package class. However, the OpenEmbedded build system will not enable the functionality of this class unless PRSERV_HOST has been set.

6.106. ptest.bbclass

The ptest class provides functionality for packaging and installing runtime tests for recipes that build software that provides these tests.

This class is intended to be inherited by individual recipes. However, the class' functionality is largely disabled unless "ptest" appears in DISTRO_FEATURES. See the "Testing Packages With ptest" section in the Yocto Project Development Tasks Manual for more information on ptest.

6.107. ptest-gnome.bbclass

Enables package tests (ptests) specifically for GNOME packages, which have tests intended to be executed with gnome-desktop-testing.

For information on setting up and running ptests, see the "Testing Packages With ptest" section in the Yocto Project Development Tasks Manual.

6.108. python-dir.bbclass

The python-dir class provides the base version, location, and site package location for Python.

6.109. python3native.bbclass

The python3native class supports using the native version of Python 3 built by the build system rather than support of the version provided by the build host.

6.110. pythonnative.bbclass

When inherited by a recipe, the pythonnative class supports using the native version of Python built by the build system rather than using the version provided by the build host.

6.111. qemu.bbclass

The qemu class provides functionality for recipes that either need QEMU or test for the existence of QEMU. Typically, this class is used to run programs for a target system on the build host using QEMU's application emulation mode.

6.112. recipe_sanity.bbclass

The recipe_sanity class checks for the presence of any host system recipe prerequisites that might affect the build (e.g. variables that are set or software that is present).

6.113. relocatable.bbclass

The relocatable class enables relocation of binaries when they are installed into the sysroot.

This class makes use of the chrpath class and is used by both the cross and native classes.

6.114. remove-libtool.bbclass

The remove-libtool class adds a post function to the do_install task to remove all .la files installed by libtool. Removing these files results in them being absent from both the sysroot and target packages.

If a recipe needs the .la files to be installed, then the recipe can override the removal by setting REMOVE_LIBTOOL_LA to "0" as follows:

     REMOVE_LIBTOOL_LA = "0"
        

Note

The remove-libtool class is not enabled by default.

6.115. report-error.bbclass

The report-error class supports enabling the error reporting tool, which allows you to submit build error information to a central database.

The class collects debug information for recipe, recipe version, task, machine, distro, build system, target system, host distro, branch, commit, and log. From the information, report files using a JSON format are created and stored in ${LOG_DIR}/error-report.

6.116. rm_work.bbclass

The rm_work class supports deletion of temporary workspace, which can ease your hard drive demands during builds.

The OpenEmbedded build system can use a substantial amount of disk space during the build process. A portion of this space is the work files under the ${TMPDIR}/work directory for each recipe. Once the build system generates the packages for a recipe, the work files for that recipe are no longer needed. However, by default, the build system preserves these files for inspection and possible debugging purposes. If you would rather have these files deleted to save disk space as the build progresses, you can enable rm_work by adding the following to your local.conf file, which is found in the Build Directory.

    INHERIT += "rm_work"
        

If you are modifying and building source code out of the work directory for a recipe, enabling rm_work will potentially result in your changes to the source being lost. To exclude some recipes from having their work directories deleted by rm_work, you can add the names of the recipe or recipes you are working on to the RM_WORK_EXCLUDE variable, which can also be set in your local.conf file. Here is an example:

    RM_WORK_EXCLUDE += "busybox glibc"
        

6.117. rootfs*.bbclass

The rootfs* classes support creating the root filesystem for an image and consist of the following classes:

  • The rootfs-postcommands class, which defines filesystem post-processing functions for image recipes.

  • The rootfs_deb class, which supports creation of root filesystems for images built using .deb packages.

  • The rootfs_rpm class, which supports creation of root filesystems for images built using .rpm packages.

  • The rootfs_ipk class, which supports creation of root filesystems for images built using .ipk packages.

  • The rootfsdebugfiles class, which installs additional files found on the build host directly into the root filesystem.

The root filesystem is created from packages using one of the rootfs*.bbclass files as determined by the PACKAGE_CLASSES variable.

For information on how root filesystem images are created, see the "Image Generation" section in the Yocto Project Overview and Concepts Manual.

6.118. sanity.bbclass

The sanity class checks to see if prerequisite software is present on the host system so that users can be notified of potential problems that might affect their build. The class also performs basic user configuration checks from the local.conf configuration file to prevent common mistakes that cause build failures. Distribution policy usually determines whether to include this class.

6.119. scons.bbclass

The scons class supports recipes that need to build software that uses the SCons build system. You can use the EXTRA_OESCONS variable to specify additional configuration options you want to pass SCons command line.

6.120. sdl.bbclass

The sdl class supports recipes that need to build software that uses the Simple DirectMedia Layer (SDL) library.

6.121. setuptools.bbclass

The setuptools class supports Python version 2.x extensions that use build systems based on setuptools. If your recipe uses these build systems, the recipe needs to inherit the setuptools class.

6.122. setuptools3.bbclass

The setuptools3 class supports Python version 3.x extensions that use build systems based on setuptools3. If your recipe uses these build systems, the recipe needs to inherit the setuptools3 class.

6.123. sign_rpm.bbclass

The sign_rpm class supports generating signed RPM packages.

6.124. sip.bbclass

The sip class supports recipes that build or package SIP-based Python bindings.

6.125. siteconfig.bbclass

The siteconfig class provides functionality for handling site configuration. The class is used by the autotools class to accelerate the do_configure task.

6.126. siteinfo.bbclass

The siteinfo class provides information about the targets that might be needed by other classes or recipes.

As an example, consider Autotools, which can require tests that must execute on the target hardware. Since this is not possible in general when cross compiling, site information is used to provide cached test results so these tests can be skipped over but still make the correct values available. The meta/site directory contains test results sorted into different categories such as architecture, endianness, and the libc used. Site information provides a list of files containing data relevant to the current build in the CONFIG_SITE variable that Autotools automatically picks up.

The class also provides variables like SITEINFO_ENDIANNESS and SITEINFO_BITS that can be used elsewhere in the metadata.

6.127. spdx.bbclass

The spdx class integrates real-time license scanning, generation of SPDX standard output, and verification of license information during the build.

Note

This class is currently at the prototype stage in the 1.6 release.

6.128. sstate.bbclass

The sstate class provides support for Shared State (sstate). By default, the class is enabled through the INHERIT_DISTRO variable's default value.

For more information on sstate, see the "Shared State Cache" section in the Yocto Project Overview and Concepts Manual.

6.129. staging.bbclass

The staging class installs files into individual recipe work directories for sysroots. The class contains the following key tasks:

  • The do_populate_sysroot task, which is responsible for handing the files that end up in the recipe sysroots.

  • The do_prepare_recipe_sysroot task (a "partner" task to the populate_sysroot task), which installs the files into the individual recipe work directories (i.e. WORKDIR).

The code in the staging class is complex and basically works in two stages:

  • Stage One: The first stage addresses recipes that have files they want to share with other recipes that have dependencies on the originating recipe. Normally these dependencies are installed through the do_install task into ${D}. The do_populate_sysroot task copies a subset of these files into ${SYSROOT_DESTDIR}. This subset of files is controlled by the SYSROOT_DIRS, SYSROOT_DIRS_NATIVE, and SYSROOT_DIRS_BLACKLIST variables.

    Note

    Additionally, a recipe can customize the files further by declaring a processing function in the SYSROOT_PREPROCESS_FUNCS variable.

    A shared state (sstate) object is built from these files and the files are placed into a subdirectory of tmp/sysroots-components/. The files are scanned for hardcoded paths to the original installation location. If the location is found in text files, the hardcoded locations are replaced by tokens and a list of the files needing such replacements is created. These adjustments are referred to as "FIXMEs". The list of files that are scanned for paths is controlled by the SSTATE_SCAN_FILES variable.

  • Stage Two: The second stage addresses recipes that want to use something from another recipe and declare a dependency on that recipe through the DEPENDS variable. The recipe will have a do_prepare_recipe_sysroot task and when this task executes, it creates the recipe-sysroot and recipe-sysroot-native in the recipe work directory (i.e. WORKDIR). The OpenEmbedded build system creates hard links to copies of the relevant files from sysroots-components into the recipe work directory.

    Note

    If hard links are not possible, the build system uses actual copies.

    The build system then addresses any "FIXMEs" to paths as defined from the list created in the first stage.

    Finally, any files in ${bindir} within the sysroot that have the prefix "postinst-" are executed.

    Note

    Although such sysroot post installation scripts are not recommended for general use, the files do allow some issues such as user creation and module indexes to be addressed.

    Because recipes can have other dependencies outside of DEPENDS (e.g. do_unpack[depends] += "tar-native:do_populate_sysroot"), the sysroot creation function extend_recipe_sysroot is also added as a pre-function for those tasks whose dependencies are not through DEPENDS but operate similarly.

    When installing dependencies into the sysroot, the code traverses the dependency graph and processes dependencies in exactly the same way as the dependencies would or would not be when installed from sstate. This processing means, for example, a native tool would have its native dependencies added but a target library would not have its dependencies traversed or installed. The same sstate dependency code is used so that builds should be identical regardless of whether sstate was used or not. For a closer look, see the setscene_depvalid() function in the sstate class.

    The build system is careful to maintain manifests of the files it installs so that any given dependency can be installed as needed. The sstate hash of the installed item is also stored so that if it changes, the build system can reinstall it.

6.130. syslinux.bbclass

The syslinux class provides syslinux-specific functions for building bootable images.

The class supports the following variables:

  • INITRD: Indicates list of filesystem images to concatenate and use as an initial RAM disk (initrd). This variable is optional.

  • ROOTFS: Indicates a filesystem image to include as the root filesystem. This variable is optional.

  • AUTO_SYSLINUXMENU: Enables creating an automatic menu when set to "1".

  • LABELS: Lists targets for automatic configuration.

  • APPEND: Lists append string overrides for each label.

  • SYSLINUX_OPTS: Lists additional options to add to the syslinux file. Semicolon characters separate multiple options.

  • SYSLINUX_SPLASH: Lists a background for the VGA boot menu when you are using the boot menu.

  • SYSLINUX_DEFAULT_CONSOLE: Set to "console=ttyX" to change kernel boot default console.

  • SYSLINUX_SERIAL: Sets an alternate serial port. Or, turns off serial when the variable is set with an empty string.

  • SYSLINUX_SERIAL_TTY: Sets an alternate "console=tty..." kernel boot argument.

6.131. systemd.bbclass

The systemd class provides support for recipes that install systemd unit files.

The functionality for this class is disabled unless you have "systemd" in DISTRO_FEATURES.

Under this class, the recipe or Makefile (i.e. whatever the recipe is calling during the do_install task) installs unit files into ${D}${systemd_unitdir}/system. If the unit files being installed go into packages other than the main package, you need to set SYSTEMD_PACKAGES in your recipe to identify the packages in which the files will be installed.

You should set SYSTEMD_SERVICE to the name of the service file. You should also use a package name override to indicate the package to which the value applies. If the value applies to the recipe's main package, use ${PN}. Here is an example from the connman recipe:

     SYSTEMD_SERVICE_${PN} = "connman.service"
        

Services are set up to start on boot automatically unless you have set SYSTEMD_AUTO_ENABLE to "disable".

For more information on systemd, see the "Selecting an Initialization Manager" section in the Yocto Project Development Tasks Manual.

6.132. systemd-boot.bbclass

The systemd-boot class provides functions specific to the systemd-boot bootloader for building bootable images. This is an internal class and is not intended to be used directly.

Note

The systemd-boot class is a result from merging the gummiboot class used in previous Yocto Project releases with the systemd project.

Set the EFI_PROVIDER variable to "systemd-boot" to use this class. Doing so creates a standalone EFI bootloader that is not dependent on systemd.

For information on more variables used and supported in this class, see the SYSTEMD_BOOT_CFG, SYSTEMD_BOOT_ENTRIES, and SYSTEMD_BOOT_TIMEOUT variables.

You can also see the Systemd-boot documentation for more information.

6.133. terminal.bbclass

The terminal class provides support for starting a terminal session. The OE_TERMINAL variable controls which terminal emulator is used for the session.

Other classes use the terminal class anywhere a separate terminal session needs to be started. For example, the patch class assuming PATCHRESOLVE is set to "user", the cml1 class, and the devshell class all use the terminal class.

6.134. testimage*.bbclass

The testimage* classes support running automated tests against images using QEMU and on actual hardware. The classes handle loading the tests and starting the image. To use the classes, you need to perform steps to set up the environment.

Tip

Best practices include using IMAGE_CLASSES rather than INHERIT to inherit the testimage class for automated image testing.

The tests are commands that run on the target system over ssh. Each test is written in Python and makes use of the unittest module.

The testimage.bbclass runs tests on an image when called using the following:

     $ bitbake -c testimage image
        

The testimage-auto class runs tests on an image after the image is constructed (i.e. TESTIMAGE_AUTO must be set to "1").

For information on how to enable, run, and create new tests, see the "Performing Automated Runtime Testing" section in the Yocto Project Development Tasks Manual.

6.135. testsdk.bbclass

This class supports running automated tests against software development kits (SDKs). The testsdk class runs tests on an SDK when called using the following:

     $ bitbake -c testsdk image
        

Tip

Best practices include using IMAGE_CLASSES rather than INHERIT to inherit the testsdk class for automated SDK testing.

6.136. texinfo.bbclass

This class should be inherited by recipes whose upstream packages invoke the texinfo utilities at build-time. Native and cross recipes are made to use the dummy scripts provided by texinfo-dummy-native, for improved performance. Target architecture recipes use the genuine Texinfo utilities. By default, they use the Texinfo utilities on the host system.

Note

If you want to use the Texinfo recipe shipped with the build system, you can remove "texinfo-native" from ASSUME_PROVIDED and makeinfo from SANITY_REQUIRED_UTILITIES.

6.137. tinderclient.bbclass

The tinderclient class submits build results to an external Tinderbox instance.

Note

This class is currently unmaintained.

6.138. toaster.bbclass

The toaster class collects information about packages and images and sends them as events that the BitBake user interface can receive. The class is enabled when the Toaster user interface is running.

This class is not intended to be used directly.

6.139. toolchain-scripts.bbclass

The toolchain-scripts class provides the scripts used for setting up the environment for installed SDKs.

6.140. typecheck.bbclass

The typecheck class provides support for validating the values of variables set at the configuration level against their defined types. The OpenEmbedded build system allows you to define the type of a variable using the "type" varflag. Here is an example:

     IMAGE_FEATURES[type] = "list"
        

6.141. uboot-config.bbclass

The uboot-config class provides support for U-Boot configuration for a machine. Specify the machine in your recipe as follows:

     UBOOT_CONFIG ??= <default>
     UBOOT_CONFIG[foo] = "config,images"
        

You can also specify the machine using this method:

     UBOOT_MACHINE = "config"
        

See the UBOOT_CONFIG and UBOOT_MACHINE variables for additional information.

6.142. uninative.bbclass

Attempts to isolate the build system from the host distribution's C library in order to make re-use of native shared state artifacts across different host distributions practical. With this class enabled, a tarball containing a pre-built C library is downloaded at the start of the build. In the Poky reference distribution this is enabled by default through meta/conf/distro/include/yocto-uninative.inc. Other distributions that do not derive from poky can also "require conf/distro/include/yocto-uninative.inc" to use this. Alternatively if you prefer, you can build the uninative-tarball recipe yourself, publish the resulting tarball (e.g. via HTTP) and set UNINATIVE_URL and UNINATIVE_CHECKSUM appropriately. For an example, see the meta/conf/distro/include/yocto-uninative.inc.

The uninative class is also used unconditionally by the extensible SDK. When building the extensible SDK, uninative-tarball is built and the resulting tarball is included within the SDK.

6.143. update-alternatives.bbclass

The update-alternatives class helps the alternatives system when multiple sources provide the same command. This situation occurs when several programs that have the same or similar function are installed with the same name. For example, the ar command is available from the busybox, binutils and elfutils packages. The update-alternatives class handles renaming the binaries so that multiple packages can be installed without conflicts. The ar command still works regardless of which packages are installed or subsequently removed. The class renames the conflicting binary in each package and symlinks the highest priority binary during installation or removal of packages.

To use this class, you need to define a number of variables:

These variables list alternative commands needed by a package, provide pathnames for links, default links for targets, and so forth. For details on how to use this class, see the comments in the update-alternatives.bbclass file.

Note

You can use the update-alternatives command directly in your recipes. However, this class simplifies things in most cases.

6.144. update-rc.d.bbclass

The update-rc.d class uses update-rc.d to safely install an initialization script on behalf of the package. The OpenEmbedded build system takes care of details such as making sure the script is stopped before a package is removed and started when the package is installed.

Three variables control this class: INITSCRIPT_PACKAGES, INITSCRIPT_NAME and INITSCRIPT_PARAMS. See the variable links for details.

6.145. useradd*.bbclass

The useradd* classes support the addition of users or groups for usage by the package on the target. For example, if you have packages that contain system services that should be run under their own user or group, you can use these classes to enable creation of the user or group. The meta-skeleton/recipes-skeleton/useradd/useradd-example.bb recipe in the Source Directory provides a simple example that shows how to add three users and groups to two packages. See the useradd-example.bb recipe for more information on how to use these classes.

The useradd_base class provides basic functionality for user or groups settings.

The useradd* classes support the USERADD_PACKAGES, USERADD_PARAM, GROUPADD_PARAM, and GROUPMEMS_PARAM variables.

The useradd-staticids class supports the addition of users or groups that have static user identification (uid) and group identification (gid) values.

The default behavior of the OpenEmbedded build system for assigning uid and gid values when packages add users and groups during package install time is to add them dynamically. This works fine for programs that do not care what the values of the resulting users and groups become. In these cases, the order of the installation determines the final uid and gid values. However, if non-deterministic uid and gid values are a problem, you can override the default, dynamic application of these values by setting static values. When you set static values, the OpenEmbedded build system looks in BBPATH for files/passwd and files/group files for the values.

To use static uid and gid values, you need to set some variables. See the USERADDEXTENSION, USERADD_UID_TABLES, USERADD_GID_TABLES, and USERADD_ERROR_DYNAMIC variables. You can also see the useradd class for additional information.

Notes

You do not use the useradd-staticids class directly. You either enable or disable the class by setting the USERADDEXTENSION variable. If you enable or disable the class in a configured system, TMPDIR might contain incorrect uid and gid values. Deleting the TMPDIR directory will correct this condition.

6.146. utility-tasks.bbclass

The utility-tasks class provides support for various "utility" type tasks that are applicable to all recipes, such as do_clean and do_listtasks.

This class is enabled by default because it is inherited by the base class.

6.147. utils.bbclass

The utils class provides some useful Python functions that are typically used in inline Python expressions (e.g. ${@...}). One example use is for bb.utils.contains().

This class is enabled by default because it is inherited by the base class.

6.148. vala.bbclass

The vala class supports recipes that need to build software written using the Vala programming language.

6.149. waf.bbclass

The waf class supports recipes that need to build software that uses the Waf build system. You can use the EXTRA_OECONF or PACKAGECONFIG_CONFARGS variables to specify additional configuration options to be passed on the Waf command line.

Chapter 7. Tasks

Tasks are units of execution for BitBake. Recipes (.bb files) use tasks to complete configuring, compiling, and packaging software. This chapter provides a reference of the tasks defined in the OpenEmbedded build system.

7.1. Normal Recipe Build Tasks

The following sections describe normal tasks associated with building a recipe. For more information on tasks and dependencies, see the "Tasks" and "Dependencies" sections in the BitBake User Manual.

7.1.1. do_build

The default task for all recipes. This task depends on all other normal tasks required to build a recipe.

7.1.2. do_compile

Compiles the source code. This task runs with the current working directory set to ${B}.

The default behavior of this task is to run the oe_runmake function if a makefile (Makefile, makefile, or GNUmakefile) is found. If no such file is found, the do_compile task does nothing.

7.1.3. do_compile_ptest_base

Compiles the runtime test suite included in the software being built.

7.1.4. do_configure

Configures the source by enabling and disabling any build-time and configuration options for the software being built. The task runs with the current working directory set to ${B}.

The default behavior of this task is to run oe_runmake clean if a makefile (Makefile, makefile, or GNUmakefile) is found and CLEANBROKEN is not set to "1". If no such file is found or the CLEANBROKEN variable is set to "1", the do_configure task does nothing.

7.1.5. do_configure_ptest_base

Configures the runtime test suite included in the software being built.

7.1.6. do_deploy

Writes output files that are to be deployed to ${DEPLOY_DIR_IMAGE}. The task runs with the current working directory set to ${B}.

Recipes implementing this task should inherit the deploy class and should write the output to ${DEPLOYDIR}, which is not to be confused with ${DEPLOY_DIR}. The deploy class sets up do_deploy as a shared state (sstate) task that can be accelerated through sstate use. The sstate mechanism takes care of copying the output from ${DEPLOYDIR} to ${DEPLOY_DIR_IMAGE}.

Caution

Do not write the output directly to ${DEPLOY_DIR_IMAGE}, as this causes the sstate mechanism to malfunction.

The do_deploy task is not added as a task by default and consequently needs to be added manually. If you want the task to run after do_compile, you can add it by doing the following:

     addtask deploy after do_compile
            

Adding do_deploy after other tasks works the same way.

Note

You do not need to add before do_build to the addtask command (though it is harmless), because the base class contains the following:
     do_build[recrdeptask] += "do_deploy"
                
See the "Dependencies" section in the BitBake User Manual for more information.

If the do_deploy task re-executes, any previous output is removed (i.e. "cleaned").

7.1.7. do_distrodata

Provides information about the recipe.

The distrodata task is included as part of the distrodata class.

To build the distrodata task, use the bitbake command with the "-c" option and task name:

     $ bitbake core-image-minimal -c distrodata
            

By default, the results are stored in $LOG_DIR (e.g. $BUILD_DIR/tmp/log).

7.1.8. do_fetch

Fetches the source code. This task uses the SRC_URI variable and the argument's prefix to determine the correct fetcher module.

7.1.9. do_image

Starts the image generation process. The do_image task runs after the OpenEmbedded build system has run the do_rootfs task during which packages are identified for installation into the image and the root filesystem is created, complete with post-processing.

The do_image task performs pre-processing on the image through the IMAGE_PREPROCESS_COMMAND and dynamically generates supporting do_image_* tasks as needed.

For more information on image creation, see the "Image Generation" section in the Yocto Project Overview and Concepts Manual.

7.1.10. do_image_complete

Completes the image generation process. The do_image_complete task runs after the OpenEmbedded build system has run the do_image task during which image pre-processing occurs and through dynamically generated do_image_* tasks the image is constructed.

The do_image_complete task performs post-processing on the image through the IMAGE_POSTPROCESS_COMMAND.

For more information on image creation, see the "Image Generation" section in the Yocto Project Overview and Concepts Manual.

7.1.11. do_install

Copies files that are to be packaged into the holding area ${D}. This task runs with the current working directory set to ${B}, which is the compilation directory. The do_install task, as well as other tasks that either directly or indirectly depend on the installed files (e.g. do_package, do_package_write_*, and do_rootfs), run under fakeroot.

Caution

When installing files, be careful not to set the owner and group IDs of the installed files to unintended values. Some methods of copying files, notably when using the recursive cp command, can preserve the UID and/or GID of the original file, which is usually not what you want. The host-user-contaminated QA check checks for files that probably have the wrong ownership.

Safe methods for installing files include the following:

  • The install utility. This utility is the preferred method.

  • The cp command with the "--no-preserve=ownership" option.

  • The tar command with the "--no-same-owner" option. See the bin_package.bbclass file in the meta/classes directory of the Source Directory for an example.

7.1.12. do_install_ptest_base

Copies the runtime test suite files from the compilation directory to a holding area.

7.1.13. do_package

Analyzes the content of the holding area ${D} and splits the content into subsets based on available packages and files. This task makes use of the PACKAGES and FILES variables.

The do_package task, in conjunction with the do_packagedata task, also saves some important package metadata. For additional information, see the PKGDESTWORK variable and the "Automatically Added Runtime Dependencies" section in the Yocto Project Overview and Concepts Manual.

7.1.14. do_package_qa

Runs QA checks on packaged files. For more information on these checks, see the insane class.

7.1.15. do_package_write_deb

Creates Debian packages (i.e. *.deb files) and places them in the ${DEPLOY_DIR_DEB} directory in the package feeds area. For more information, see the "Package Feeds" section in the Yocto Project Overview and Concepts Manual.

7.1.16. do_package_write_ipk

Creates IPK packages (i.e. *.ipk files) and places them in the ${DEPLOY_DIR_IPK} directory in the package feeds area. For more information, see the "Package Feeds" section in the Yocto Project Overview and Concepts Manual.

7.1.17. do_package_write_rpm

Creates RPM packages (i.e. *.rpm files) and places them in the ${DEPLOY_DIR_RPM} directory in the package feeds area. For more information, see the "Package Feeds" section in the Yocto Project Overview and Concepts Manual.

7.1.18. do_package_write_tar

Creates tarballs and places them in the ${DEPLOY_DIR_TAR} directory in the package feeds area. For more information, see the "Package Feeds" section in the Yocto Project Overview and Concepts Manual.

7.1.19. do_packagedata

Saves package metadata generated by the do_package task in PKGDATA_DIR to make it available globally.

7.1.20. do_patch

Locates patch files and applies them to the source code.

After fetching and unpacking source files, the build system uses the recipe's SRC_URI statements to locate and apply patch files to the source code.

Note

The build system uses the FILESPATH variable to determine the default set of directories when searching for patches.

Patch files, by default, are *.patch and *.diff files created and kept in a subdirectory of the directory holding the recipe file. For example, consider the bluez5 recipe from the OE-Core layer (i.e. poky/meta):

     poky/meta/recipes-connectivity/bluez5
            

This recipe has two patch files located here:

     poky/meta/recipes-connectivity/bluez5/bluez5
            

In the bluez5 recipe, the SRC_URI statements point to the source and patch files needed to build the package.

Note

In the case for the bluez5_5.48.bb recipe, the SRC_URI statements are from an include file bluez5.inc.

As mentioned earlier, the build system treats files whose file types are .patch and .diff as patch files. However, you can use the "apply=yes" parameter with the SRC_URI statement to indicate any file as a patch file:

     SRC_URI = " \
          git://path_to_repo/some_package \
          file://file;apply=yes \
     "
            

Conversely, if you have a directory full of patch files and you want to exclude some so that the do_patch task does not apply them during the patch phase, you can use the "apply=no" parameter with the SRC_URI statement:

     SRC_URI = " \
          git://path_to_repo/some_package \
          file://path_to_lots_of_patch_files \
          file://path_to_lots_of_patch_files/patch_file5;apply=no \
     "
            

In the previous example, assuming all the files in the directory holding the patch files end with either .patch or .diff, every file would be applied as a patch by default except for the patch_file5 patch.

You can find out more about the patching process in the "Patching" section in the Yocto Project Overview and Concepts Manual and the "Patching Code" section in the Yocto Project Development Tasks Manual.

7.1.21. do_populate_lic

Writes license information for the recipe that is collected later when the image is constructed.

7.1.22. do_populate_sdk

Creates the file and directory structure for an installable SDK. See the "SDK Generation" section in the Yocto Project Overview and Concepts Manual for more information.

7.1.23. do_populate_sysroot

Stages (copies) a subset of the files installed by the do_install task into the appropriate sysroot. For information on how to access these files from other recipes, see the STAGING_DIR* variables. Directories that would typically not be needed by other recipes at build time (e.g. /etc) are not copied by default.

For information on what directories are copied by default, see the SYSROOT_DIRS* variables. You can change these variables inside your recipe if you need to make additional (or fewer) directories available to other recipes at build time.

The do_populate_sysroot task is a shared state (sstate) task, which means that the task can be accelerated through sstate use. Realize also that if the task is re-executed, any previous output is removed (i.e. "cleaned").

7.1.24. do_prepare_recipe_sysroot

Installs the files into the individual recipe specific sysroots (i.e. recipe-sysroot and recipe-sysroot-native under ${WORKDIR} based upon the dependencies specified by DEPENDS). See the "staging" class for more information.

7.1.25. do_rm_work

Removes work files after the OpenEmbedded build system has finished with them. You can learn more by looking at the "rm_work.bbclass" section.

7.1.26. do_unpack

Unpacks the source code into a working directory pointed to by ${WORKDIR}. The S variable also plays a role in where unpacked source files ultimately reside. For more information on how source files are unpacked, see the "Source Fetching" section in the Yocto Project Overview and Concepts Manual and also see the WORKDIR and S variable descriptions.

7.2. Manually Called Tasks

These tasks are typically manually triggered (e.g. by using the bitbake -c command-line option):

7.2.1. do_checkpkg

Provides information about the recipe including its upstream version and status. The upstream version and status reveals whether or not a version of the recipe exists upstream and a status of not updated, updated, or unknown.

The checkpkg task is included as part of the distrodata class.

To build the checkpkg task, use the bitbake command with the "-c" option and task name:

     $ bitbake core-image-minimal -c checkpkg
            

By default, the results are stored in $LOG_DIR (e.g. $BUILD_DIR/tmp/log).

7.2.2. do_checkuri

Validates the SRC_URI value.

7.2.3. do_clean

Removes all output files for a target from the do_unpack task forward (i.e. do_unpack, do_configure, do_compile, do_install, and do_package).

You can run this task using BitBake as follows:

     $ bitbake -c clean recipe
            

Running this task does not remove the sstate cache files. Consequently, if no changes have been made and the recipe is rebuilt after cleaning, output files are simply restored from the sstate cache. If you want to remove the sstate cache files for the recipe, you need to use the do_cleansstate task instead (i.e. bitbake -c cleansstate recipe).

7.2.4. do_cleanall

Removes all output files, shared state (sstate) cache, and downloaded source files for a target (i.e. the contents of DL_DIR). Essentially, the do_cleanall task is identical to the do_cleansstate task with the added removal of downloaded source files.

You can run this task using BitBake as follows:

     $ bitbake -c cleanall recipe
            

Typically, you would not normally use the cleanall task. Do so only if you want to start fresh with the do_fetch task.

7.2.5. do_cleansstate

Removes all output files and shared state (sstate) cache for a target. Essentially, the do_cleansstate task is identical to the do_clean task with the added removal of shared state (sstate) cache.

You can run this task using BitBake as follows:

     $ bitbake -c cleansstate recipe
            

When you run the do_cleansstate task, the OpenEmbedded build system no longer uses any sstate. Consequently, building the recipe from scratch is guaranteed.

Note

The do_cleansstate task cannot remove sstate from a remote sstate mirror. If you need to build a target from scratch using remote mirrors, use the "-f" option as follows:
     $ bitbake -f -c do_cleansstate target
                

7.2.6. do_devpyshell

Starts a shell in which an interactive Python interpreter allows you to interact with the BitBake build environment. From within this shell, you can directly examine and set bits from the data store and execute functions as if within the BitBake environment. See the "Using a Development Python Shell" section in the Yocto Project Development Tasks Manual for more information about using devpyshell.

7.2.7. do_devshell

Starts a shell whose environment is set up for development, debugging, or both. See the "Using a Development Shell" section in the Yocto Project Development Tasks Manual for more information about using devshell.

7.2.8. do_listtasks

Lists all defined tasks for a target.

7.2.9. do_package_index

Creates or updates the index in the Package Feeds area.

Note

This task is not triggered with the bitbake -c command-line option as are the other tasks in this section. Because this task is specifically for the package-index recipe, you run it using bitbake package-index.

The following tasks are applicable to image recipes.

7.3.1. do_bootimg

Creates a bootable live image. See the IMAGE_FSTYPES variable for additional information on live image types.

7.3.2. do_bundle_initramfs

Combines an initial RAM disk (initramfs) image and kernel together to form a single image. The CONFIG_INITRAMFS_SOURCE variable has some more information about these types of images.

7.3.3. do_rootfs

Creates the root filesystem (file and directory structure) for an image. See the "Image Generation" section in the Yocto Project Overview and Concepts Manual for more information on how the root filesystem is created.

7.3.4. do_testimage

Boots an image and performs runtime tests within the image. For information on automatically testing images, see the "Performing Automated Runtime Testing" section in the Yocto Project Development Tasks Manual.

7.3.5. do_testimage_auto

Boots an image and performs runtime tests within the image immediately after it has been built. This task is enabled when you set TESTIMAGE_AUTO equal to "1".

For information on automatically testing images, see the "Performing Automated Runtime Testing" section in the Yocto Project Development Tasks Manual.

The following tasks are applicable to kernel recipes. Some of these tasks (e.g. the do_menuconfig task) are also applicable to recipes that use Linux kernel style configuration such as the BusyBox recipe.

7.4.1. do_compile_kernelmodules

Runs the step that builds the kernel modules (if needed). Building a kernel consists of two steps: 1) the kernel (vmlinux) is built, and 2) the modules are built (i.e. make modules).

7.4.2. do_diffconfig

When invoked by the user, this task creates a file containing the differences between the original config as produced by do_kernel_configme task and the changes made by the user with other methods (i.e. using (do_kernel_menuconfig). Once the file of differences is created, it can be used to create a config fragment that only contains the differences. You can invoke this task from the command line as follows:

     $ bitbake linux-yocto -c diffconfig
            

For more information, see the "Creating Configuration Fragments" section in the Yocto Project Linux Kernel Development Manual.

7.4.3. do_kernel_checkout

Converts the newly unpacked kernel source into a form with which the OpenEmbedded build system can work. Because the kernel source can be fetched in several different ways, the do_kernel_checkout task makes sure that subsequent tasks are given a clean working tree copy of the kernel with the correct branches checked out.

7.4.4. do_kernel_configcheck

Validates the configuration produced by the do_kernel_menuconfig task. The do_kernel_configcheck task produces warnings when a requested configuration does not appear in the final .config file or when you override a policy configuration in a hardware configuration fragment. You can run this task explicitly and view the output by using the following command:

     $ bitbake linux-yocto -c kernel_configcheck -f
            

For more information, see the "Validating Configuration" section in the Yocto Project Linux Kernel Development Manual.

7.4.5. do_kernel_configme

After the kernel is patched by the do_patch task, the do_kernel_configme task assembles and merges all the kernel config fragments into a merged configuration that can then be passed to the kernel configuration phase proper. This is also the time during which user-specified defconfigs are applied if present, and where configuration modes such as --allnoconfig are applied.

7.4.6. do_kernel_menuconfig

Invoked by the user to manipulate the .config file used to build a linux-yocto recipe. This task starts the Linux kernel configuration tool, which you then use to modify the kernel configuration.

Note

You can also invoke this tool from the command line as follows:
     $ bitbake linux-yocto -c menuconfig
                

See the "Using menuconfig" section in the Yocto Project Linux Kernel Development Manual for more information on this configuration tool.

7.4.7. do_kernel_metadata

Collects all the features required for a given kernel build, whether the features come from SRC_URI or from Git repositories. After collection, the do_kernel_metadata task processes the features into a series of config fragments and patches, which can then be applied by subsequent tasks such as do_patch and do_kernel_configme.

7.4.8. do_menuconfig

Runs make menuconfig for the kernel. For information on menuconfig, see the "Using  menuconfig" section in the Yocto Project Linux Kernel Development Manual.

7.4.9. do_savedefconfig

When invoked by the user, creates a defconfig file that can be used instead of the default defconfig. The saved defconfig contains the differences between the default defconfig and the changes made by the user using other methods (i.e. the do_kernel_menuconfig task. You can invoke the task using the following command:

     $ bitbake linux-yocto -c savedefconfig
            

7.4.10. do_shared_workdir

After the kernel has been compiled but before the kernel modules have been compiled, this task copies files required for module builds and which are generated from the kernel build into the shared work directory. With these copies successfully copied, the do_compile_kernelmodules task can successfully build the kernel modules in the next step of the build.

7.4.11. do_sizecheck

After the kernel has been built, this task checks the size of the stripped kernel image against KERNEL_IMAGE_MAXSIZE. If that variable was set and the size of the stripped kernel exceeds that size, the kernel build produces a warning to that effect.

7.4.12. do_strip

If KERNEL_IMAGE_STRIP_EXTRA_SECTIONS is defined, this task strips the sections named in that variable from vmlinux. This stripping is typically used to remove nonessential sections such as .comment sections from a size-sensitive configuration.

7.4.13. do_validate_branches

After the kernel is unpacked but before it is patched, this task makes sure that the machine and metadata branches as specified by the SRCREV variables actually exist on the specified branches. If these branches do not exist and AUTOREV is not being used, the do_validate_branches task fails during the build.

7.5. Miscellaneous Tasks

The following sections describe miscellaneous tasks.

7.5.1. do_spdx

A build stage that takes the source code and scans it on a remote FOSSOLOGY server in order to produce an SPDX document. This task applies only to the spdx class.

Chapter 8. devtool Quick Reference

The devtool command-line tool provides a number of features that help you build, test, and package software. This command is available alongside the bitbake command. Additionally, the devtool command is a key part of the extensible SDK.

This chapter provides a Quick Reference for the devtool command. For more information on how to apply the command when using the extensible SDK, see the "Using the Extensible SDK" chapter in the Yocto Project Application Development and the Extensible Software Development Kit (eSDK) manual.

8.1. Getting Help

The devtool command line is organized similarly to Git in that it has a number of sub-commands for each function. You can run devtool --help to see all the commands:

     $ devtool --help
     NOTE: Starting bitbake server...
     usage: devtool [--basepath BASEPATH] [--bbpath BBPATH] [-d] [-q]
                    [--color COLOR] [-h]
                    <subcommand> ...

     OpenEmbedded development tool

     options:
       --basepath BASEPATH  Base directory of SDK / build directory
       --bbpath BBPATH      Explicitly specify the BBPATH, rather than getting it
                            from the metadata
       -d, --debug          Enable debug output
       -q, --quiet          Print only errors
       --color COLOR        Colorize output (where COLOR is auto, always, never)
       -h, --help           show this help message and exit

     subcommands:
       Beginning work on a recipe:
         add                  Add a new recipe
         modify               Modify the source for an existing recipe
         upgrade              Upgrade an existing recipe
       Getting information:
         status               Show workspace status
         search               Search available recipes
         latest-version       Report the latest version of an existing recipe
       Working on a recipe in the workspace:
         build                Build a recipe
         rename               Rename a recipe file in the workspace
         edit-recipe          Edit a recipe file
         find-recipe          Find a recipe file
         configure-help       Get help on configure script options
         update-recipe        Apply changes from external source tree to recipe
         reset                Remove a recipe from your workspace
         finish               Finish working on a recipe in your workspace
       Testing changes on target:
         deploy-target        Deploy recipe output files to live target machine
         undeploy-target      Undeploy recipe output files in live target machine
         build-image          Build image including workspace recipe packages
       Advanced:
         create-workspace     Set up workspace in an alternative location
         export               Export workspace into a tar archive
         import               Import exported tar archive into workspace
         extract              Extract the source for an existing recipe
         sync                 Synchronize the source tree for an existing recipe
     Use devtool <subcommand> --help to get help on a specific command
            

As directed in the general help output, you can get more syntax on a specific command by providing the command name and using --help:

     $ devtool add --help
     NOTE: Starting bitbake server...
     usage: devtool add [-h] [--same-dir | --no-same-dir] [--fetch URI]
                        [--fetch-dev] [--version VERSION] [--no-git]
                        [--srcrev SRCREV | --autorev] [--srcbranch SRCBRANCH]
                        [--binary] [--also-native] [--src-subdir SUBDIR]
                        [--mirrors] [--provides PROVIDES]
                        [recipename] [srctree] [fetchuri]

     Adds a new recipe to the workspace to build a specified source tree. Can
     optionally fetch a remote URI and unpack it to create the source tree.

     arguments:
       recipename            Name for new recipe to add (just name - no version,
                             path or extension). If not specified, will attempt to
                             auto-detect it.
       srctree               Path to external source tree. If not specified, a
                             subdirectory of
                             /home/scottrif/poky/build/workspace/sources will be
                             used.
       fetchuri              Fetch the specified URI and extract it to create the
                             source tree

     options:
       -h, --help            show this help message and exit
       --same-dir, -s        Build in same directory as source
       --no-same-dir         Force build in a separate build directory
       --fetch URI, -f URI   Fetch the specified URI and extract it to create the
                             source tree (deprecated - pass as positional argument
                             instead)
       --fetch-dev           For npm, also fetch devDependencies
       --version VERSION, -V VERSION
                             Version to use within recipe (PV)
       --no-git, -g          If fetching source, do not set up source tree as a git
                             repository
       --srcrev SRCREV, -S SRCREV
                             Source revision to fetch if fetching from an SCM such
                             as git (default latest)
       --autorev, -a         When fetching from a git repository, set SRCREV in the
                             recipe to a floating revision instead of fixed
       --srcbranch SRCBRANCH, -B SRCBRANCH
                             Branch in source repository if fetching from an SCM
                             such as git (default master)
       --binary, -b          Treat the source tree as something that should be
                             installed verbatim (no compilation, same directory
                             structure). Useful with binary packages e.g. RPMs.
       --also-native         Also add native variant (i.e. support building recipe
                             for the build host as well as the target machine)
       --src-subdir SUBDIR   Specify subdirectory within source tree to use
       --mirrors             Enable PREMIRRORS and MIRRORS for source tree fetching
                             (disable by default).
       --provides PROVIDES, -p PROVIDES
                             Specify an alias for the item provided by the recipe.
                             E.g. virtual/libgl
            

8.2. The Workspace Layer Structure

devtool uses a "Workspace" layer in which to accomplish builds. This layer is not specific to any single devtool command but is rather a common working area used across the tool.

The following figure shows the workspace structure:

     attic - A directory created if devtool believes it must preserve
             anything when you run "devtool reset".  For example, if you
             run "devtool add", make changes to the recipe, and then
             run "devtool reset", devtool takes notice that the file has
             been changed and moves it into the attic should you still
             want the recipe.

     README - Provides information on what is in workspace layer and how to
              manage it.

     .devtool_md5 - A checksum file used by devtool.

     appends - A directory that contains *.bbappend files, which point to
               external source.

     conf - A configuration directory that contains the layer.conf file.

     recipes - A directory containing recipes.  This directory contains a
               folder for each directory added whose name matches that of the
               added recipe.  devtool places the recipe.bb file
               within that sub-directory.

     sources - A directory containing a working copy of the source files used
               when building the recipe.  This is the default directory used
               as the location of the source tree when you do not provide a
               source tree path.  This directory contains a folder for each
               set of source files matched to a corresponding recipe.
            

8.3. Adding a New Recipe to the Workspace Layer

Use the devtool add command to add a new recipe to the workspace layer. The recipe you add should not exist - devtool creates it for you. The source files the recipe uses should exist in an external area.

The following example creates and adds a new recipe named jackson to a workspace layer the tool creates. The source code built by the recipes resides in /home/user/sources/jackson:

     $ devtool add jackson /home/user/sources/jackson
            

If you add a recipe and the workspace layer does not exist, the command creates the layer and populates it as described in "The Workspace Layer Structure" section.

Running devtool add when the workspace layer exists causes the tool to add the recipe, append files, and source files into the existing workspace layer. The .bbappend file is created to point to the external source tree.

Note

If your recipe has runtime dependencies defined, you must be sure that these packages exist on the target hardware before attempting to run your application. If dependent packages (e.g. libraries) do not exist on the target, your application, when run, will fail to find those functions. For more information, see the "Deploying Your Software on the Target Machine" section.

By default, devtool add uses the latest revision (i.e. master) when unpacking files from a remote URI. In some cases, you might want to specify a source revision by branch, tag, or commit hash. You can specify these options when using the devtool add command:

  • To specify a source branch, use the --srcbranch option:

         $ devtool add --srcbranch thud jackson /home/user/sources/jackson
                        

    In the previous example, you are checking out the thud branch.

  • To specify a specific tag or commit hash, use the --srcrev option:

         $ devtool add --srcrev yocto-2.6 jackson /home/user/sources/jackson
         $ devtool add --srcrev some_commit_hash /home/user/sources/jackson
                        

    The previous examples check out the yocto-2.6 tag and the commit associated with the some_commit_hash hash.

Note

If you prefer to use the latest revision every time the recipe is built, use the options --autorev or -a.

8.4. Extracting the Source for an Existing Recipe

Use the devtool extract command to extract the source for an existing recipe. When you use this command, you must supply the root name of the recipe (i.e. no version, paths, or extensions), and you must supply the directory to which you want the source extracted.

Additional command options let you control the name of a development branch into which you can checkout the source and whether or not to keep a temporary directory, which is useful for debugging.

8.5. Synchronizing a Recipe's Extracted Source Tree

Use the devtool sync command to synchronize a previously extracted source tree for an existing recipe. When you use this command, you must supply the root name of the recipe (i.e. no version, paths, or extensions), and you must supply the directory to which you want the source extracted.

Additional command options let you control the name of a development branch into which you can checkout the source and whether or not to keep a temporary directory, which is useful for debugging.

8.6. Modifying an Existing Recipe

Use the devtool modify command to begin modifying the source of an existing recipe. This command is very similar to the add command except that it does not physically create the recipe in the workspace layer because the recipe already exists in an another layer.

The devtool modify command extracts the source for a recipe, sets it up as a Git repository if the source had not already been fetched from Git, checks out a branch for development, and applies any patches from the recipe as commits on top. You can use the following command to checkout the source files:

     $ devtool modify recipe
            

Using the above command form, devtool uses the existing recipe's SRC_URI statement to locate the upstream source, extracts the source into the default sources location in the workspace. The default development branch used is "devtool".

8.7. Edit an Existing Recipe

Use the devtool edit-recipe command to run the default editor, which is identified using the EDITOR variable, on the specified recipe.

When you use the devtool edit-recipe command, you must supply the root name of the recipe (i.e. no version, paths, or extensions). Also, the recipe file itself must reside in the workspace as a result of the devtool add or devtool upgrade commands. However, you can override that requirement by using the "-a" or "--any-recipe" option. Using either of these options allows you to edit any recipe regardless of its location.

8.8. Updating a Recipe

Use the devtool update-recipe command to update your recipe with patches that reflect changes you make to the source files. For example, if you know you are going to work on some code, you could first use the devtool modify command to extract the code and set up the workspace. After which, you could modify, compile, and test the code.

When you are satisfied with the results and you have committed your changes to the Git repository, you can then run the devtool update-recipe to create the patches and update the recipe:

     $ devtool update-recipe recipe
            

If you run the devtool update-recipe without committing your changes, the command ignores the changes.

Often, you might want to apply customizations made to your software in your own layer rather than apply them to the original recipe. If so, you can use the -a or --append option with the devtool update-recipe command. These options allow you to specify the layer into which to write an append file:

     $ devtool update-recipe recipe -a base-layer-directory
            

The *.bbappend file is created at the appropriate path within the specified layer directory, which may or may not be in your bblayers.conf file. If an append file already exists, the command updates it appropriately.

8.9. Upgrading a Recipe

As software matures, upstream recipes are upgraded to newer versions. As a developer, you need to keep your local recipes up-to-date with the upstream version releases. Several methods exist by which you can upgrade recipes. You can read about them in the "Upgrading Recipes" section of the Yocto Project Development Tasks Manual. This section overviews the devtool upgrade command.

The devtool upgrade command upgrades an existing recipe to a more recent version of the recipe upstream. The command puts the upgraded recipe file along with any associated files into a "workspace" and, if necessary, extracts the source tree to a specified location. During the upgrade, patches associated with the recipe are rebased or added as needed.

When you use the devtool upgrade command, you must supply the root name of the recipe (i.e. no version, paths, or extensions), and you must supply the directory to which you want the source extracted. Additional command options let you control things such as the version number to which you want to upgrade (i.e. the PV), the source revision to which you want to upgrade (i.e. the SRCREV), whether or not to apply patches, and so forth.

You can read more on the devtool upgrade workflow in the "Use devtool upgrade to Create a Version of the Recipe that Supports a Newer Version of the Software" section in the Yocto Project Application Development and the Extensible Software Development Kit (eSDK) manual. You can also see an example of how to use devtool upgrade in the "Using devtool upgrade" section in the Yocto Project Development Tasks Manual.

8.10. Resetting a Recipe

Use the devtool reset command to remove a recipe and its configuration (e.g. the corresponding .bbappend file) from the workspace layer. Realize that this command deletes the recipe and the append file. The command does not physically move them for you. Consequently, you must be sure to physically relocate your updated recipe and the append file outside of the workspace layer before running the devtool reset command.

If the devtool reset command detects that the recipe or the append files have been modified, the command preserves the modified files in a separate "attic" subdirectory under the workspace layer.

Here is an example that resets the workspace directory that contains the mtr recipe:

     $ devtool reset mtr
     NOTE: Cleaning sysroot for recipe mtr...
     NOTE: Leaving source tree /home/scottrif/poky/build/workspace/sources/mtr as-is; if you no
        longer need it then please delete it manually
     $
            

8.11. Building Your Recipe

Use the devtool build command to cause the OpenEmbedded build system to build your recipe. The devtool build command is equivalent to bitbake -c populate_sysroot.

When you use the devtool build command, you must supply the root name of the recipe (i.e. no version, paths, or extensions). You can use either the "-s" or the "--disable-parallel-make" option to disable parallel makes during the build. Here is an example:

     $ devtool build recipe
            

8.12. Building Your Image

Use the devtool build-image command to build an image, extending it to include packages from recipes in the workspace. Using this command is useful when you want an image that ready for immediate deployment onto a device for testing. For proper integration into a final image, you need to edit your custom image recipe appropriately.

When you use the devtool build-image command, you must supply the name of the image. This command has no command line options:

     $ devtool build-image image
            

8.13. Deploying Your Software on the Target Machine

Use the devtool deploy-target command to deploy the recipe's build output to the live target machine:

     $ devtool deploy-target recipe target
            

The target is the address of the target machine, which must be running an SSH server (i.e. user@hostname[:destdir]).

This command deploys all files installed during the do_install task. Furthermore, you do not need to have package management enabled within the target machine. If you do, the package manager is bypassed.

Notes

The deploy-target functionality is for development only. You should never use it to update an image that will be used in production.

Some conditions exist that could prevent a deployed application from behaving as expected. When both of the following conditions exist, your application has the potential to not behave correctly when run on the target:

  • You are deploying a new application to the target and the recipe you used to build the application had correctly defined runtime dependencies.

  • The target does not physically have the packages on which the application depends installed.

If both of these conditions exist, your application will not behave as expected. The reason for this misbehavior is because the devtool deploy-target command does not deploy the packages (e.g. libraries) on which your new application depends. The assumption is that the packages are already on the target. Consequently, when a runtime call is made in the application for a dependent function (e.g. a library call), the function cannot be found.

To be sure you have all the dependencies local to the target, you need to be sure that the packages are pre-deployed (installed) on the target before attempting to run your application.

8.14. Removing Your Software from the Target Machine

Use the devtool undeploy-target command to remove deployed build output from the target machine. For the devtool undeploy-target command to work, you must have previously used the devtool deploy-target command.

     $ devtool undeploy-target recipe target
            

The target is the address of the target machine, which must be running an SSH server (i.e. user@hostname).

8.15. Creating the Workspace Layer in an Alternative Location

Use the devtool create-workspace command to create a new workspace layer in your Build Directory. When you create a new workspace layer, it is populated with the README file and the conf directory only.

The following example creates a new workspace layer in your current working and by default names the workspace layer "workspace":

     $ devtool create-workspace
            

You can create a workspace layer anywhere by supplying a pathname with the command. The following command creates a new workspace layer named "new-workspace":

     $ devtool create-workspace /home/scottrif/new-workspace
            

8.16. Get the Status of the Recipes in Your Workspace

Use the devtool status command to list the recipes currently in your workspace. Information includes the paths to their respective external source trees.

The devtool status command has no command-line options:

     $ devtool status
            

Following is sample output after using devtool add to create and add the mtr_0.86.bb recipe to the workspace directory:

     $ devtool status
     mtr: /home/scottrif/poky/build/workspace/sources/mtr (/home/scottrif/poky/build/workspace/recipes/mtr/mtr_0.86.bb)
     $
            

8.17. Search for Available Target Recipes

Use the devtool search command to search for available target recipes. The command matches the recipe name, package name, description, and installed files. The command displays the recipe name as a result of a match.

When you use the devtool search command, you must supply a keyword. The command uses the keyword when searching for a match.

Chapter 9. OpenEmbedded Kickstart (.wks) Reference

9.1. Introduction

The current Wic implementation supports only the basic kickstart partitioning commands: partition (or part for short) and bootloader.

Note

Future updates will implement more commands and options. If you use anything that is not specifically supported, results can be unpredictable.

This chapter provides a reference on the available kickstart commands. The information lists the commands, their syntax, and meanings. Kickstart commands are based on the Fedora kickstart versions but with modifications to reflect Wic capabilities. You can see the original documentation for those commands at the following link:

     http://pykickstart.readthedocs.io/en/latest/kickstart-docs.html
            

9.2. Command: part or partition

Either of these commands creates a partition on the system and uses the following syntax:

     part [mntpoint]
     partition [mntpoint]
            

If you do not provide mntpoint, Wic creates a partition but does not mount it.

The mntpoint is where the partition is mounted and must be in one of the following forms:

  • /path: For example, "/", "/usr", or "/home"

  • swap: The created partition is used as swap space

Specifying a mntpoint causes the partition to automatically be mounted. Wic achieves this by adding entries to the filesystem table (fstab) during image generation. In order for Wic to generate a valid fstab, you must also provide one of the --ondrive, --ondisk, or --use-uuid partition options as part of the command.

Note

The mount program must understand the PARTUUID syntax you use with --use-uuid and non-root mountpoint, including swap. The busybox versions of these application are currently excluded.

Here is an example that uses "/" as the mountpoint. The command uses --ondisk to force the partition onto the sdb disk:

     part / --source rootfs --ondisk sdb --fstype=ext3 --label platform --align 1024
            

Here is a list that describes other supported options you can use with the part and partition commands:

  • --size: The minimum partition size in MBytes. Specify an integer value such as 500. Do not append the number with "MB". You do not need this option if you use --source.

  • --fixed-size: The exact partition size in MBytes. You cannot specify with --size. An error occurs when assembling the disk image if the partition data is larger than --fixed-size.

  • --source: This option is a Wic-specific option that names the source of the data that populates the partition. The most common value for this option is "rootfs", but you can use any value that maps to a valid source plug-in. For information on the source plug-ins, see the "Using the Wic Plug-Ins Interface" section in the Yocto Project Development Tasks Manual.

    If you use --source rootfs, Wic creates a partition as large as needed and fills it with the contents of the root filesystem pointed to by the -r command-line option or the equivalent rootfs derived from the -e command-line option. The filesystem type used to create the partition is driven by the value of the --fstype option specified for the partition. See the entry on --fstype that follows for more information.

    If you use --source plugin-name, Wic creates a partition as large as needed and fills it with the contents of the partition that is generated by the specified plug-in name using the data pointed to by the -r command-line option or the equivalent rootfs derived from the -e command-line option. Exactly what those contents are and filesystem type used are dependent on the given plug-in implementation.

    If you do not use the --source option, the wic command creates an empty partition. Consequently, you must use the --size option to specify the size of the empty partition.

  • --ondisk or --ondrive: Forces the partition to be created on a particular disk.

  • --fstype: Sets the file system type for the partition. Valid values are:

    • ext4

    • ext3

    • ext2

    • btrfs

    • squashfs

    • swap

  • --fsoptions: Specifies a free-form string of options to be used when mounting the filesystem. This string is copied into the /etc/fstab file of the installed system and should be enclosed in quotes. If not specified, the default string is "defaults".

  • --label label: Specifies the label to give to the filesystem to be made on the partition. If the given label is already in use by another filesystem, a new label is created for the partition.

  • --active: Marks the partition as active.

  • --align (in KBytes): This option is a Wic-specific option that says to start partitions on boundaries given x KBytes.

  • --no-table: This option is a Wic-specific option. Using the option reserves space for the partition and causes it to become populated. However, the partition is not added to the partition table.

  • --exclude-path: This option is a Wic-specific option that excludes the given relative path from the resulting image. This option is only effective with the rootfs source plug-in.

  • --extra-space: This option is a Wic-specific option that adds extra space after the space filled by the content of the partition. The final size can exceed the size specified by the --size option. The default value is 10 Mbytes.

  • --overhead-factor: This option is a Wic-specific option that multiplies the size of the partition by the option's value. You must supply a value greater than or equal to "1". The default value is "1.3".

  • --part-name: This option is a Wic-specific option that specifies a name for GPT partitions.

  • --part-type: This option is a Wic-specific option that specifies the partition type globally unique identifier (GUID) for GPT partitions. You can find the list of partition type GUIDs at http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs.

  • --use-uuid: This option is a Wic-specific option that causes Wic to generate a random GUID for the partition. The generated identifier is used in the bootloader configuration to specify the root partition.

  • --uuid: This option is a Wic-specific option that specifies the partition UUID.

  • --fsuuid: This option is a Wic-specific option that specifies the filesystem UUID. You can generate or modify WKS_FILE with this option if a preconfigured filesystem UUID is added to the kernel command line in the bootloader configuration before you run Wic.

  • --system-id: This option is a Wic-specific option that specifies the partition system ID, which is a one byte long, hexadecimal parameter with or without the 0x prefix.

  • --mkfs-extraopts: This option specifies additional options to pass to the mkfs utility. Some default options for certain filesystems do not take effect. See Wic's help on kickstart (i.e. wic help kickstart).

9.3. Command: bootloader

This command specifies how the bootloader should be configured and supports the following options:

Note

Bootloader functionality and boot partitions are implemented by the various --source plug-ins that implement bootloader functionality. The bootloader command essentially provides a means of modifying bootloader configuration.

  • --timeout: Specifies the number of seconds before the bootloader times out and boots the default option.

  • --append: Specifies kernel parameters. These parameters will be added to the syslinux APPEND or grub kernel command line.

  • --configfile: Specifies a user-defined configuration file for the bootloader. You can provide a full pathname for the file or a file that exists in the canned-wks folder. This option overrides all other bootloader options.

Chapter 10. QA Error and Warning Messages

10.1. Introduction

When building a recipe, the OpenEmbedded build system performs various QA checks on the output to ensure that common issues are detected and reported. Sometimes when you create a new recipe to build new software, it will build with no problems. When this is not the case, or when you have QA issues building any software, it could take a little time to resolve them.

While it is tempting to ignore a QA message or even to disable QA checks, it is best to try and resolve any reported QA issues. This chapter provides a list of the QA messages and brief explanations of the issues you could encounter so that you can properly resolve problems.

The next section provides a list of all QA error and warning messages based on a default configuration. Each entry provides the message or error form along with an explanation.

Notes

  • At the end of each message, the name of the associated QA test (as listed in the "insane.bbclass" section) appears within square brackets.

  • As mentioned, this list of error and warning messages is for QA checks only. The list does not cover all possible build errors or warnings you could encounter.

  • Because some QA checks are disabled by default, this list does not include all possible QA check errors and warnings.

10.2. Errors and Warnings

  • <packagename>: <path> is using libexec please relocate to <libexecdir> [libexec]

    The specified package contains files in /usr/libexec when the distro configuration uses a different path for <libexecdir> By default, <libexecdir> is $prefix/libexec. However, this default can be changed (e.g. ${libdir}).

     

  • package <packagename> contains bad RPATH <rpath> in file <file> [rpaths]

    The specified binary produced by the recipe contains dynamic library load paths (rpaths) that contain build system paths such as TMPDIR, which are incorrect for the target and could potentially be a security issue. Check for bad -rpath options being passed to the linker in your do_compile log. Depending on the build system used by the software being built, there might be a configure option to disable rpath usage completely within the build of the software.

     

  • <packagename>: <file> contains probably-redundant RPATH <rpath> [useless-rpaths]

    The specified binary produced by the recipe contains dynamic library load paths (rpaths) that on a standard system are searched by default by the linker (e.g. /lib and /usr/lib). While these paths will not cause any breakage, they do waste space and are unnecessary. Depending on the build system used by the software being built, there might be a configure option to disable rpath usage completely within the build of the software.

     

  • <packagename> requires <files>, but no providers in its RDEPENDS [file-rdeps]

    A file-level dependency has been identified from the specified package on the specified files, but there is no explicit corresponding entry in RDEPENDS. If particular files are required at runtime then RDEPENDS should be declared in the recipe to ensure the packages providing them are built.

     

  • <packagename1> rdepends on <packagename2>, but it isn't a build dependency? [build-deps]

    A runtime dependency exists between the two specified packages, but there is nothing explicit within the recipe to enable the OpenEmbedded build system to ensure that dependency is satisfied. This condition is usually triggered by an RDEPENDS value being added at the packaging stage rather than up front, which is usually automatic based on the contents of the package. In most cases, you should change the recipe to add an explicit RDEPENDS for the dependency.

     

  • non -dev/-dbg/nativesdk- package contains symlink .so: <packagename> path '<path>' [dev-so]

    Symlink .so files are for development only, and should therefore go into the -dev package. This situation might occur if you add *.so* rather than *.so.* to a non-dev package. Change FILES (and possibly PACKAGES) such that the specified .so file goes into an appropriate -dev package.

     

  • non -staticdev package contains static .a library: <packagename> path '<path>' [staticdev]

    Static .a library files should go into a -staticdev package. Change FILES (and possibly PACKAGES) such that the specified .a file goes into an appropriate -staticdev package.

     

  • <packagename>: found library in wrong location [libdir]

    The specified file may have been installed into an incorrect (possibly hardcoded) installation path. For example, this test will catch recipes that install /lib/bar.so when ${base_libdir} is "lib32". Another example is when recipes install /usr/lib64/foo.so when ${libdir} is "/usr/lib". False positives occasionally exist. For these cases add "libdir" to INSANE_SKIP for the package.

     

  • non debug package contains .debug directory: <packagename> path <path> [debug-files]

    The specified package contains a .debug directory, which should not appear in anything but the -dbg package. This situation might occur if you add a path which contains a .debug directory and do not explicitly add the .debug directory to the -dbg package. If this is the case, add the .debug directory explicitly to FILES_${PN}-dbg. See FILES for additional information on FILES.

     

  • Architecture did not match (<machine_arch> to <file_arch>) on <file> [arch]

    By default, the OpenEmbedded build system checks the Executable and Linkable Format (ELF) type, bit size, and endianness of any binaries to ensure they match the target architecture. This test fails if any binaries do not match the type since there would be an incompatibility. The test could indicate that the wrong compiler or compiler options have been used. Sometimes software, like bootloaders, might need to bypass this check. If the file you receive the error for is firmware that is not intended to be executed within the target operating system or is intended to run on a separate processor within the device, you can add "arch" to INSANE_SKIP for the package. Another option is to check the do_compile log and verify that the compiler options being used are correct.

     

  • Bit size did not match (<machine_bits> to <file_bits>) <recipe> on <file> [arch]

    By default, the OpenEmbedded build system checks the Executable and Linkable Format (ELF) type, bit size, and endianness of any binaries to ensure they match the target architecture. This test fails if any binaries do not match the type since there would be an incompatibility. The test could indicate that the wrong compiler or compiler options have been used. Sometimes software, like bootloaders, might need to bypass this check. If the file you receive the error for is firmware that is not intended to be executed within the target operating system or is intended to run on a separate processor within the device, you can add "arch" to INSANE_SKIP for the package. Another option is to check the do_compile log and verify that the compiler options being used are correct.

     

  • Endianness did not match (<machine_endianness> to <file_endianness>) on <file> [arch]

    By default, the OpenEmbedded build system checks the Executable and Linkable Format (ELF) type, bit size, and endianness of any binaries to ensure they match the target architecture. This test fails if any binaries do not match the type since there would be an incompatibility. The test could indicate that the wrong compiler or compiler options have been used. Sometimes software, like bootloaders, might need to bypass this check. If the file you receive the error for is firmware that is not intended to be executed within the target operating system or is intended to run on a separate processor within the device, you can add "arch" to INSANE_SKIP for the package. Another option is to check the do_compile log and verify that the compiler options being used are correct.

     

  • ELF binary '<file>' has relocations in .text [textrel]

    The specified ELF binary contains relocations in its .text sections. This situation can result in a performance impact at runtime.

    Typically, the way to solve this performance issue is to add "-fPIC" or "-fpic" to the compiler command-line options. For example, given software that reads CFLAGS when you build it, you could add the following to your recipe:

         CFLAGS_append = " -fPIC "
                        

    For more information on text relocations at runtime, see http://www.akkadia.org/drepper/textrelocs.html.

     

  • No GNU_HASH in the elf binary: '<file>' [ldflags]

    This indicates that binaries produced when building the recipe have not been linked with the LDFLAGS options provided by the build system. Check to be sure that the LDFLAGS variable is being passed to the linker command. A common workaround for this situation is to pass in LDFLAGS using TARGET_CC_ARCH within the recipe as follows:

         TARGET_CC_ARCH += "${LDFLAGS}"
                        

     

  • Package <packagename> contains Xorg driver (<driver>) but no xorg-abi- dependencies [xorg-driver-abi]

    The specified package contains an Xorg driver, but does not have a corresponding ABI package dependency. The xserver-xorg recipe provides driver ABI names. All drivers should depend on the ABI versions that they have been built against. Driver recipes that include xorg-driver-input.inc or xorg-driver-video.inc will automatically get these versions. Consequently, you should only need to explicitly add dependencies to binary driver recipes.

     

  • The /usr/share/info/dir file is not meant to be shipped in a particular package. [infodir]

    The /usr/share/info/dir should not be packaged. Add the following line to your do_install task or to your do_install_append within the recipe as follows:

         rm ${D}${infodir}/dir
                        

     

  • Symlink <path> in <packagename> points to TMPDIR [symlink-to-sysroot]

    The specified symlink points into TMPDIR on the host. Such symlinks will work on the host. However, they are clearly invalid when running on the target. You should either correct the symlink to use a relative path or remove the symlink.

     

  • <file> failed sanity test (workdir) in path <path> [la]

    The specified .la file contains TMPDIR paths. Any .la file containing these paths is incorrect since libtool adds the correct sysroot prefix when using the files automatically itself.

     

  • <file> failed sanity test (tmpdir) in path <path> [pkgconfig]

    The specified .pc file contains TMPDIR/WORKDIR paths. Any .pc file containing these paths is incorrect since pkg-config itself adds the correct sysroot prefix when the files are accessed.

     

  • <packagename> rdepends on <debug_packagename> [debug-deps]

    A dependency exists between the specified non-dbg package (i.e. a package whose name does not end in -dbg) and a package that is a dbg package. The dbg packages contain debug symbols and are brought in using several different methods:

    • Using the dbg-pkgs IMAGE_FEATURES value.

    • Using IMAGE_INSTALL.

    • As a dependency of another dbg package that was brought in using one of the above methods.

    The dependency might have been automatically added because the dbg package erroneously contains files that it should not contain (e.g. a non-symlink .so file) or it might have been added manually (e.g. by adding to RDEPENDS).

     

  • <packagename> rdepends on <dev_packagename> [dev-deps]

    A dependency exists between the specified non-dev package (a package whose name does not end in -dev) and a package that is a dev package. The dev packages contain development headers and are usually brought in using several different methods:

    • Using the dev-pkgs IMAGE_FEATURES value.

    • Using IMAGE_INSTALL.

    • As a dependency of another dev package that was brought in using one of the above methods.

    The dependency might have been automatically added (because the dev package erroneously contains files that it should not have (e.g. a non-symlink .so file) or it might have been added manually (e.g. by adding to RDEPENDS).

     

  • <var>_<packagename> is invalid: <comparison> (<value>) only comparisons <, =, >, <=, and >= are allowed [dep-cmp]

    If you are adding a versioned dependency relationship to one of the dependency variables (RDEPENDS, RRECOMMENDS, RSUGGESTS, RPROVIDES, RREPLACES, or RCONFLICTS), you must only use the named comparison operators. Change the versioned dependency values you are adding to match those listed in the message.

     

  • <recipename>: The compile log indicates that host include and/or library paths were used. Please check the log '<logfile>' for more information. [compile-host-path]

    The log for the do_compile task indicates that paths on the host were searched for files, which is not appropriate when cross-compiling. Look for "is unsafe for cross-compilation" or "CROSS COMPILE Badness" in the specified log file.

     

  • <recipename>: The install log indicates that host include and/or library paths were used. Please check the log '<logfile>' for more information. [install-host-path]

    The log for the do_install task indicates that paths on the host were searched for files, which is not appropriate when cross-compiling. Look for "is unsafe for cross-compilation" or "CROSS COMPILE Badness" in the specified log file.

     

  • This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities. Rerun configure task after fixing this. The path was '<path>'

    The log for the do_configure task indicates that paths on the host were searched for files, which is not appropriate when cross-compiling. Look for "is unsafe for cross-compilation" or "CROSS COMPILE Badness" in the specified log file.

     

  • <packagename> doesn't match the [a-z0-9.+-]+ regex [pkgname]

    The convention within the OpenEmbedded build system (sometimes enforced by the package manager itself) is to require that package names are all lower case and to allow a restricted set of characters. If your recipe name does not match this, or you add packages to PACKAGES that do not conform to the convention, then you will receive this error. Rename your recipe. Or, if you have added a non-conforming package name to PACKAGES, change the package name appropriately.

     

  • <recipe>: configure was passed unrecognized options: <options> [unknown-configure-option]

    The configure script is reporting that the specified options are unrecognized. This situation could be because the options were previously valid but have been removed from the configure script. Or, there was a mistake when the options were added and there is another option that should be used instead. If you are unsure, consult the upstream build documentation, the ./configure --help output, and the upstream change log or release notes. Once you have worked out what the appropriate change is, you can update EXTRA_OECONF, PACKAGECONFIG_CONFARGS, or the individual PACKAGECONFIG option values accordingly.

     

  • Recipe <recipefile> has PN of "<recipename>" which is in OVERRIDES, this can result in unexpected behavior. [pn-overrides]

    The specified recipe has a name (PN) value that appears in OVERRIDES. If a recipe is named such that its PN value matches something already in OVERRIDES (e.g. PN happens to be the same as MACHINE or DISTRO), it can have unexpected consequences. For example, assignments such as FILES_${PN} = "xyz" effectively turn into FILES = "xyz". Rename your recipe (or if PN is being set explicitly, change the PN value) so that the conflict does not occur. See FILES for additional information.

     

  • <recipefile>: Variable <variable> is set as not being package specific, please fix this. [pkgvarcheck]

    Certain variables (RDEPENDS, RRECOMMENDS, RSUGGESTS, RCONFLICTS, RPROVIDES, RREPLACES, FILES, pkg_preinst, pkg_postinst, pkg_prerm, pkg_postrm, and ALLOW_EMPTY) should always be set specific to a package (i.e. they should be set with a package name override such as RDEPENDS_${PN} = "value" rather than RDEPENDS = "value"). If you receive this error, correct any assignments to these variables within your recipe.

     

  • File '<file>' from <recipename> was already stripped, this will prevent future debugging! [already-stripped]

    Produced binaries have already been stripped prior to the build system extracting debug symbols. It is common for upstream software projects to default to stripping debug symbols for output binaries. In order for debugging to work on the target using -dbg packages, this stripping must be disabled.

    Depending on the build system used by the software being built, disabling this stripping could be as easy as specifying an additional configure option. If not, disabling stripping might involve patching the build scripts. In the latter case, look for references to "strip" or "STRIP", or the "-s" or "-S" command-line options being specified on the linker command line (possibly through the compiler command line if preceded with "-Wl,").

    Note