migration-2.2.rst 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  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 4.0). 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.
  52. Particular areas of interest are:
  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. The :term:`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 directory for tasks.
  81. Consequently, any custom tasks you define now need to either have the
  82. ``[``\ :ref:`dirs <bitbake-user-manual/bitbake-user-manual-metadata:variable flags>`\ ``]``
  83. flag set, or the task needs to change into the appropriate working directory
  84. manually (e.g using ``cd`` for a shell task).
  85. .. note::
  86. The preferred method is to use the
  87. [dirs]
  88. flag.
  89. .. _migration-2.2-runqemu-ported-to-python:
  90. ``runqemu`` Ported to Python
  91. ----------------------------
  92. ``runqemu`` has been ported to Python and has changed behavior in some
  93. cases. Previous usage patterns continue to be supported.
  94. The new ``runqemu`` is a Python script. Machine knowledge is no longer
  95. hardcoded into ``runqemu``. You can choose to use the ``qemuboot``
  96. configuration file to define the BSP's own arguments and to make it
  97. bootable with ``runqemu``. If you use a configuration file, use the
  98. following form::
  99. image-name-machine.qemuboot.conf
  100. The configuration file
  101. enables fine-grained tuning of options passed to QEMU without the
  102. ``runqemu`` script hard-coding any knowledge about different machines.
  103. Using a configuration file is particularly convenient when trying to use
  104. QEMU with machines other than the ``qemu*`` machines in
  105. :term:`OpenEmbedded-Core (OE-Core)`. The ``qemuboot.conf`` file is generated by the
  106. ``qemuboot`` class when the root filesystem is being built (i.e. build
  107. rootfs). QEMU boot arguments can be set in BSP's configuration file and
  108. the ``qemuboot`` class will save them to ``qemuboot.conf``.
  109. If you want to use ``runqemu`` without a configuration file, use the
  110. following command form::
  111. $ runqemu machine rootfs kernel [options]
  112. Supported machines are as follows:
  113. - qemuarm
  114. - qemuarm64
  115. - qemux86
  116. - qemux86-64
  117. - qemuppc
  118. - qemumips
  119. - qemumips64
  120. - qemumipsel
  121. - qemumips64el
  122. Consider the
  123. following example, which uses the ``qemux86-64`` machine, provides a
  124. root filesystem, provides an image, and uses the ``nographic`` option::
  125. $ runqemu qemux86-64 tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.ext4 tmp/deploy/images/qemux86-64/bzImage nographic
  126. Here is a list of variables that can be set in configuration files
  127. such as ``bsp.conf`` to enable the BSP to be booted by ``runqemu``::
  128. QB_SYSTEM_NAME: QEMU name (e.g. "qemu-system-i386")
  129. QB_OPT_APPEND: Options to append to QEMU (e.g. "-show-cursor")
  130. QB_DEFAULT_KERNEL: Default kernel to boot (e.g. "bzImage")
  131. QB_DEFAULT_FSTYPE: Default FSTYPE to boot (e.g. "ext4")
  132. QB_MEM: Memory (e.g. "-m 512")
  133. QB_MACHINE: QEMU machine (e.g. "-machine virt")
  134. QB_CPU: QEMU cpu (e.g. "-cpu qemu32")
  135. QB_CPU_KVM: Similar to QB_CPU except used for kvm support (e.g. "-cpu kvm64")
  136. QB_KERNEL_CMDLINE_APPEND: Options to append to the kernel's -append
  137. option (e.g. "console=ttyS0 console=tty")
  138. QB_DTB: QEMU dtb name
  139. QB_AUDIO_DRV: QEMU audio driver (e.g. "alsa", set it when support audio)
  140. QB_AUDIO_OPT: QEMU audio option (e.g. "-soundhw ac97,es1370"), which is used
  141. when QB_AUDIO_DRV is set.
  142. QB_KERNEL_ROOT: Kernel's root (e.g. /dev/vda)
  143. QB_TAP_OPT: Network option for 'tap' mode (e.g.
  144. "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -device virtio-net-device,netdev=net0").
  145. runqemu will replace "@TAP@" with the one that is used, such as tap0, tap1 ...
  146. QB_SLIRP_OPT: Network option for SLIRP mode (e.g. "-netdev user,id=net0 -device virtio-net-device,netdev=net0")
  147. QB_ROOTFS_OPT: Used as rootfs (e.g.
  148. "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0").
  149. runqemu will replace "@ROOTFS@" with the one which is used, such as
  150. core-image-minimal-qemuarm64.ext4.
  151. QB_SERIAL_OPT: Serial port (e.g. "-serial mon:stdio")
  152. QB_TCPSERIAL_OPT: tcp serial port option (e.g.
  153. " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
  154. runqemu will replace "@PORT@" with the port number which is used.
  155. To use ``runqemu``, set :term:`IMAGE_CLASSES` as
  156. follows and run ``runqemu``:
  157. .. note::
  158. "QB" means "QEMU Boot".
  159. .. note::
  160. For command-line syntax, use ``runqemu help``.
  161. ::
  162. IMAGE_CLASSES += "qemuboot"
  163. .. _migration-2.2-default-linker-hash-style-changed:
  164. Default Linker Hash Style Changed
  165. ---------------------------------
  166. The default linker hash style for ``gcc-cross`` is now "sysv" in order
  167. to catch recipes that are building software without using the
  168. OpenEmbedded :term:`LDFLAGS`. This change could result in
  169. seeing some "No GNU_HASH in the elf binary" QA issues when building such
  170. recipes. You need to fix these recipes so that they use the expected
  171. :term:`LDFLAGS`. Depending on how the software is built, the build system
  172. used by the software (e.g. a Makefile) might need to be patched.
  173. However, sometimes making this fix is as simple as adding the following
  174. to the recipe::
  175. TARGET_CC_ARCH += "${LDFLAGS}"
  176. .. _migration-2.2-kernel-image-base-name-no-longer-uses-kernel-imagetype:
  177. ``KERNEL_IMAGE_BASE_NAME`` no Longer Uses ``KERNEL_IMAGETYPE``
  178. --------------------------------------------------------------
  179. The ``KERNEL_IMAGE_BASE_NAME`` variable no longer uses the
  180. :term:`KERNEL_IMAGETYPE` variable to create the
  181. image's base name. Because the OpenEmbedded build system can now build
  182. multiple kernel image types, this part of the kernel image base name as
  183. been removed leaving only the following::
  184. KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
  185. If you have recipes or
  186. classes that use ``KERNEL_IMAGE_BASE_NAME`` directly, you might need to
  187. update the references to ensure they continue to work.
  188. .. _migration-2.2-imgdeploydir-replaces-deploy-dir-image-for-most-use-cases:
  189. ``IMGDEPLOYDIR`` Replaces ``DEPLOY_DIR_IMAGE`` for Most Use Cases
  190. -----------------------------------------------------------------
  191. The :term:`IMGDEPLOYDIR` variable was introduced to allow sstate caching of
  192. image creation results. Image recipes defining custom :term:`IMAGE_CMD` or
  193. doing postprocessing on the generated images need to be adapted to use
  194. :term:`IMGDEPLOYDIR` instead of :term:`DEPLOY_DIR_IMAGE`. :term:`IMAGE_MANIFEST`
  195. creation and symlinking of the most recent image file will fail otherwise.
  196. .. _migration-2.2-bitbake-changes:
  197. BitBake Changes
  198. ---------------
  199. The following changes took place for BitBake:
  200. - The "goggle" UI and standalone image-writer tool have been removed as
  201. they both require GTK+ 2.0 and were not being maintained.
  202. - The Perforce fetcher now supports :term:`SRCREV` for
  203. specifying the source revision to use, be it
  204. ``${``\ :term:`AUTOREV`\ ``}``, changelist number,
  205. p4date, or label, in preference to separate
  206. :term:`SRC_URI` parameters to specify these. This
  207. change is more in-line with how the other fetchers work for source
  208. control systems. Recipes that fetch from Perforce will need to be
  209. updated to use :term:`SRCREV` in place of specifying the source revision
  210. within :term:`SRC_URI`.
  211. - Some of BitBake's internal code structures for accessing the recipe
  212. cache needed to be changed to support the new multi-configuration
  213. functionality. These changes will affect external tools that use
  214. BitBake's tinfoil module. For information on these changes, see the
  215. changes made to the scripts supplied with OpenEmbedded-Core:
  216. :yocto_git:`1 </poky/commit/?id=189371f8393971d00bca0fceffd67cc07784f6ee>`
  217. and
  218. :yocto_git:`2 </poky/commit/?id=4a5aa7ea4d07c2c90a1654b174873abb018acc67>`.
  219. - The task management code has been rewritten to avoid using ID
  220. indirection in order to improve performance. This change is unlikely
  221. to cause any problems for most users. However, the setscene
  222. verification function as pointed to by
  223. ``BB_SETSCENE_VERIFY_FUNCTION`` needed to change signature.
  224. Consequently, a new variable named ``BB_SETSCENE_VERIFY_FUNCTION2``
  225. has been added allowing multiple versions of BitBake to work with
  226. suitably written metadata, which includes OpenEmbedded-Core and Poky.
  227. Anyone with custom BitBake task scheduler code might also need to
  228. update the code to handle the new structure.
  229. .. _migration-2.2-swabber-has-been-removed:
  230. Swabber has Been Removed
  231. ------------------------
  232. Swabber, a tool that was intended to detect host contamination in the
  233. build process, has been removed, as it has been unmaintained and unused
  234. for some time and was never particularly effective. The OpenEmbedded
  235. build system has since incorporated a number of mechanisms including
  236. enhanced QA checks that mean that there is less of a need for such a
  237. tool.
  238. .. _migration-2.2-removed-recipes:
  239. Removed Recipes
  240. ---------------
  241. The following recipes have been removed:
  242. - ``augeas``: No longer needed and has been moved to ``meta-oe``.
  243. - ``directfb``: Unmaintained and has been moved to ``meta-oe``.
  244. - ``gcc``: Removed 4.9 version. Versions 5.4 and 6.2 are still present.
  245. - ``gnome-doc-utils``: No longer needed.
  246. - ``gtk-doc-stub``: Replaced by ``gtk-doc``.
  247. - ``gtk-engines``: No longer needed and has been moved to
  248. ``meta-gnome``.
  249. - ``gtk-sato-engine``: Became obsolete.
  250. - ``libglade``: No longer needed and has been moved to ``meta-oe``.
  251. - ``libmad``: Unmaintained and functionally replaced by ``libmpg123``.
  252. ``libmad`` has been moved to ``meta-oe``.
  253. - ``libowl``: Became obsolete.
  254. - ``libxsettings-client``: No longer needed.
  255. - ``oh-puzzles``: Functionally replaced by ``puzzles``.
  256. - ``oprofileui``: Became obsolete. OProfile has been largely supplanted
  257. by perf.
  258. - ``packagegroup-core-directfb.bb``: Removed.
  259. - ``core-image-directfb.bb``: Removed.
  260. - ``pointercal``: No longer needed and has been moved to ``meta-oe``.
  261. - ``python-imaging``: No longer needed and moved to ``meta-python``
  262. - ``python-pyrex``: No longer needed and moved to ``meta-python``.
  263. - ``sato-icon-theme``: Became obsolete.
  264. - ``swabber-native``: Swabber has been removed. See the :ref:`entry on
  265. Swabber <migration-guides/migration-2.2:swabber has been removed>`.
  266. - ``tslib``: No longer needed and has been moved to ``meta-oe``.
  267. - ``uclibc``: Removed in favor of musl.
  268. - ``xtscal``: No longer needed and moved to ``meta-oe``
  269. .. _migration-2.2-removed-classes:
  270. Removed Classes
  271. ---------------
  272. The following classes have been removed:
  273. - ``distutils-native-base``: No longer needed.
  274. - ``distutils3-native-base``: No longer needed.
  275. - ``sdl``: Only set :term:`DEPENDS` and
  276. :term:`SECTION`, which are better set within the
  277. recipe instead.
  278. - ``sip``: Mostly unused.
  279. - ``swabber``: See the :ref:`entry on
  280. Swabber <migration-guides/migration-2.2:swabber has been removed>`.
  281. .. _migration-2.2-minor-packaging-changes:
  282. Minor Packaging Changes
  283. -----------------------
  284. The following minor packaging changes have occurred:
  285. - ``grub``: Split ``grub-editenv`` into its own package.
  286. - ``systemd``: Split container and vm related units into a new package,
  287. systemd-container.
  288. - ``util-linux``: Moved ``prlimit`` to a separate
  289. ``util-linux-prlimit`` package.
  290. .. _migration-2.2-miscellaneous-changes:
  291. Miscellaneous Changes
  292. ---------------------
  293. The following miscellaneous changes have occurred:
  294. - ``package_regex.inc``: Removed because the definitions
  295. ``package_regex.inc`` previously contained have been moved to their
  296. respective recipes.
  297. - Both ``devtool add`` and ``recipetool create`` now use a fixed
  298. :term:`SRCREV` by default when fetching from a Git
  299. repository. You can override this in either case to use
  300. ``${``\ :term:`AUTOREV`\ ``}`` instead by using the
  301. ``-a`` or ``--autorev`` command-line option
  302. - ``distcc``: GTK+ UI is now disabled by default.
  303. - ``packagegroup-core-tools-testapps``: Removed Piglit.
  304. - :ref:`ref-classes-image`: Renamed COMPRESS(ION) to CONVERSION. This change
  305. means that ``COMPRESSIONTYPES``, ``COMPRESS_DEPENDS`` and
  306. ``COMPRESS_CMD`` are deprecated in favor of ``CONVERSIONTYPES``,
  307. ``CONVERSION_DEPENDS`` and :term:`CONVERSION_CMD`. The ``COMPRESS*``
  308. variable names will still work in the 2.2 release but metadata that
  309. does not need to be backwards-compatible should be changed to use the
  310. new names as the ``COMPRESS*`` ones will be removed in a future
  311. release.
  312. - ``gtk-doc``: A full version of ``gtk-doc`` is now made available.
  313. However, some old software might not be capable of using the current
  314. version of ``gtk-doc`` to build documentation. You need to change
  315. recipes that build such software so that they explicitly disable
  316. building documentation with ``gtk-doc``.