migrating.adoc 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. [[migrating-from-ol-versions]]
  4. == Migrating from older Buildroot versions
  5. Some versions have introduced backward incompatibilities. This section
  6. explains those incompatibilities, and for each explains what to do to
  7. complete the migration.
  8. [[migrating-approach]]
  9. === General approach
  10. To migrate from an older Buildroot version, take the following steps.
  11. . For all your configurations, do a build in the old Buildroot
  12. environment. Run +make graph-size+. Save
  13. +graphs/file-size-stats.csv+ in a different location. Run +make
  14. clean+ to remove the rest.
  15. . Review the specific migration notes below and make the required
  16. adaptations to external packages and custom build scripts.
  17. . Update Buildroot.
  18. . Run +make menuconfig+ starting from the existing +.config+.
  19. . If anything is enabled in the Legacy menu, check its help text,
  20. unselect it, and save the configuration.
  21. . For more details, review the git commit messages for the packages that
  22. you need. Change into the +packages+ directory and run
  23. +git log <old version>.. -- <your packages>+.
  24. . Build in the new Buildroot environment.
  25. . Fix build issues in external packages (usually due to updated
  26. dependencies).
  27. . Run +make graph-size+.
  28. . Compare the new +file-size-stats.csv+ with the original one, to
  29. check if no required files have disappeared and if no new big unneeded
  30. files have appeared.
  31. . For configuration (and other) files in a custom overlay that overwrite
  32. files created by Buildroot, check if there are changes in the
  33. Buildroot-generated file that need to be propagated to your custom
  34. file.
  35. [[br2-external-converting]]
  36. === Migrating to 2016.11
  37. Before Buildroot 2016.11, it was possible to use only one br2-external
  38. tree at once. With Buildroot 2016.11 came the possibility to use more
  39. than one simultaneously (for details, see xref:outside-br-custom[]).
  40. This however means that older br2-external trees are not usable as-is.
  41. A minor change has to be made: adding a name to your br2-external tree.
  42. This can be done very easily in just a few steps:
  43. * First, create a new file named +external.desc+, at the root of your
  44. br2-external tree, with a single line defining the name of your
  45. br2-external tree:
  46. +
  47. ----
  48. $ echo 'name: NAME_OF_YOUR_TREE' >external.desc
  49. ----
  50. +
  51. .Note
  52. Be careful when choosing a name: It has to be unique and be made
  53. with only ASCII characters from the set +[A-Za-z0-9_]+.
  54. * Then, change every occurrence of +BR2_EXTERNAL+ in your br2-external
  55. tree with the new variable:
  56. +
  57. ----
  58. $ find . -type f | xargs sed -i 's/BR2_EXTERNAL/BR2_EXTERNAL_NAME_OF_YOUR_TREE_PATH/g'
  59. ----
  60. Now, your br2-external tree can be used with Buildroot 2016.11 onward.
  61. .Note:
  62. This change makes your br2-external tree incompatible with Buildroot
  63. before 2016.11.
  64. [[migrating-host-usr]]
  65. === Migrating to 2017.08
  66. Before Buildroot 2017.08, host packages were installed in +$(HOST_DIR)/usr+
  67. (with e.g. the autotools' +--prefix=$(HOST_DIR)/usr+). With Buildroot
  68. 2017.08, they are now installed directly in +$(HOST_DIR)+.
  69. Whenever a package installs an executable that is linked with a library
  70. in +$(HOST_DIR)/lib+, it must have an RPATH pointing to that directory.
  71. An RPATH pointing to +$(HOST_DIR)/usr/lib+ is no longer accepted.
  72. [[migrating-svn-externals]]
  73. === Migrating to 2023.11
  74. Before Buildroot 2023.11, the subversion download backend unconditionally
  75. retrieved the external references (objects with an `svn:externals`
  76. property). Starting with 2023.11, externals are no longer retrieved by
  77. default; if you need them, set +LIBFOO_SVN_EXTERNALS+ to +YES+. This
  78. change implies that:
  79. * the generated archive content may change, and thus the hashes may need
  80. to be updated appropriately;
  81. * the archive version suffix has been updated to +-br3+, so the hash
  82. files must be updated appropriately.
  83. Before Buildroot 2023.11, it was possible (but undocumented and unused)
  84. to apply architecture-specific patches, by prefixing the patch filename
  85. with the architecture, e.g. `0001-some-changes.patch.arm` and such a
  86. patch would only be applied for that architecture. With Buildroot 2023.11,
  87. this is no longer supported, and such patches are no longer applied at
  88. all.
  89. If you still need per-architecture patches, then you may provide a
  90. xref:hooks[pre-patch hook] that copies the patches applicable to the
  91. configured architecture, e.g.:
  92. ----
  93. define LIBFOO_ARCH_PATCHES
  94. $(foreach p,$(wildcard $(LIBFOO_PKGDIR)/*.patch.$(ARCH)), \
  95. cp -f $(p) $(patsubst %.$(ARCH),%,$(p))
  96. )
  97. endef
  98. LIBFOO_PRE_PATCH_HOOKS += LIBFOO_ARCH_PATCHES
  99. ----
  100. Note that no package in Buildroot has architecture-specific patches, and
  101. that such patches will most probably not be accepted.
  102. [[migrating-git-attributes]]
  103. === Migrating to 2024.05
  104. The download backends have been extended in various ways.
  105. * All locally generated tarballs are even more reproducible. Before
  106. 2024.05, it was possible that the access mode of files in the archives
  107. were not consistent when the download directory has specific ACLs (e.g.
  108. with the +default+ ACL set). This impacts the archives generated for
  109. git and subversion repositories, as well as those for vendored cargo
  110. and go packages.
  111. * The git download backend now properly expands the `export-subst`
  112. https://git-scm.com/docs/gitattributes[git attribute] when generating
  113. archives.
  114. * A newer +tar+ version, _1.35_, is required to generate the archives.
  115. For compatibility reasons, +tar+ 1.35 changes the way it stores some
  116. fields (`devmajor` and `devminor`), which has an impact in the metadata
  117. stored in the archives (but the content of files is not affected).
  118. To accommodate those changes, the archive suffix has been updated or
  119. added:
  120. * for git: +-git4+
  121. * for subversion: +-svn5+
  122. * for cargo (rust) packages: +-cargo2+
  123. * for go packages: +-go2+
  124. Note that, if two such prefixes would apply to a generated archive, like
  125. for a cargo package downloaded from git, both suffixes need to be added,
  126. first the one for the download mechanism, then the one for the vendoring,
  127. e.g.: +libfoo-1.2.3-git4-cargo2.tar.gz+.
  128. Because of this, the hash file of any custom packages or custom versions
  129. for kernel and bootloaders must be updated. The following sed scripts can
  130. automate the rename in the hash file (assuming such files are kept under
  131. git):
  132. ----
  133. # For git and svn packages, which originally had -br2 resp. -br3 suffix
  134. sed -r -i -e 's/-br2/-git4/; s/-br3/-svn5/' $(
  135. git grep -l -E -- '-br2|-br3' -- '*.hash'
  136. )
  137. # For go packages, which originally had no suffix
  138. sed -r -i -e 's/(\.tar\.gz)$/-go2\1/' $(
  139. git grep -l -E '\$\(eval \$\((host-)?golang-package\)\)' -- '*.mk' \
  140. |sed -r -e 's/\.mk$/.hash/' \
  141. |sort -u
  142. )
  143. # For cargo packages, which originally had no suffix
  144. sed -r -i -e 's/(\.tar\.gz)$/-cargo2\1/' $(
  145. git grep -l -E '\$\(eval \$\((host-)?cargo-package\)\)' -- '*.mk' \
  146. |sed -r -e 's/\.mk$/.hash/' \
  147. |sort -u
  148. )
  149. ----
  150. Note that the hash _will_ have changed, so that needs to be updated
  151. (manually) as well.
  152. [[migrating-mender]]
  153. === Migrating to 2025.02
  154. Mender now requires a special bootstrap artifact to be placed in
  155. +/var/lib/mender+. This replaces the +artifact_info+ file. Just like a
  156. normal artifact, the bootstrap artifact is generated with
  157. host-mender-artifact. See +board/mender/x86_64/post-image-efi.sh+ for an
  158. example of how to generate the bootstrap.mender file. See
  159. https://docs.mender.io/release-information/release-notes-changelog/mender-client#mender-3-5-0-1[the
  160. release notes], under features, for more information.