migration-2.1.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Release 2.1 (krogoth)
  3. =====================
  4. This section provides migration information for moving to the Yocto
  5. Project 2.1 Release (codename "krogoth") from the prior release.
  6. .. _migration-2.1-variable-expansion-in-python-functions:
  7. Variable Expansion in Python Functions
  8. --------------------------------------
  9. Variable expressions, such as ``${VARNAME}`` no longer expand
  10. automatically within Python functions. Suppressing expansion was done to
  11. allow Python functions to construct shell scripts or other code for
  12. situations in which you do not want such expressions expanded. For any
  13. existing code that relies on these expansions, you need to change the
  14. expansions to expand the value of individual variables through
  15. ``d.getVar()``. To alternatively expand more complex expressions, use
  16. ``d.expand()``.
  17. .. _migration-2.1-overrides-must-now-be-lower-case:
  18. Overrides Must Now be Lower-Case
  19. --------------------------------
  20. The convention for overrides has always been for them to be lower-case
  21. characters. This practice is now a requirement as BitBake's datastore
  22. now assumes lower-case characters in order to give a slight performance
  23. boost during parsing. In practical terms, this requirement means that
  24. anything that ends up in :term:`OVERRIDES` must now
  25. appear in lower-case characters (e.g. values for :term:`MACHINE`,
  26. :term:`TARGET_ARCH`, :term:`DISTRO`, and also recipe names if
  27. ``_pn-``\ recipename overrides are to be effective).
  28. .. _migration-2.1-expand-parameter-to-getvar-and-getvarflag-now-mandatory:
  29. Expand Parameter to ``getVar()`` and ``getVarFlag()`` is Now Mandatory
  30. ----------------------------------------------------------------------
  31. The expand parameter to ``getVar()`` and ``getVarFlag()`` previously
  32. defaulted to False if not specified. Now, however, no default exists so
  33. one must be specified. You must change any ``getVar()`` calls that do
  34. not specify the final expand parameter to calls that do specify the
  35. parameter. You can run the following ``sed`` command at the base of a
  36. layer to make this change::
  37. sed -e 's:\(\.getVar([^,()]*\)):\1, False):g' -i `grep -ril getVar *`
  38. sed -e 's:\(\.getVarFlag([^,()]*,[^,()]*\)):\1, False):g' -i `grep -ril getVarFlag *`
  39. .. note::
  40. The reason for this change is that it prepares the way for changing
  41. the default to True in a future Yocto Project release. This future
  42. change is a much more sensible default than False. However, the
  43. change needs to be made gradually as a sudden change of the default
  44. would potentially cause side-effects that would be difficult to
  45. detect.
  46. .. _migration-2.1-makefile-environment-changes:
  47. Makefile Environment Changes
  48. ----------------------------
  49. :term:`EXTRA_OEMAKE` now defaults to "" instead of
  50. "-e MAKEFLAGS=". Setting :term:`EXTRA_OEMAKE` to "-e MAKEFLAGS=" by default
  51. was a historical accident that has required many classes (e.g.
  52. :ref:`autotools <ref-classes-autotools>`, ``module``) and recipes to override this default in order
  53. to work with sensible build systems. When upgrading to the release, you
  54. must edit any recipe that relies upon this old default by either setting
  55. :term:`EXTRA_OEMAKE` back to "-e MAKEFLAGS=" or by explicitly setting any
  56. required variable value overrides using :term:`EXTRA_OEMAKE`, which is
  57. typically only needed when a Makefile sets a default value for a
  58. variable that is inappropriate for cross-compilation using the "="
  59. operator rather than the "?=" operator.
  60. .. _migration-2.1-libexecdir-reverted-to-prefix-libexec:
  61. ``libexecdir`` Reverted to ``${prefix}/libexec``
  62. ------------------------------------------------
  63. The use of ``${libdir}/${BPN}`` as ``libexecdir`` is different as
  64. compared to all other mainstream distributions, which either uses
  65. ``${prefix}/libexec`` or ``${libdir}``. The use is also contrary to the
  66. GNU Coding Standards (i.e.
  67. https://www.gnu.org/prep/standards/html_node/Directory-Variables.html)
  68. that suggest ``${prefix}/libexec`` and also notes that any
  69. package-specific nesting should be done by the package itself. Finally,
  70. having ``libexecdir`` change between recipes makes it very difficult for
  71. different recipes to invoke binaries that have been installed into
  72. ``libexecdir``. The Filesystem Hierarchy Standard (i.e.
  73. https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html) now
  74. recognizes the use of ``${prefix}/libexec/``, giving distributions the
  75. choice between ``${prefix}/lib`` or ``${prefix}/libexec`` without
  76. breaking FHS.
  77. .. _migration-2.1-ac-cv-sizeof-off-t-no-longer-cached-in-site-files:
  78. ``ac_cv_sizeof_off_t`` is No Longer Cached in Site Files
  79. --------------------------------------------------------
  80. For recipes inheriting the :ref:`autotools <ref-classes-autotools>`
  81. class, ``ac_cv_sizeof_off_t`` is no longer cached in the site files for
  82. ``autoconf``. The reason for this change is because the
  83. ``ac_cv_sizeof_off_t`` value is not necessarily static per architecture
  84. as was previously assumed. Rather, the value changes based on whether
  85. large file support is enabled. For most software that uses ``autoconf``,
  86. this change should not be a problem. However, if you have a recipe that
  87. bypasses the standard :ref:`ref-tasks-configure` task
  88. from the :ref:`autotools <ref-classes-autotools>` class and the software the recipe is building
  89. uses a very old version of ``autoconf``, the recipe might be incapable
  90. of determining the correct size of ``off_t`` during :ref:`ref-tasks-configure`.
  91. The best course of action is to patch the software as necessary to allow
  92. the default implementation from the :ref:`autotools <ref-classes-autotools>` class to work such
  93. that ``autoreconf`` succeeds and produces a working configure script,
  94. and to remove the overridden :ref:`ref-tasks-configure` task such that the default
  95. implementation does get used.
  96. .. _migration-2.1-image-generation-split-out-from-filesystem-generation:
  97. Image Generation is Now Split Out from Filesystem Generation
  98. ------------------------------------------------------------
  99. Previously, for image recipes the :ref:`ref-tasks-rootfs`
  100. task assembled the filesystem and then from that filesystem generated
  101. images. With this Yocto Project release, image generation is split into
  102. separate :ref:`ref-tasks-image` tasks for clarity both in
  103. operation and in the code.
  104. For most cases, this change does not present any problems. However, if
  105. you have made customizations that directly modify the :ref:`ref-tasks-rootfs` task
  106. or that mention :ref:`ref-tasks-rootfs`, you might need to update those changes.
  107. In particular, if you had added any tasks after :ref:`ref-tasks-rootfs`, you
  108. should make edits so that those tasks are after the
  109. :ref:`ref-tasks-image-complete` task rather than
  110. after :ref:`ref-tasks-rootfs` so that your added tasks run at the correct
  111. time.
  112. A minor part of this restructuring is that the post-processing
  113. definitions and functions have been moved from the
  114. :ref:`image <ref-classes-image>` class to the
  115. :ref:`rootfs-postcommands <ref-classes-rootfs*>` class. Functionally,
  116. however, they remain unchanged.
  117. .. _migration-2.1-removed-recipes:
  118. Removed Recipes
  119. ---------------
  120. The following recipes have been removed in the 2.1 release:
  121. - ``gcc`` version 4.8: Versions 4.9 and 5.3 remain.
  122. - ``qt4``: All support for Qt 4.x has been moved out to a separate
  123. ``meta-qt4`` layer because Qt 4 is no longer supported upstream.
  124. - ``x11vnc``: Moved to the ``meta-oe`` layer.
  125. - ``linux-yocto-3.14``: No longer supported.
  126. - ``linux-yocto-3.19``: No longer supported.
  127. - ``libjpeg``: Replaced by the ``libjpeg-turbo`` recipe.
  128. - ``pth``: Became obsolete.
  129. - ``liboil``: Recipe is no longer needed and has been moved to the
  130. ``meta-multimedia`` layer.
  131. - ``gtk-theme-torturer``: Recipe is no longer needed and has been moved
  132. to the ``meta-gnome`` layer.
  133. - ``gnome-mime-data``: Recipe is no longer needed and has been moved to
  134. the ``meta-gnome`` layer.
  135. - ``udev``: Replaced by the ``eudev`` recipe for compatibility when
  136. using ``sysvinit`` with newer kernels.
  137. - ``python-pygtk``: Recipe became obsolete.
  138. - ``adt-installer``: Recipe became obsolete. See the
  139. ":ref:`migration-guides/migration-2.1:adt removed`" section for more information.
  140. .. _migration-2.1-class-changes:
  141. Class Changes
  142. -------------
  143. The following classes have changed:
  144. - ``autotools_stage``: Removed because the
  145. :ref:`autotools <ref-classes-autotools>` class now provides its
  146. functionality. Recipes that inherited from ``autotools_stage`` should
  147. now inherit from :ref:`autotools <ref-classes-autotools>` instead.
  148. - ``boot-directdisk``: Merged into the ``image-vm`` class. The
  149. ``boot-directdisk`` class was rarely directly used. Consequently,
  150. this change should not cause any issues.
  151. - ``bootimg``: Merged into the
  152. :ref:`image-live <ref-classes-image-live>` class. The ``bootimg``
  153. class was rarely directly used. Consequently, this change should not
  154. cause any issues.
  155. - ``packageinfo``: Removed due to its limited use by the Hob UI, which
  156. has itself been removed.
  157. .. _migration-2.1-build-system-ui-changes:
  158. Build System User Interface Changes
  159. -----------------------------------
  160. The following changes have been made to the build system user interface:
  161. - *Hob GTK+-based UI*: Removed because it is unmaintained and based on
  162. the outdated GTK+ 2 library. The Toaster web-based UI is much more
  163. capable and is actively maintained. See the
  164. ":ref:`toaster-manual/setup-and-use:using the toaster web interface`"
  165. section in the Toaster User Manual for more information on this
  166. interface.
  167. - *"puccho" BitBake UI*: Removed because is unmaintained and no longer
  168. useful.
  169. .. _migration-2.1-adt-removed:
  170. ADT Removed
  171. -----------
  172. The Application Development Toolkit (ADT) has been removed because its
  173. functionality almost completely overlapped with the :ref:`standard
  174. SDK <sdk-manual/using:using the standard sdk>` and the
  175. :ref:`extensible SDK <sdk-manual/extensible:using the extensible sdk>`. For
  176. information on these SDKs and how to build and use them, see the
  177. :doc:`/sdk-manual/index` manual.
  178. .. note::
  179. The Yocto Project Eclipse IDE Plug-in is still supported and is not
  180. affected by this change.
  181. .. _migration-2.1-poky-reference-distribution-changes:
  182. Poky Reference Distribution Changes
  183. -----------------------------------
  184. The following changes have been made for the Poky distribution:
  185. - The ``meta-yocto`` layer has been renamed to ``meta-poky`` to better
  186. match its purpose, which is to provide the Poky reference
  187. distribution. The ``meta-yocto-bsp`` layer retains its original name
  188. since it provides reference machines for the Yocto Project and it is
  189. otherwise unrelated to Poky. References to ``meta-yocto`` in your
  190. ``conf/bblayers.conf`` should automatically be updated, so you should
  191. not need to change anything unless you are relying on this naming
  192. elsewhere.
  193. - The :ref:`uninative <ref-classes-uninative>` class is now enabled
  194. by default in Poky. This class attempts to isolate the build system
  195. from the host distribution's C library and makes re-use of native
  196. shared state artifacts across different host distributions practical.
  197. With this class enabled, a tarball containing a pre-built C library
  198. is downloaded at the start of the build.
  199. The :ref:`uninative <ref-classes-uninative>` class is enabled through the
  200. ``meta/conf/distro/include/yocto-uninative.inc`` file, which for
  201. those not using the Poky distribution, can include to easily enable
  202. the same functionality.
  203. Alternatively, if you wish to build your own ``uninative`` tarball,
  204. you can do so by building the ``uninative-tarball`` recipe, making it
  205. available to your build machines (e.g. over HTTP/HTTPS) and setting a
  206. similar configuration as the one set by ``yocto-uninative.inc``.
  207. - Static library generation, for most cases, is now disabled by default
  208. in the Poky distribution. Disabling this generation saves some build
  209. time as well as the size used for build output artifacts.
  210. Disabling this library generation is accomplished through a
  211. ``meta/conf/distro/include/no-static-libs.inc``, which for those not
  212. using the Poky distribution can easily include to enable the same
  213. functionality.
  214. Any recipe that needs to opt-out of having the ``--disable-static``
  215. option specified on the configure command line either because it is
  216. not a supported option for the configure script or because static
  217. libraries are needed should set the following variable::
  218. DISABLE_STATIC = ""
  219. - The separate ``poky-tiny`` distribution now uses the musl C library
  220. instead of a heavily pared down ``glibc``. Using musl results in a
  221. smaller distribution and facilitates much greater maintainability
  222. because musl is designed to have a small footprint.
  223. If you have used ``poky-tiny`` and have customized the ``glibc``
  224. configuration you will need to redo those customizations with musl
  225. when upgrading to the new release.
  226. .. _migration-2.1-packaging-changes:
  227. Packaging Changes
  228. -----------------
  229. The following changes have been made to packaging:
  230. - The ``runuser`` and ``mountpoint`` binaries, which were previously in
  231. the main ``util-linux`` package, have been split out into the
  232. ``util-linux-runuser`` and ``util-linux-mountpoint`` packages,
  233. respectively.
  234. - The ``python-elementtree`` package has been merged into the
  235. ``python-xml`` package.
  236. .. _migration-2.1-tuning-file-changes:
  237. Tuning File Changes
  238. -------------------
  239. The following changes have been made to the tuning files:
  240. - The "no-thumb-interwork" tuning feature has been dropped from the ARM
  241. tune include files. Because interworking is required for ARM EABI,
  242. attempting to disable it through a tuning feature no longer makes
  243. sense.
  244. .. note::
  245. Support for ARM OABI was deprecated in gcc 4.7.
  246. - The ``tune-cortexm*.inc`` and ``tune-cortexr4.inc`` files have been
  247. removed because they are poorly tested. Until the OpenEmbedded build
  248. system officially gains support for CPUs without an MMU, these tuning
  249. files would probably be better maintained in a separate layer if
  250. needed.
  251. .. _migration-2.1-supporting-gobject-introspection:
  252. Supporting GObject Introspection
  253. --------------------------------
  254. This release supports generation of GLib Introspective Repository (GIR)
  255. files through GObject introspection, which is the standard mechanism for
  256. accessing GObject-based software from runtime environments. You can
  257. enable, disable, and test the generation of this data. See the
  258. ":ref:`dev-manual/gobject-introspection:enabling gobject introspection support`"
  259. section in the Yocto Project Development Tasks Manual for more
  260. information.
  261. .. _migration-2.1-miscellaneous-changes:
  262. Miscellaneous Changes
  263. ---------------------
  264. These additional changes exist:
  265. - The minimum Git version has been increased to 1.8.3.1. If your host
  266. distribution does not provide a sufficiently recent version, you can
  267. install the buildtools, which will provide it. See the
  268. :ref:`ref-manual/system-requirements:required git, tar, python, make and gcc versions`
  269. section for more information on the buildtools tarball.
  270. - The buggy and incomplete support for the RPM version 4 package
  271. manager has been removed. The well-tested and maintained support for
  272. RPM version 5 remains.
  273. - Previously, the following list of packages were removed if
  274. package-management was not in
  275. :term:`IMAGE_FEATURES`, regardless of any
  276. dependencies::
  277. update-rc.d
  278. base-passwd
  279. shadow
  280. update-alternatives
  281. run-postinsts
  282. With the Yocto Project 2.1 release, these packages are
  283. only removed if "read-only-rootfs" is in :term:`IMAGE_FEATURES`, since
  284. they might still be needed for a read-write image even in the absence
  285. of a package manager (e.g. if users need to be added, modified, or
  286. removed at runtime).
  287. - The
  288. :ref:`devtool modify <sdk-manual/extensible:use \`\`devtool modify\`\` to modify the source of an existing component>`
  289. command now defaults to extracting the source since that is most
  290. commonly expected. The ``-x`` or ``--extract`` options are now no-ops. If
  291. you wish to provide your own existing source tree, you will now need
  292. to specify either the ``-n`` or ``--no-extract`` options when running
  293. ``devtool modify``.
  294. - If the formfactor for a machine is either not supplied or does not
  295. specify whether a keyboard is attached, then the default is to assume
  296. a keyboard is attached rather than assume no keyboard. This change
  297. primarily affects the Sato UI.
  298. - The ``.debug`` directory packaging is now automatic. If your recipe
  299. builds software that installs binaries into directories other than
  300. the standard ones, you no longer need to take care of setting
  301. ``FILES_${PN}-dbg`` to pick up the resulting ``.debug`` directories
  302. as these directories are automatically found and added.
  303. - Inaccurate disk and CPU percentage data has been dropped from
  304. :ref:`buildstats <ref-classes-buildstats>` output. This data has been replaced with
  305. ``getrusage()`` data and corrected IO statistics. You will probably
  306. need to update any custom code that reads the :ref:`buildstats <ref-classes-buildstats>` data.
  307. - The ``meta/conf/distro/include/package_regex.inc`` is now deprecated.
  308. The contents of this file have been moved to individual recipes.
  309. .. note::
  310. Because this file will likely be removed in a future Yocto Project
  311. release, it is suggested that you remove any references to the
  312. file that might be in your configuration.
  313. - The ``v86d/uvesafb`` has been removed from the ``genericx86`` and
  314. ``genericx86-64`` reference machines, which are provided by the
  315. ``meta-yocto-bsp`` layer. Most modern x86 boards do not rely on this
  316. file and it only adds kernel error messages during startup. If you do
  317. still need to support ``uvesafb``, you can simply add ``v86d`` to
  318. your image.
  319. - Build sysroot paths are now removed from debug symbol files. Removing
  320. these paths means that remote GDB using an unstripped build system
  321. sysroot will no longer work (although this was never documented to
  322. work). The supported method to accomplish something similar is to set
  323. ``IMAGE_GEN_DEBUGFS`` to "1", which will generate a companion debug
  324. image containing unstripped binaries and associated debug sources
  325. alongside the image.