migration-2.3.rst 20 KB

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