migration-2.1.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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:`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:`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:`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:`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 definitions and
  113. functions have been moved from the :ref:`ref-classes-image` class to the
  114. :ref:`rootfs-postcommands <ref-classes-rootfs*>` class. Functionally,
  115. however, they remain unchanged.
  116. .. _migration-2.1-removed-recipes:
  117. Removed Recipes
  118. ---------------
  119. The following recipes have been removed in the 2.1 release:
  120. - ``gcc`` version 4.8: Versions 4.9 and 5.3 remain.
  121. - ``qt4``: All support for Qt 4.x has been moved out to a separate
  122. ``meta-qt4`` layer because Qt 4 is no longer supported upstream.
  123. - ``x11vnc``: Moved to the ``meta-oe`` layer.
  124. - ``linux-yocto-3.14``: No longer supported.
  125. - ``linux-yocto-3.19``: No longer supported.
  126. - ``libjpeg``: Replaced by the ``libjpeg-turbo`` recipe.
  127. - ``pth``: Became obsolete.
  128. - ``liboil``: Recipe is no longer needed and has been moved to the
  129. ``meta-multimedia`` layer.
  130. - ``gtk-theme-torturer``: Recipe is no longer needed and has been moved
  131. to the ``meta-gnome`` layer.
  132. - ``gnome-mime-data``: Recipe is no longer needed and has been moved to
  133. the ``meta-gnome`` layer.
  134. - ``udev``: Replaced by the ``eudev`` recipe for compatibility when
  135. using ``sysvinit`` with newer kernels.
  136. - ``python-pygtk``: Recipe became obsolete.
  137. - ``adt-installer``: Recipe became obsolete. See the
  138. ":ref:`migration-guides/migration-2.1:adt removed`" section for more information.
  139. .. _migration-2.1-class-changes:
  140. Class Changes
  141. -------------
  142. The following classes have changed:
  143. - ``autotools_stage``: Removed because the
  144. :ref:`ref-classes-autotools` class now provides its
  145. functionality. Recipes that inherited from ``autotools_stage`` should
  146. now inherit from :ref:`ref-classes-autotools` instead.
  147. - ``boot-directdisk``: Merged into the ``image-vm`` class. The
  148. ``boot-directdisk`` class was rarely directly used. Consequently,
  149. this change should not cause any issues.
  150. - ``bootimg``: Merged into the :ref:`ref-classes-image-live` class. The
  151. ``bootimg`` class was rarely directly used. Consequently, this change should
  152. not cause any issues.
  153. - ``packageinfo``: Removed due to its limited use by the Hob UI, which
  154. has itself been removed.
  155. .. _migration-2.1-build-system-ui-changes:
  156. Build System User Interface Changes
  157. -----------------------------------
  158. The following changes have been made to the build system user interface:
  159. - *Hob GTK+-based UI*: Removed because it is unmaintained and based on
  160. the outdated GTK+ 2 library. The Toaster web-based UI is much more
  161. capable and is actively maintained. See the
  162. ":ref:`toaster-manual/setup-and-use:using the toaster web interface`"
  163. section in the Toaster User Manual for more information on this
  164. interface.
  165. - *"puccho" BitBake UI*: Removed because is unmaintained and no longer
  166. useful.
  167. .. _migration-2.1-adt-removed:
  168. ADT Removed
  169. -----------
  170. The Application Development Toolkit (ADT) has been removed because its
  171. functionality almost completely overlapped with the :ref:`standard
  172. SDK <sdk-manual/using:using the standard sdk>` and the
  173. :ref:`extensible SDK <sdk-manual/extensible:using the extensible sdk>`. For
  174. information on these SDKs and how to build and use them, see the
  175. :doc:`/sdk-manual/index` manual.
  176. .. note::
  177. The Yocto Project Eclipse IDE Plug-in is still supported and is not
  178. affected by this change.
  179. .. _migration-2.1-poky-reference-distribution-changes:
  180. Poky Reference Distribution Changes
  181. -----------------------------------
  182. The following changes have been made for the Poky distribution:
  183. - The ``meta-yocto`` layer has been renamed to ``meta-poky`` to better
  184. match its purpose, which is to provide the Poky reference
  185. distribution. The ``meta-yocto-bsp`` layer retains its original name
  186. since it provides reference machines for the Yocto Project and it is
  187. otherwise unrelated to Poky. References to ``meta-yocto`` in your
  188. ``conf/bblayers.conf`` should automatically be updated, so you should
  189. not need to change anything unless you are relying on this naming
  190. elsewhere.
  191. - The :ref:`ref-classes-uninative` class is now enabled
  192. by default in Poky. This class attempts to isolate the build system
  193. from the host distribution's C library and makes re-use of native
  194. shared state artifacts across different host distributions practical.
  195. With this class enabled, a tarball containing a pre-built C library
  196. is downloaded at the start of the build.
  197. The :ref:`ref-classes-uninative` class is enabled through the
  198. ``meta/conf/distro/include/yocto-uninative.inc`` file, which for
  199. those not using the Poky distribution, can include to easily enable
  200. the same functionality.
  201. Alternatively, if you wish to build your own ``uninative`` tarball,
  202. you can do so by building the ``uninative-tarball`` recipe, making it
  203. available to your build machines (e.g. over HTTP/HTTPS) and setting a
  204. similar configuration as the one set by ``yocto-uninative.inc``.
  205. - Static library generation, for most cases, is now disabled by default
  206. in the Poky distribution. Disabling this generation saves some build
  207. time as well as the size used for build output artifacts.
  208. Disabling this library generation is accomplished through a
  209. ``meta/conf/distro/include/no-static-libs.inc``, which for those not
  210. using the Poky distribution can easily include to enable the same
  211. functionality.
  212. Any recipe that needs to opt-out of having the ``--disable-static``
  213. option specified on the configure command line either because it is
  214. not a supported option for the configure script or because static
  215. libraries are needed should set the following variable::
  216. DISABLE_STATIC = ""
  217. - The separate ``poky-tiny`` distribution now uses the musl C library
  218. instead of a heavily pared down ``glibc``. Using musl results in a
  219. smaller distribution and facilitates much greater maintainability
  220. because musl is designed to have a small footprint.
  221. If you have used ``poky-tiny`` and have customized the ``glibc``
  222. configuration you will need to redo those customizations with musl
  223. when upgrading to the new release.
  224. .. _migration-2.1-packaging-changes:
  225. Packaging Changes
  226. -----------------
  227. The following changes have been made to packaging:
  228. - The ``runuser`` and ``mountpoint`` binaries, which were previously in
  229. the main ``util-linux`` package, have been split out into the
  230. ``util-linux-runuser`` and ``util-linux-mountpoint`` packages,
  231. respectively.
  232. - The ``python-elementtree`` package has been merged into the
  233. ``python-xml`` package.
  234. .. _migration-2.1-tuning-file-changes:
  235. Tuning File Changes
  236. -------------------
  237. The following changes have been made to the tuning files:
  238. - The "no-thumb-interwork" tuning feature has been dropped from the ARM
  239. tune include files. Because interworking is required for ARM EABI,
  240. attempting to disable it through a tuning feature no longer makes
  241. sense.
  242. .. note::
  243. Support for ARM OABI was deprecated in gcc 4.7.
  244. - The ``tune-cortexm*.inc`` and ``tune-cortexr4.inc`` files have been
  245. removed because they are poorly tested. Until the OpenEmbedded build
  246. system officially gains support for CPUs without an MMU, these tuning
  247. files would probably be better maintained in a separate layer if
  248. needed.
  249. .. _migration-2.1-supporting-gobject-introspection:
  250. Supporting GObject Introspection
  251. --------------------------------
  252. This release supports generation of GLib Introspective Repository (GIR)
  253. files through GObject introspection, which is the standard mechanism for
  254. accessing GObject-based software from runtime environments. You can
  255. enable, disable, and test the generation of this data. See the
  256. ":ref:`dev-manual/gobject-introspection:enabling gobject introspection support`"
  257. section in the Yocto Project Development Tasks Manual for more
  258. information.
  259. .. _migration-2.1-miscellaneous-changes:
  260. Miscellaneous Changes
  261. ---------------------
  262. These additional changes exist:
  263. - The minimum Git version has been increased to 1.8.3.1. If your host
  264. distribution does not provide a sufficiently recent version, you can
  265. install the :term:`buildtools`, which will provide it. See the
  266. :ref:`ref-manual/system-requirements:required git, tar, python, make and gcc versions`
  267. section for more information on the :term:`buildtools` tarball.
  268. - The buggy and incomplete support for the RPM version 4 package
  269. manager has been removed. The well-tested and maintained support for
  270. RPM version 5 remains.
  271. - Previously, the following list of packages were removed if
  272. package-management was not in
  273. :term:`IMAGE_FEATURES`, regardless of any
  274. dependencies::
  275. update-rc.d
  276. base-passwd
  277. shadow
  278. update-alternatives
  279. run-postinsts
  280. With the Yocto Project 2.1 release, these packages are
  281. only removed if "read-only-rootfs" is in :term:`IMAGE_FEATURES`, since
  282. they might still be needed for a read-write image even in the absence
  283. of a package manager (e.g. if users need to be added, modified, or
  284. removed at runtime).
  285. - The
  286. :ref:`devtool modify <dev-manual/devtool:use \`\`devtool modify\`\` to modify the source of an existing component>`
  287. command now defaults to extracting the source since that is most
  288. commonly expected. The ``-x`` or ``--extract`` options are now no-ops. If
  289. you wish to provide your own existing source tree, you will now need
  290. to specify either the ``-n`` or ``--no-extract`` options when running
  291. ``devtool modify``.
  292. - If the formfactor for a machine is either not supplied or does not
  293. specify whether a keyboard is attached, then the default is to assume
  294. a keyboard is attached rather than assume no keyboard. This change
  295. primarily affects the Sato UI.
  296. - The ``.debug`` directory packaging is now automatic. If your recipe
  297. builds software that installs binaries into directories other than
  298. the standard ones, you no longer need to take care of setting
  299. ``FILES_${PN}-dbg`` to pick up the resulting ``.debug`` directories
  300. as these directories are automatically found and added.
  301. - Inaccurate disk and CPU percentage data has been dropped from
  302. :ref:`ref-classes-buildstats` output. This data has been replaced with
  303. ``getrusage()`` data and corrected IO statistics. You will probably
  304. need to update any custom code that reads the :ref:`ref-classes-buildstats` data.
  305. - The ``meta/conf/distro/include/package_regex.inc`` is now deprecated.
  306. The contents of this file have been moved to individual recipes.
  307. .. note::
  308. Because this file will likely be removed in a future Yocto Project
  309. release, it is suggested that you remove any references to the
  310. file that might be in your configuration.
  311. - The ``v86d/uvesafb`` has been removed from the ``genericx86`` and
  312. ``genericx86-64`` reference machines, which are provided by the
  313. ``meta-yocto-bsp`` layer. Most modern x86 boards do not rely on this
  314. file and it only adds kernel error messages during startup. If you do
  315. still need to support ``uvesafb``, you can simply add ``v86d`` to
  316. your image.
  317. - Build sysroot paths are now removed from debug symbol files. Removing
  318. these paths means that remote GDB using an unstripped build system
  319. sysroot will no longer work (although this was never documented to
  320. work). The supported method to accomplish something similar is to set
  321. ``IMAGE_GEN_DEBUGFS`` to "1", which will generate a companion debug
  322. image containing unstripped binaries and associated debug sources
  323. alongside the image.