migration-2.2.rst 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Release 2.2 (morty)
  3. ===================
  4. This section provides migration information for moving to the Yocto
  5. Project 2.2 Release (codename "morty") from the prior release.
  6. .. _migration-2.2-minimum-kernel-version:
  7. Minimum Kernel Version
  8. ----------------------
  9. The minimum kernel version for the target system and for SDK is now
  10. 3.2.0, due to the upgrade to ``glibc 2.24``. Specifically, for
  11. AArch64-based targets the version is 3.14. For Nios II-based targets,
  12. the minimum kernel version is 3.19.
  13. .. note::
  14. For x86 and x86_64, you can reset :term:`OLDEST_KERNEL`
  15. to anything down to 2.6.32 if desired.
  16. .. _migration-2.2-staging-directories-in-sysroot-simplified:
  17. Staging Directories in Sysroot Has Been Simplified
  18. --------------------------------------------------
  19. The way directories are staged in sysroot has been simplified and
  20. introduces the new :term:`SYSROOT_DIRS`,
  21. :term:`SYSROOT_DIRS_NATIVE`, and ``SYSROOT_DIRS_BLACKLIST``
  22. (replaced by :term:`SYSROOT_DIRS_IGNORE` in version 3.5). See the
  23. :oe_lists:`v2 patch series on the OE-Core Mailing List
  24. </pipermail/openembedded-core/2016-May/121365.html>`
  25. for additional information.
  26. .. _migration-2.2-removal-of-old-images-from-tmp-deploy-now-enabled:
  27. Removal of Old Images and Other Files in ``tmp/deploy`` Now Enabled
  28. -------------------------------------------------------------------
  29. Removal of old images and other files in ``tmp/deploy/`` is now enabled
  30. by default due to a new staging method used for those files. As a result
  31. of this change, the ``RM_OLD_IMAGE`` variable is now redundant.
  32. .. _migration-2.2-python-changes:
  33. Python Changes
  34. --------------
  35. The following changes for Python occurred:
  36. .. _migration-2.2-bitbake-now-requires-python-3.4:
  37. BitBake Now Requires Python 3.4+
  38. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  39. BitBake requires Python 3.4 or greater.
  40. .. _migration-2.2-utf-8-locale-required-on-build-host:
  41. UTF-8 Locale Required on Build Host
  42. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  43. A UTF-8 locale is required on the build host due to Python 3. Since
  44. C.UTF-8 is not a standard, the default is en_US.UTF-8.
  45. .. _migration-2.2-metadata-now-must-use-python-3-syntax:
  46. Metadata Must Now Use Python 3 Syntax
  47. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  48. The metadata is now required to use Python 3 syntax. For help preparing
  49. metadata, see any of the many Python 3 porting guides available.
  50. Alternatively, you can reference the conversion commits for BitBake and
  51. you can use :term:`OpenEmbedded-Core (OE-Core)` as a guide for changes. Following are
  52. particular areas of interest:
  53. - subprocess command-line pipes needing locale decoding
  54. - the syntax for octal values changed
  55. - the ``iter*()`` functions changed name
  56. - iterators now return views, not lists
  57. - changed names for Python modules
  58. .. _migration-2.2-target-python-recipes-switched-to-python-3:
  59. Target Python Recipes Switched to Python 3
  60. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  61. Most target Python recipes have now been switched to Python 3.
  62. Unfortunately, systems using RPM as a package manager and providing
  63. online package-manager support through SMART still require Python 2.
  64. .. note::
  65. Python 2 and recipes that use it can still be built for the target as
  66. with previous versions.
  67. .. _migration-2.2-buildtools-tarball-includes-python-3:
  68. ``buildtools-tarball`` Includes Python 3
  69. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  70. ``buildtools-tarball`` now includes Python 3.
  71. .. _migration-2.2-uclibc-replaced-by-musl:
  72. uClibc Replaced by musl
  73. -----------------------
  74. uClibc has been removed in favor of musl. Musl has matured, is better
  75. maintained, and is compatible with a wider range of applications as
  76. compared to uClibc.
  77. .. _migration-2.2-B-no-longer-default-working-directory-for-tasks:
  78. ``${B}`` No Longer Default Working Directory for Tasks
  79. ------------------------------------------------------
  80. ``${``\ :term:`B`\ ``}`` is no longer the default working
  81. directory for tasks. Consequently, any custom tasks you define now need
  82. to either have the
  83. ``[``\ :ref:`dirs <bitbake:bitbake-user-manual/bitbake-user-manual-metadata:variable flags>`\ ``]`` flag
  84. set, or the task needs to change into the appropriate working directory
  85. manually (e.g using ``cd`` for a shell task).
  86. .. note::
  87. The preferred method is to use the
  88. [dirs]
  89. flag.
  90. .. _migration-2.2-runqemu-ported-to-python:
  91. ``runqemu`` Ported to Python
  92. ----------------------------
  93. ``runqemu`` has been ported to Python and has changed behavior in some
  94. cases. Previous usage patterns continue to be supported.
  95. The new ``runqemu`` is a Python script. Machine knowledge is no longer
  96. hardcoded into ``runqemu``. You can choose to use the ``qemuboot``
  97. configuration file to define the BSP's own arguments and to make it
  98. bootable with ``runqemu``. If you use a configuration file, use the
  99. following form::
  100. image-name-machine.qemuboot.conf
  101. The configuration file
  102. enables fine-grained tuning of options passed to QEMU without the
  103. ``runqemu`` script hard-coding any knowledge about different machines.
  104. Using a configuration file is particularly convenient when trying to use
  105. QEMU with machines other than the ``qemu*`` machines in
  106. :term:`OpenEmbedded-Core (OE-Core)`. The ``qemuboot.conf`` file is generated by the
  107. ``qemuboot`` class when the root filesystem is being built (i.e. build
  108. rootfs). QEMU boot arguments can be set in BSP's configuration file and
  109. the ``qemuboot`` class will save them to ``qemuboot.conf``.
  110. If you want to use ``runqemu`` without a configuration file, use the
  111. following command form::
  112. $ runqemu machine rootfs kernel [options]
  113. Supported machines are as follows:
  114. - qemuarm
  115. - qemuarm64
  116. - qemux86
  117. - qemux86-64
  118. - qemuppc
  119. - qemumips
  120. - qemumips64
  121. - qemumipsel
  122. - qemumips64el
  123. Consider the
  124. following example, which uses the ``qemux86-64`` machine, provides a
  125. root filesystem, provides an image, and uses the ``nographic`` option::
  126. $ runqemu qemux86-64 tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.ext4 tmp/deploy/images/qemux86-64/bzImage nographic
  127. Following is a list of variables that can be set in configuration files
  128. such as ``bsp.conf`` to enable the BSP to be booted by ``runqemu``:
  129. .. note::
  130. "QB" means "QEMU Boot".
  131. ::
  132. QB_SYSTEM_NAME: QEMU name (e.g. "qemu-system-i386")
  133. QB_OPT_APPEND: Options to append to QEMU (e.g. "-show-cursor")
  134. QB_DEFAULT_KERNEL: Default kernel to boot (e.g. "bzImage")
  135. QB_DEFAULT_FSTYPE: Default FSTYPE to boot (e.g. "ext4")
  136. QB_MEM: Memory (e.g. "-m 512")
  137. QB_MACHINE: QEMU machine (e.g. "-machine virt")
  138. QB_CPU: QEMU cpu (e.g. "-cpu qemu32")
  139. QB_CPU_KVM: Similar to QB_CPU except used for kvm support (e.g. "-cpu kvm64")
  140. QB_KERNEL_CMDLINE_APPEND: Options to append to the kernel's -append
  141. option (e.g. "console=ttyS0 console=tty")
  142. QB_DTB: QEMU dtb name
  143. QB_AUDIO_DRV: QEMU audio driver (e.g. "alsa", set it when support audio)
  144. QB_AUDIO_OPT: QEMU audio option (e.g. "-soundhw ac97,es1370"), which is used
  145. when QB_AUDIO_DRV is set.
  146. QB_KERNEL_ROOT: Kernel's root (e.g. /dev/vda)
  147. QB_TAP_OPT: Network option for 'tap' mode (e.g.
  148. "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -device virtio-net-device,netdev=net0").
  149. runqemu will replace "@TAP@" with the one that is used, such as tap0, tap1 ...
  150. QB_SLIRP_OPT: Network option for SLIRP mode (e.g. "-netdev user,id=net0 -device virtio-net-device,netdev=net0")
  151. QB_ROOTFS_OPT: Used as rootfs (e.g.
  152. "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0").
  153. runqemu will replace "@ROOTFS@" with the one which is used, such as
  154. core-image-minimal-qemuarm64.ext4.
  155. QB_SERIAL_OPT: Serial port (e.g. "-serial mon:stdio")
  156. QB_TCPSERIAL_OPT: tcp serial port option (e.g.
  157. " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
  158. runqemu will replace "@PORT@" with the port number which is used.
  159. To use ``runqemu``, set :term:`IMAGE_CLASSES` as
  160. follows and run ``runqemu``:
  161. .. note::
  162. For command-line syntax, use ``runqemu help``.
  163. ::
  164. IMAGE_CLASSES += "qemuboot"
  165. .. _migration-2.2-default-linker-hash-style-changed:
  166. Default Linker Hash Style Changed
  167. ---------------------------------
  168. The default linker hash style for ``gcc-cross`` is now "sysv" in order
  169. to catch recipes that are building software without using the
  170. OpenEmbedded :term:`LDFLAGS`. This change could result in
  171. seeing some "No GNU_HASH in the elf binary" QA issues when building such
  172. recipes. You need to fix these recipes so that they use the expected
  173. :term:`LDFLAGS`. Depending on how the software is built, the build system
  174. used by the software (e.g. a Makefile) might need to be patched.
  175. However, sometimes making this fix is as simple as adding the following
  176. to the recipe::
  177. TARGET_CC_ARCH += "${LDFLAGS}"
  178. .. _migration-2.2-kernel-image-base-name-no-longer-uses-kernel-imagetype:
  179. ``KERNEL_IMAGE_BASE_NAME`` no Longer Uses ``KERNEL_IMAGETYPE``
  180. --------------------------------------------------------------
  181. The ``KERNEL_IMAGE_BASE_NAME`` variable no longer uses the
  182. :term:`KERNEL_IMAGETYPE` variable to create the
  183. image's base name. Because the OpenEmbedded build system can now build
  184. multiple kernel image types, this part of the kernel image base name as
  185. been removed leaving only the following::
  186. KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
  187. If you have recipes or
  188. classes that use ``KERNEL_IMAGE_BASE_NAME`` directly, you might need to
  189. update the references to ensure they continue to work.
  190. .. _migration-2.2-imgdeploydir-replaces-deploy-dir-image-for-most-use-cases:
  191. ``IMGDEPLOYDIR`` Replaces ``DEPLOY_DIR_IMAGE`` for Most Use Cases
  192. -----------------------------------------------------------------
  193. The :term:`IMGDEPLOYDIR` variable was introduced to allow sstate caching of
  194. image creation results. Image recipes defining custom :term:`IMAGE_CMD` or
  195. doing postprocessing on the generated images need to be adapted to use
  196. :term:`IMGDEPLOYDIR` instead of :term:`DEPLOY_DIR_IMAGE`. :term:`IMAGE_MANIFEST`
  197. creation and symlinking of the most recent image file will fail otherwise.
  198. .. _migration-2.2-bitbake-changes:
  199. BitBake Changes
  200. ---------------
  201. The following changes took place for BitBake:
  202. - The "goggle" UI and standalone image-writer tool have been removed as
  203. they both require GTK+ 2.0 and were not being maintained.
  204. - The Perforce fetcher now supports :term:`SRCREV` for
  205. specifying the source revision to use, be it
  206. ``${``\ :term:`AUTOREV`\ ``}``, changelist number,
  207. p4date, or label, in preference to separate
  208. :term:`SRC_URI` parameters to specify these. This
  209. change is more in-line with how the other fetchers work for source
  210. control systems. Recipes that fetch from Perforce will need to be
  211. updated to use :term:`SRCREV` in place of specifying the source revision
  212. within :term:`SRC_URI`.
  213. - Some of BitBake's internal code structures for accessing the recipe
  214. cache needed to be changed to support the new multi-configuration
  215. functionality. These changes will affect external tools that use
  216. BitBake's tinfoil module. For information on these changes, see the
  217. changes made to the scripts supplied with OpenEmbedded-Core:
  218. :yocto_git:`1 </poky/commit/?id=189371f8393971d00bca0fceffd67cc07784f6ee>`
  219. and
  220. :yocto_git:`2 </poky/commit/?id=4a5aa7ea4d07c2c90a1654b174873abb018acc67>`.
  221. - The task management code has been rewritten to avoid using ID
  222. indirection in order to improve performance. This change is unlikely
  223. to cause any problems for most users. However, the setscene
  224. verification function as pointed to by
  225. ``BB_SETSCENE_VERIFY_FUNCTION`` needed to change signature.
  226. Consequently, a new variable named ``BB_SETSCENE_VERIFY_FUNCTION2``
  227. has been added allowing multiple versions of BitBake to work with
  228. suitably written metadata, which includes OpenEmbedded-Core and Poky.
  229. Anyone with custom BitBake task scheduler code might also need to
  230. update the code to handle the new structure.
  231. .. _migration-2.2-swabber-has-been-removed:
  232. Swabber has Been Removed
  233. ------------------------
  234. Swabber, a tool that was intended to detect host contamination in the
  235. build process, has been removed, as it has been unmaintained and unused
  236. for some time and was never particularly effective. The OpenEmbedded
  237. build system has since incorporated a number of mechanisms including
  238. enhanced QA checks that mean that there is less of a need for such a
  239. tool.
  240. .. _migration-2.2-removed-recipes:
  241. Removed Recipes
  242. ---------------
  243. The following recipes have been removed:
  244. - ``augeas``: No longer needed and has been moved to ``meta-oe``.
  245. - ``directfb``: Unmaintained and has been moved to ``meta-oe``.
  246. - ``gcc``: Removed 4.9 version. Versions 5.4 and 6.2 are still present.
  247. - ``gnome-doc-utils``: No longer needed.
  248. - ``gtk-doc-stub``: Replaced by ``gtk-doc``.
  249. - ``gtk-engines``: No longer needed and has been moved to
  250. ``meta-gnome``.
  251. - ``gtk-sato-engine``: Became obsolete.
  252. - ``libglade``: No longer needed and has been moved to ``meta-oe``.
  253. - ``libmad``: Unmaintained and functionally replaced by ``libmpg123``.
  254. ``libmad`` has been moved to ``meta-oe``.
  255. - ``libowl``: Became obsolete.
  256. - ``libxsettings-client``: No longer needed.
  257. - ``oh-puzzles``: Functionally replaced by ``puzzles``.
  258. - ``oprofileui``: Became obsolete. OProfile has been largely supplanted
  259. by perf.
  260. - ``packagegroup-core-directfb.bb``: Removed.
  261. - ``core-image-directfb.bb``: Removed.
  262. - ``pointercal``: No longer needed and has been moved to ``meta-oe``.
  263. - ``python-imaging``: No longer needed and moved to ``meta-python``
  264. - ``python-pyrex``: No longer needed and moved to ``meta-python``.
  265. - ``sato-icon-theme``: Became obsolete.
  266. - ``swabber-native``: Swabber has been removed. See the :ref:`entry on
  267. Swabber <migration-guides/migration-2.2:swabber has been removed>`.
  268. - ``tslib``: No longer needed and has been moved to ``meta-oe``.
  269. - ``uclibc``: Removed in favor of musl.
  270. - ``xtscal``: No longer needed and moved to ``meta-oe``
  271. .. _migration-2.2-removed-classes:
  272. Removed Classes
  273. ---------------
  274. The following classes have been removed:
  275. - ``distutils-native-base``: No longer needed.
  276. - ``distutils3-native-base``: No longer needed.
  277. - ``sdl``: Only set :term:`DEPENDS` and
  278. :term:`SECTION`, which are better set within the
  279. recipe instead.
  280. - ``sip``: Mostly unused.
  281. - ``swabber``: See the :ref:`entry on
  282. Swabber <migration-guides/migration-2.2:swabber has been removed>`.
  283. .. _migration-2.2-minor-packaging-changes:
  284. Minor Packaging Changes
  285. -----------------------
  286. The following minor packaging changes have occurred:
  287. - ``grub``: Split ``grub-editenv`` into its own package.
  288. - ``systemd``: Split container and vm related units into a new package,
  289. systemd-container.
  290. - ``util-linux``: Moved ``prlimit`` to a separate
  291. ``util-linux-prlimit`` package.
  292. .. _migration-2.2-miscellaneous-changes:
  293. Miscellaneous Changes
  294. ---------------------
  295. The following miscellaneous changes have occurred:
  296. - ``package_regex.inc``: Removed because the definitions
  297. ``package_regex.inc`` previously contained have been moved to their
  298. respective recipes.
  299. - Both ``devtool add`` and ``recipetool create`` now use a fixed
  300. :term:`SRCREV` by default when fetching from a Git
  301. repository. You can override this in either case to use
  302. ``${``\ :term:`AUTOREV`\ ``}`` instead by using the
  303. ``-a`` or ``--autorev`` command-line option
  304. - ``distcc``: GTK+ UI is now disabled by default.
  305. - ``packagegroup-core-tools-testapps``: Removed Piglit.
  306. - :ref:`ref-classes-image`: Renamed COMPRESS(ION) to CONVERSION. This change
  307. means that ``COMPRESSIONTYPES``, ``COMPRESS_DEPENDS`` and
  308. ``COMPRESS_CMD`` are deprecated in favor of ``CONVERSIONTYPES``,
  309. ``CONVERSION_DEPENDS`` and :term:`CONVERSION_CMD`. The ``COMPRESS*``
  310. variable names will still work in the 2.2 release but metadata that
  311. does not need to be backwards-compatible should be changed to use the
  312. new names as the ``COMPRESS*`` ones will be removed in a future
  313. release.
  314. - ``gtk-doc``: A full version of ``gtk-doc`` is now made available.
  315. However, some old software might not be capable of using the current
  316. version of ``gtk-doc`` to build documentation. You need to change
  317. recipes that build such software so that they explicitly disable
  318. building documentation with ``gtk-doc``.