migration-2.3.rst 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Release 2.3 (pyro)
  3. ==================
  4. This section provides migration information for moving to the Yocto
  5. Project 2.3 Release (codename "pyro") from the prior release.
  6. .. _migration-2.3-recipe-specific-sysroots:
  7. Recipe-specific Sysroots
  8. ------------------------
  9. The OpenEmbedded build system now uses one sysroot per recipe to resolve
  10. long-standing issues with configuration script auto-detection of
  11. undeclared dependencies. Consequently, you might find that some of your
  12. previously written custom recipes are missing declared dependencies,
  13. particularly those dependencies that are incidentally built earlier in a
  14. typical build process and thus are already likely to be present in the
  15. shared sysroot in previous releases.
  16. Consider the following:
  17. - *Declare Build-Time Dependencies:* Because of this new feature, you
  18. must explicitly declare all build-time dependencies for your recipe.
  19. If you do not declare these dependencies, they are not populated into
  20. the sysroot for the recipe.
  21. - *Specify Pre-Installation and Post-Installation Native Tool
  22. Dependencies:* You must specifically specify any special native tool
  23. dependencies of ``pkg_preinst`` and ``pkg_postinst`` scripts by using
  24. the :term:`PACKAGE_WRITE_DEPS` variable.
  25. Specifying these dependencies ensures that these tools are available
  26. if these scripts need to be run on the build host during the
  27. :ref:`ref-tasks-rootfs` task.
  28. As an example, see the ``dbus`` recipe. You will see that this recipe
  29. has a ``pkg_postinst`` that calls ``systemctl`` if "systemd" is in
  30. :term:`DISTRO_FEATURES`. In the example,
  31. ``systemd-systemctl-native`` is added to :term:`PACKAGE_WRITE_DEPS`,
  32. which is also conditional on "systemd" being in :term:`DISTRO_FEATURES`.
  33. - Examine Recipes that Use ``SSTATEPOSTINSTFUNCS``: You need to
  34. examine any recipe that uses ``SSTATEPOSTINSTFUNCS`` and determine
  35. steps to take.
  36. Functions added to ``SSTATEPOSTINSTFUNCS`` are still called as they
  37. were in previous Yocto Project releases. However, since a separate
  38. sysroot is now being populated for every recipe and if existing
  39. functions being called through ``SSTATEPOSTINSTFUNCS`` are doing
  40. relocation, then you will need to change these to use a
  41. post-installation script that is installed by a function added to
  42. :term:`SYSROOT_PREPROCESS_FUNCS`.
  43. For an example, see the :ref:`ref-classes-pixbufcache` class in ``meta/classes/`` in
  44. the :ref:`overview-manual/development-environment:yocto project source repositories`.
  45. .. note::
  46. The
  47. SSTATEPOSTINSTFUNCS
  48. variable itself is now deprecated in favor of the
  49. do_populate_sysroot[postfuncs]
  50. task. Consequently, if you do still have any function or functions
  51. that need to be called after the sysroot component is created for
  52. a recipe, then you would be well advised to take steps to use a
  53. post installation script as described previously. Taking these
  54. steps prepares your code for when
  55. SSTATEPOSTINSTFUNCS
  56. is removed in a future Yocto Project release.
  57. - *Specify the Sysroot when Using Certain External Scripts:* Because
  58. the shared sysroot is now gone, the scripts
  59. ``oe-find-native-sysroot`` and ``oe-run-native`` have been changed
  60. such that you need to specify which recipe's
  61. :term:`STAGING_DIR_NATIVE` is used.
  62. .. note::
  63. You can find more information on how recipe-specific sysroots work in
  64. the ":ref:`ref-classes-staging`" section.
  65. .. _migration-2.3-path-variable:
  66. ``PATH`` Variable
  67. -----------------
  68. Within the environment used to run build tasks, the environment variable
  69. ``PATH`` is now sanitized such that the normal native binary paths
  70. (``/bin``, ``/sbin``, ``/usr/bin`` and so forth) are removed and a
  71. directory containing symbolic links linking only to the binaries from
  72. the host mentioned in the :term:`HOSTTOOLS` and
  73. :term:`HOSTTOOLS_NONFATAL` variables is added
  74. to ``PATH``.
  75. Consequently, any native binaries provided by the host that you need to
  76. call needs to be in one of these two variables at the configuration
  77. level.
  78. Alternatively, you can add a native recipe (i.e. ``-native``) that
  79. provides the binary to the recipe's :term:`DEPENDS`
  80. value.
  81. .. note::
  82. PATH
  83. is not sanitized in the same way within ``devshell``.
  84. If it were, you would have difficulty running host tools for
  85. development and debugging within the shell.
  86. .. _migration-2.3-scripts:
  87. Changes to Scripts
  88. ------------------
  89. The following changes to scripts took place:
  90. - ``oe-find-native-sysroot``: The usage for the
  91. ``oe-find-native-sysroot`` script has changed to the following::
  92. $ . oe-find-native-sysroot recipe
  93. You must now supply a recipe for recipe
  94. as part of the command. Prior to the Yocto Project 2.3 release, it
  95. was not necessary to provide the script with the command.
  96. - ``oe-run-native``: The usage for the ``oe-run-native`` script has
  97. changed to the following::
  98. $ oe-run-native native_recipe tool
  99. You must
  100. supply the name of the native recipe and the tool you want to run as
  101. part of the command. Prior to the Yocto Project 2.3 release, it
  102. was not necessary to provide the native recipe with the command.
  103. - ``cleanup-workdir``: The ``cleanup-workdir`` script has been
  104. removed because the script was found to be deleting files it should
  105. not have, which lead to broken build trees. Rather than trying to
  106. delete portions of :term:`TMPDIR` and getting it wrong,
  107. it is recommended that you delete :term:`TMPDIR` and have it restored
  108. from shared state (sstate) on subsequent builds.
  109. - ``wipe-sysroot``: The ``wipe-sysroot`` script has been removed as
  110. it is no longer needed with recipe-specific sysroots.
  111. .. _migration-2.3-functions:
  112. Changes to Functions
  113. --------------------
  114. The previously deprecated ``bb.data.getVar()``, ``bb.data.setVar()``,
  115. and related functions have been removed in favor of ``d.getVar()``,
  116. ``d.setVar()``, and so forth.
  117. You need to fix any references to these old functions.
  118. .. _migration-2.3-bitbake-changes:
  119. BitBake Changes
  120. ---------------
  121. The following changes took place for BitBake:
  122. - *BitBake's Graphical Dependency Explorer UI Replaced:* BitBake's
  123. graphical dependency explorer UI ``depexp`` was replaced by
  124. ``taskexp`` ("Task Explorer"), which provides a graphical way of
  125. exploring the ``task-depends.dot`` file. The data presented by Task
  126. Explorer is much more accurate than the data that was presented by
  127. ``depexp``. Being able to visualize the data is an often requested
  128. feature as standard ``*.dot`` file viewers cannot usual cope with the
  129. size of the ``task-depends.dot`` file.
  130. - *BitBake "-g" Output Changes:* The ``package-depends.dot`` and
  131. ``pn-depends.dot`` files as previously generated using the
  132. ``bitbake -g`` command have been removed. A ``recipe-depends.dot``
  133. file is now generated as a collapsed version of ``task-depends.dot``
  134. instead.
  135. The reason for this change is because ``package-depends.dot`` and
  136. ``pn-depends.dot`` largely date back to a time before task-based
  137. execution and do not take into account task-level dependencies
  138. between recipes, which could be misleading.
  139. - *Mirror Variable Splitting Changes:* Mirror variables including
  140. :term:`MIRRORS`, :term:`PREMIRRORS`,
  141. and :term:`SSTATE_MIRRORS` can now separate
  142. values entirely with spaces. Consequently, you no longer need "\\n".
  143. BitBake looks for pairs of values, which simplifies usage. There
  144. should be no change required to existing mirror variable values
  145. themselves.
  146. - *The Subversion (SVN) Fetcher Uses an "ssh" Parameter and Not an
  147. "rsh" Parameter:* The SVN fetcher now takes an "ssh" parameter
  148. instead of an "rsh" parameter. This new optional parameter is used
  149. when the "protocol" parameter is set to "svn+ssh". You can only use
  150. the new parameter to specify the ``ssh`` program used by SVN. The SVN
  151. fetcher passes the new parameter through the ``SVN_SSH`` environment
  152. variable during the :ref:`ref-tasks-fetch` task.
  153. See the
  154. ":ref:`bitbake-user-manual/bitbake-user-manual-fetching:subversion (svn) fetcher (\`\`svn://\`\`)`"
  155. section in the BitBake User Manual for additional information.
  156. - ``BB_SETSCENE_VERIFY_FUNCTION`` and ``BB_SETSCENE_VERIFY_FUNCTION2``
  157. Removed: Because the mechanism they were part of is no longer
  158. necessary with recipe-specific sysroots, the
  159. ``BB_SETSCENE_VERIFY_FUNCTION`` and ``BB_SETSCENE_VERIFY_FUNCTION2``
  160. variables have been removed.
  161. .. _migration-2.3-absolute-symlinks:
  162. Absolute Symbolic Links
  163. -----------------------
  164. Absolute symbolic links (symlinks) within staged files are no longer
  165. permitted and now trigger an error. Any explicit creation of symlinks
  166. can use the ``lnr`` script, which is a replacement for ``ln -r``.
  167. If the build scripts in the software that the recipe is building are
  168. creating a number of absolute symlinks that need to be corrected, you
  169. can inherit ``relative_symlinks`` within the recipe to turn those
  170. absolute symlinks into relative symlinks.
  171. .. _migration-2.3-gplv2-and-gplv3-moves:
  172. GPLv2 Versions of GPLv3 Recipes Moved
  173. -------------------------------------
  174. Older GPLv2 versions of GPLv3 recipes have moved to a separate
  175. ``meta-gplv2`` layer.
  176. If you use :term:`INCOMPATIBLE_LICENSE` to
  177. exclude GPLv3 or set :term:`PREFERRED_VERSION`
  178. to substitute a GPLv2 version of a GPLv3 recipe, then you must add the
  179. ``meta-gplv2`` layer to your configuration.
  180. .. note::
  181. You can ``find meta-gplv2`` layer in the OpenEmbedded layer index at
  182. :oe_layer:`/meta-gplv2`.
  183. These relocated GPLv2 recipes do not receive the same level of
  184. maintenance as other core recipes. The recipes do not get security fixes
  185. and upstream no longer maintains them. In fact, the upstream community
  186. is actively hostile towards people that use the old versions of the
  187. recipes. Moving these recipes into a separate layer both makes the
  188. different needs of the recipes clearer and clearly identifies the number
  189. of these recipes.
  190. .. note::
  191. The long-term solution might be to move to BSD-licensed replacements
  192. of the GPLv3 components for those that need to exclude GPLv3-licensed
  193. components from the target system. This solution will be investigated
  194. for future Yocto Project releases.
  195. .. _migration-2.3-package-management-changes:
  196. Package Management Changes
  197. --------------------------
  198. The following package management changes took place:
  199. - Smart package manager is replaced by DNF package manager. Smart has
  200. become unmaintained upstream, is not ported to Python 3.x.
  201. Consequently, Smart needed to be replaced. DNF is the only feasible
  202. candidate.
  203. The change in functionality is that the on-target runtime package
  204. management from remote package feeds is now done with a different
  205. tool that has a different set of command-line options. If you have
  206. scripts that call the tool directly, or use its API, they need to be
  207. fixed.
  208. For more information, see the `DNF
  209. Documentation <https://dnf.readthedocs.io/en/latest/>`__.
  210. - Rpm 5.x is replaced with Rpm 4.x. This is done for two major reasons:
  211. - DNF is API-incompatible with Rpm 5.x and porting it and
  212. maintaining the port is non-trivial.
  213. - Rpm 5.x itself has limited maintenance upstream, and the Yocto
  214. Project is one of the very few remaining users.
  215. - Berkeley DB 6.x is removed and Berkeley DB 5.x becomes the default:
  216. - Version 6.x of Berkeley DB has largely been rejected by the open
  217. source community due to its AGPLv3 license. As a result, most
  218. mainstream open source projects that require DB are still
  219. developed and tested with DB 5.x.
  220. - In OE-core, the only thing that was requiring DB 6.x was Rpm 5.x.
  221. Thus, no reason exists to continue carrying DB 6.x in OE-core.
  222. - ``createrepo`` is replaced with ``createrepo_c``.
  223. ``createrepo_c`` is the current incarnation of the tool that
  224. generates remote repository metadata. It is written in C as compared
  225. to ``createrepo``, which is written in Python. ``createrepo_c`` is
  226. faster and is maintained.
  227. - Architecture-independent RPM packages are "noarch" instead of "all".
  228. This change was made because too many places in DNF/RPM4 stack
  229. already make that assumption. Only the filenames and the architecture
  230. tag has changed. Nothing else has changed in OE-core system,
  231. particularly in the :ref:`ref-classes-allarch` class.
  232. - Signing of remote package feeds using ``PACKAGE_FEED_SIGN`` is not
  233. currently supported. This issue will be fully addressed in a future
  234. Yocto Project release. See :yocto_bugs:`defect 11209 </show_bug.cgi?id=11209>`
  235. for more information on a solution to package feed signing with RPM
  236. in the Yocto Project 2.3 release.
  237. - OPKG now uses the libsolv backend for resolving package dependencies
  238. by default. This is vastly superior to OPKG's internal ad-hoc solver
  239. that was previously used. This change does have a small impact on
  240. disk (around 500 KB) and memory footprint.
  241. .. note::
  242. For further details on this change, see the
  243. :yocto_git:`commit message </poky/commit/?id=f4d4f99cfbc2396e49c1613a7d237b9e57f06f81>`.
  244. .. _migration-2.3-removed-recipes:
  245. Removed Recipes
  246. ---------------
  247. The following recipes have been removed:
  248. - ``linux-yocto 4.8``: Version 4.8 has been removed. Versions 4.1
  249. (LTSI), 4.4 (LTS), 4.9 (LTS/LTSI) and 4.10 are now present.
  250. - ``python-smartpm``: Functionally replaced by ``dnf``.
  251. - ``createrepo``: Replaced by the ``createrepo-c`` recipe.
  252. - ``rpmresolve``: No longer needed with the move to RPM 4 as RPM
  253. itself is used instead.
  254. - ``gstreamer``: Removed the GStreamer Git version recipes as they
  255. have been stale. ``1.10.``\ x recipes are still present.
  256. - ``alsa-conf-base``: Merged into ``alsa-conf`` since ``libasound``
  257. depended on both. Essentially, no way existed to install only one of
  258. these.
  259. - ``tremor``: Moved to ``meta-multimedia``. Fixed-integer Vorbis
  260. decoding is not needed by current hardware. Thus, GStreamer's ivorbis
  261. plugin has been disabled by default eliminating the need for the
  262. ``tremor`` recipe in :term:`OpenEmbedded-Core (OE-Core)`.
  263. - ``gummiboot``: Replaced by ``systemd-boot``.
  264. .. _migration-2.3-wic-changes:
  265. Wic Changes
  266. -----------
  267. The following changes have been made to Wic:
  268. .. note::
  269. For more information on Wic, see the
  270. ":ref:`dev-manual/wic:creating partitioned images using wic`"
  271. section in the Yocto Project Development Tasks Manual.
  272. - *Default Output Directory Changed:* Wic's default output directory is
  273. now the current directory by default instead of the unusual
  274. ``/var/tmp/wic``.
  275. The ``-o`` and ``--outdir`` options remain unchanged and are used to
  276. specify your preferred output directory if you do not want to use the
  277. default directory.
  278. - *fsimage Plug-in Removed:* The Wic fsimage plugin has been removed as
  279. it duplicates functionality of the rawcopy plugin.
  280. .. _migration-2.3-qa-changes:
  281. QA Changes
  282. ----------
  283. The following QA checks have changed:
  284. - ``unsafe-references-in-binaries``: The
  285. ``unsafe-references-in-binaries`` QA check, which was disabled by
  286. default, has now been removed. This check was intended to detect
  287. binaries in ``/bin`` that link to libraries in ``/usr/lib`` and have
  288. the case where the user has ``/usr`` on a separate filesystem to
  289. ``/``.
  290. The removed QA check was buggy. Additionally, ``/usr`` residing on a
  291. separate partition from ``/`` is now a rare configuration.
  292. Consequently, ``unsafe-references-in-binaries`` was removed.
  293. - ``file-rdeps``: The ``file-rdeps`` QA check is now an error by
  294. default instead of a warning. Because it is an error instead of a
  295. warning, you need to address missing runtime dependencies.
  296. For additional information, see the
  297. :ref:`ref-classes-insane` class and the
  298. ":ref:`ref-manual/qa-checks:errors and warnings`" section.
  299. .. _migration-2.3-miscellaneous-changes:
  300. Miscellaneous Changes
  301. ---------------------
  302. The following miscellaneous changes have occurred:
  303. - In this release, a number of recipes have been changed to ignore the
  304. ``largefile`` :term:`DISTRO_FEATURES` item,
  305. enabling large file support unconditionally. This feature has always
  306. been enabled by default. Disabling the feature has not been widely
  307. tested.
  308. .. note::
  309. Future releases of the Yocto Project will remove entirely the
  310. ability to disable the
  311. largefile
  312. feature, which would make it unconditionally enabled everywhere.
  313. - If the :term:`DISTRO_VERSION` value contains
  314. the value of the :term:`DATE` variable, which is the
  315. default between Poky releases, the :term:`DATE` value is explicitly
  316. excluded from ``/etc/issue`` and ``/etc/issue.net``, which is
  317. displayed at the login prompt, in order to avoid conflicts with
  318. Multilib enabled. Regardless, the :term:`DATE` value is inaccurate if the
  319. ``base-files`` recipe is restored from shared state (sstate) rather
  320. than rebuilt.
  321. If you need the build date recorded in ``/etc/issue*`` or anywhere
  322. else in your image, a better method is to define a post-processing
  323. function to do it and have the function called from
  324. :term:`ROOTFS_POSTPROCESS_COMMAND`.
  325. Doing so ensures the value is always up-to-date with the created
  326. image.
  327. - Dropbear's ``init`` script now disables DSA host keys by default.
  328. This change is in line with the systemd service file, which supports
  329. RSA keys only, and with recent versions of OpenSSH, which deprecates
  330. DSA host keys.
  331. - The :ref:`ref-classes-buildhistory` class now
  332. correctly uses tabs as separators between all columns in
  333. ``installed-package-sizes.txt`` in order to aid import into other
  334. tools.
  335. - The ``USE_LDCONFIG`` variable has been replaced with the "ldconfig"
  336. :term:`DISTRO_FEATURES` feature. Distributions that previously set::
  337. USE_LDCONFIG = "0"
  338. should now instead use the following::
  339. DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " ldconfig"
  340. - The default value of
  341. :term:`COPYLEFT_LICENSE_INCLUDE` now
  342. includes all versions of AGPL licenses in addition to GPL and LGPL.
  343. .. note::
  344. The default list is not intended to be guaranteed as a complete
  345. safe list. You should seek legal advice based on what you are
  346. distributing if you are unsure.
  347. - Kernel module packages are now suffixed with the kernel version in
  348. order to allow module packages from multiple kernel versions to
  349. co-exist on a target system. If you wish to return to the previous
  350. naming scheme that does not include the version suffix, use the
  351. following::
  352. KERNEL_MODULE_PACKAGE_SUFFIX = ""
  353. - Removal of ``libtool`` ``*.la`` files is now enabled by default. The
  354. ``*.la`` files are not actually needed on Linux and relocating them
  355. is an unnecessary burden.
  356. If you need to preserve these ``.la`` files (e.g. in a custom
  357. distribution), you must change :term:`INHERIT_DISTRO` such that
  358. ":ref:`ref-classes-remove-libtool`" is not included
  359. in the value.
  360. - Extensible SDKs built for GCC 5+ now refuse to install on a
  361. distribution where the host GCC version is 4.8 or 4.9. This change
  362. resulted from the fact that the installation is known to fail due to
  363. the way the ``uninative`` shared state (sstate) package is built. See
  364. the :ref:`ref-classes-uninative` class for additional information.
  365. - All :ref:`ref-classes-native` and :ref:`ref-classes-nativesdk` recipes now
  366. use a separate :term:`DISTRO_FEATURES` value instead of sharing the value
  367. used by recipes for the target, in order to avoid unnecessary rebuilds.
  368. The :term:`DISTRO_FEATURES` for :ref:`ref-classes-native` recipes
  369. is :term:`DISTRO_FEATURES_NATIVE` added to an intersection of
  370. :term:`DISTRO_FEATURES` and :term:`DISTRO_FEATURES_FILTER_NATIVE`.
  371. For :ref:`ref-classes-nativesdk` recipes, the corresponding
  372. variables are :term:`DISTRO_FEATURES_NATIVESDK` and
  373. :term:`DISTRO_FEATURES_FILTER_NATIVESDK`.
  374. - The ``FILESDIR`` variable, which was previously deprecated and rarely
  375. used, has now been removed. You should change any recipes that set
  376. ``FILESDIR`` to set :term:`FILESPATH` instead.
  377. - The ``MULTIMACH_HOST_SYS`` variable has been removed as it is no
  378. longer needed with recipe-specific sysroots.