changes.rst 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Making Changes to the Yocto Project
  3. ***********************************
  4. Because the Yocto Project is an open-source, community-based project,
  5. you can effect changes to the project. This section presents procedures
  6. that show you how to submit a defect against the project and how to
  7. submit a change.
  8. Submitting a Defect Against the Yocto Project
  9. =============================================
  10. Use the Yocto Project implementation of
  11. `Bugzilla <https://www.bugzilla.org/about/>`__ to submit a defect (bug)
  12. against the Yocto Project. For additional information on this
  13. implementation of Bugzilla see the ":ref:`Yocto Project
  14. Bugzilla <resources-bugtracker>`" section in the
  15. Yocto Project Reference Manual. For more detail on any of the following
  16. steps, see the Yocto Project
  17. :yocto_wiki:`Bugzilla wiki page </Bugzilla_Configuration_and_Bug_Tracking>`.
  18. Use the following general steps to submit a bug:
  19. 1. Open the Yocto Project implementation of :yocto_bugs:`Bugzilla <>`.
  20. 2. Click "File a Bug" to enter a new bug.
  21. 3. Choose the appropriate "Classification", "Product", and "Component"
  22. for which the bug was found. Bugs for the Yocto Project fall into
  23. one of several classifications, which in turn break down into
  24. several products and components. For example, for a bug against the
  25. ``meta-intel`` layer, you would choose "Build System, Metadata &
  26. Runtime", "BSPs", and "bsps-meta-intel", respectively.
  27. 4. Choose the "Version" of the Yocto Project for which you found the
  28. bug (e.g. &DISTRO;).
  29. 5. Determine and select the "Severity" of the bug. The severity
  30. indicates how the bug impacted your work.
  31. 6. Choose the "Hardware" that the bug impacts.
  32. 7. Choose the "Architecture" that the bug impacts.
  33. 8. Choose a "Documentation change" item for the bug. Fixing a bug might
  34. or might not affect the Yocto Project documentation. If you are
  35. unsure of the impact to the documentation, select "Don't Know".
  36. 9. Provide a brief "Summary" of the bug. Try to limit your summary to
  37. just a line or two and be sure to capture the essence of the bug.
  38. 10. Provide a detailed "Description" of the bug. You should provide as
  39. much detail as you can about the context, behavior, output, and so
  40. forth that surrounds the bug. You can even attach supporting files
  41. for output from logs by using the "Add an attachment" button.
  42. 11. Click the "Submit Bug" button submit the bug. A new Bugzilla number
  43. is assigned to the bug and the defect is logged in the bug tracking
  44. system.
  45. Once you file a bug, the bug is processed by the Yocto Project Bug
  46. Triage Team and further details concerning the bug are assigned (e.g.
  47. priority and owner). You are the "Submitter" of the bug and any further
  48. categorization, progress, or comments on the bug result in Bugzilla
  49. sending you an automated email concerning the particular change or
  50. progress to the bug.
  51. Submitting a Change to the Yocto Project
  52. ========================================
  53. Contributions to the Yocto Project and OpenEmbedded are very welcome.
  54. Because the system is extremely configurable and flexible, we recognize
  55. that developers will want to extend, configure or optimize it for their
  56. specific uses.
  57. The Yocto Project uses a mailing list and a patch-based workflow that is
  58. similar to the Linux kernel but contains important differences. In
  59. general, there is a mailing list through which you can submit patches. You
  60. should send patches to the appropriate mailing list so that they can be
  61. reviewed and merged by the appropriate maintainer. The specific mailing
  62. list you need to use depends on the location of the code you are
  63. changing. Each component (e.g. layer) should have a ``README`` file that
  64. indicates where to send the changes and which process to follow.
  65. You can send the patch to the mailing list using whichever approach you
  66. feel comfortable with to generate the patch. Once sent, the patch is
  67. usually reviewed by the community at large. If somebody has concerns
  68. with the patch, they will usually voice their concern over the mailing
  69. list. If a patch does not receive any negative reviews, the maintainer
  70. of the affected layer typically takes the patch, tests it, and then
  71. based on successful testing, merges the patch.
  72. The "poky" repository, which is the Yocto Project's reference build
  73. environment, is a hybrid repository that contains several individual
  74. pieces (e.g. BitBake, Metadata, documentation, and so forth) built using
  75. the combo-layer tool. The upstream location used for submitting changes
  76. varies by component:
  77. - *Core Metadata:* Send your patch to the
  78. :oe_lists:`openembedded-core </g/openembedded-core>`
  79. mailing list. For example, a change to anything under the ``meta`` or
  80. ``scripts`` directories should be sent to this mailing list.
  81. - *BitBake:* For changes to BitBake (i.e. anything under the
  82. ``bitbake`` directory), send your patch to the
  83. :oe_lists:`bitbake-devel </g/bitbake-devel>`
  84. mailing list.
  85. - *"meta-\*" trees:* These trees contain Metadata. Use the
  86. :yocto_lists:`poky </g/poky>` mailing list.
  87. - *Documentation*: For changes to the Yocto Project documentation, use the
  88. :yocto_lists:`docs </g/docs>` mailing list.
  89. For changes to other layers hosted in the Yocto Project source
  90. repositories (i.e. ``yoctoproject.org``) and tools use the
  91. :yocto_lists:`Yocto Project </g/yocto/>` general mailing list.
  92. .. note::
  93. Sometimes a layer's documentation specifies to use a particular
  94. mailing list. If so, use that list.
  95. For additional recipes that do not fit into the core Metadata, you
  96. should determine which layer the recipe should go into and submit the
  97. change in the manner recommended by the documentation (e.g. the
  98. ``README`` file) supplied with the layer. If in doubt, please ask on the
  99. Yocto general mailing list or on the openembedded-devel mailing list.
  100. You can also push a change upstream and request a maintainer to pull the
  101. change into the component's upstream repository. You do this by pushing
  102. to a contribution repository that is upstream. See the
  103. ":ref:`overview-manual/development-environment:git workflows and the yocto project`"
  104. section in the Yocto Project Overview and Concepts Manual for additional
  105. concepts on working in the Yocto Project development environment.
  106. Maintainers commonly use ``-next`` branches to test submissions prior to
  107. merging patches. Thus, you can get an idea of the status of a patch based on
  108. whether the patch has been merged into one of these branches. The commonly
  109. used testing branches for OpenEmbedded-Core are as follows:
  110. - *openembedded-core "master-next" branch:* This branch is part of the
  111. :oe_git:`openembedded-core </openembedded-core/>` repository and contains
  112. proposed changes to the core metadata.
  113. - *poky "master-next" branch:* This branch is part of the
  114. :yocto_git:`poky </poky/>` repository and combines proposed
  115. changes to BitBake, the core metadata and the poky distro.
  116. Similarly, stable branches maintained by the project may have corresponding
  117. ``-next`` branches which collect proposed changes. For example,
  118. ``&DISTRO_NAME_NO_CAP;-next`` and ``&DISTRO_NAME_NO_CAP_MINUS_ONE;-next``
  119. branches in both the "openembdedded-core" and "poky" repositories.
  120. Other layers may have similar testing branches but there is no formal
  121. requirement or standard for these so please check the documentation for the
  122. layers you are contributing to.
  123. The following sections provide procedures for submitting a change.
  124. Preparing Changes for Submission
  125. --------------------------------
  126. 1. *Make Your Changes Locally:* Make your changes in your local Git
  127. repository. You should make small, controlled, isolated changes.
  128. Keeping changes small and isolated aids review, makes
  129. merging/rebasing easier and keeps the change history clean should
  130. anyone need to refer to it in future.
  131. 2. *Stage Your Changes:* Stage your changes by using the ``git add``
  132. command on each file you changed.
  133. 3. *Commit Your Changes:* Commit the change by using the ``git commit``
  134. command. Make sure your commit information follows standards by
  135. following these accepted conventions:
  136. - Be sure to include a "Signed-off-by:" line in the same style as
  137. required by the Linux kernel. This can be done by using the
  138. ``git commit -s`` command. Adding this line signifies that you,
  139. the submitter, have agreed to the Developer's Certificate of
  140. Origin 1.1 as follows:
  141. .. code-block:: none
  142. Developer's Certificate of Origin 1.1
  143. By making a contribution to this project, I certify that:
  144. (a) The contribution was created in whole or in part by me and I
  145. have the right to submit it under the open source license
  146. indicated in the file; or
  147. (b) The contribution is based upon previous work that, to the best
  148. of my knowledge, is covered under an appropriate open source
  149. license and I have the right under that license to submit that
  150. work with modifications, whether created in whole or in part
  151. by me, under the same open source license (unless I am
  152. permitted to submit under a different license), as indicated
  153. in the file; or
  154. (c) The contribution was provided directly to me by some other
  155. person who certified (a), (b) or (c) and I have not modified
  156. it.
  157. (d) I understand and agree that this project and the contribution
  158. are public and that a record of the contribution (including all
  159. personal information I submit with it, including my sign-off) is
  160. maintained indefinitely and may be redistributed consistent with
  161. this project or the open source license(s) involved.
  162. - Provide a single-line summary of the change and, if more
  163. explanation is needed, provide more detail in the body of the
  164. commit. This summary is typically viewable in the "shortlist" of
  165. changes. Thus, providing something short and descriptive that
  166. gives the reader a summary of the change is useful when viewing a
  167. list of many commits. You should prefix this short description
  168. with the recipe name (if changing a recipe), or else with the
  169. short form path to the file being changed.
  170. - For the body of the commit message, provide detailed information
  171. that describes what you changed, why you made the change, and the
  172. approach you used. It might also be helpful if you mention how you
  173. tested the change. Provide as much detail as you can in the body
  174. of the commit message.
  175. .. note::
  176. You do not need to provide a more detailed explanation of a
  177. change if the change is minor to the point of the single line
  178. summary providing all the information.
  179. - If the change addresses a specific bug or issue that is associated
  180. with a bug-tracking ID, include a reference to that ID in your
  181. detailed description. For example, the Yocto Project uses a
  182. specific convention for bug references --- any commit that addresses
  183. a specific bug should use the following form for the detailed
  184. description. Be sure to use the actual bug-tracking ID from
  185. Bugzilla for bug-id::
  186. Fixes [YOCTO #bug-id]
  187. detailed description of change
  188. Using Email to Submit a Patch
  189. -----------------------------
  190. Depending on the components changed, you need to submit the email to a
  191. specific mailing list. For some guidance on which mailing list to use,
  192. see the
  193. :ref:`list <dev-manual/changes:submitting a change to the yocto project>`
  194. at the beginning of this section. For a description of all the available
  195. mailing lists, see the ":ref:`Mailing Lists <resources-mailinglist>`" section in the
  196. Yocto Project Reference Manual.
  197. Here is the general procedure on how to submit a patch through email
  198. without using the scripts once the steps in
  199. :ref:`dev-manual/changes:preparing changes for submission` have been followed:
  200. 1. *Format the Commit:* Format the commit into an email message. To
  201. format commits, use the ``git format-patch`` command. When you
  202. provide the command, you must include a revision list or a number of
  203. patches as part of the command. For example, either of these two
  204. commands takes your most recent single commit and formats it as an
  205. email message in the current directory::
  206. $ git format-patch -1
  207. or ::
  208. $ git format-patch HEAD~
  209. After the command is run, the current directory contains a numbered
  210. ``.patch`` file for the commit.
  211. If you provide several commits as part of the command, the
  212. ``git format-patch`` command produces a series of numbered files in
  213. the current directory – one for each commit. If you have more than
  214. one patch, you should also use the ``--cover`` option with the
  215. command, which generates a cover letter as the first "patch" in the
  216. series. You can then edit the cover letter to provide a description
  217. for the series of patches. For information on the
  218. ``git format-patch`` command, see ``GIT_FORMAT_PATCH(1)`` displayed
  219. using the ``man git-format-patch`` command.
  220. .. note::
  221. If you are or will be a frequent contributor to the Yocto Project
  222. or to OpenEmbedded, you might consider requesting a contrib area
  223. and the necessary associated rights.
  224. 2. *Send the patches via email:* Send the patches to the recipients and
  225. relevant mailing lists by using the ``git send-email`` command.
  226. .. note::
  227. In order to use ``git send-email``, you must have the proper Git packages
  228. installed on your host.
  229. For Ubuntu, Debian, and Fedora the package is ``git-email``.
  230. The ``git send-email`` command sends email by using a local or remote
  231. Mail Transport Agent (MTA) such as ``msmtp``, ``sendmail``, or
  232. through a direct ``smtp`` configuration in your Git ``~/.gitconfig``
  233. file. If you are submitting patches through email only, it is very
  234. important that you submit them without any whitespace or HTML
  235. formatting that either you or your mailer introduces. The maintainer
  236. that receives your patches needs to be able to save and apply them
  237. directly from your emails. A good way to verify that what you are
  238. sending will be applicable by the maintainer is to do a dry run and
  239. send them to yourself and then save and apply them as the maintainer
  240. would.
  241. The ``git send-email`` command is the preferred method for sending
  242. your patches using email since there is no risk of compromising
  243. whitespace in the body of the message, which can occur when you use
  244. your own mail client. The command also has several options that let
  245. you specify recipients and perform further editing of the email
  246. message. For information on how to use the ``git send-email``
  247. command, see ``GIT-SEND-EMAIL(1)`` displayed using the
  248. ``man git-send-email`` command.
  249. The Yocto Project uses a `Patchwork instance <https://patchwork.openembedded.org/>`__
  250. to track the status of patches submitted to the various mailing lists and to
  251. support automated patch testing. Each submitted patch is checked for common
  252. mistakes and deviations from the expected patch format and submitters are
  253. notified by patchtest if such mistakes are found. This process helps to
  254. reduce the burden of patch review on maintainers.
  255. .. note::
  256. This system is imperfect and changes can sometimes get lost in the flow.
  257. Asking about the status of a patch or change is reasonable if the change
  258. has been idle for a while with no feedback.
  259. Using Scripts to Push a Change Upstream and Request a Pull
  260. ----------------------------------------------------------
  261. For larger patch series it is preferable to send a pull request which not
  262. only includes the patch but also a pointer to a branch that can be pulled
  263. from. This involves making a local branch for your changes, pushing this
  264. branch to an accessible repository and then using the ``create-pull-request``
  265. and ``send-pull-request`` scripts from openembedded-core to create and send a
  266. patch series with a link to the branch for review.
  267. Follow this procedure to push a change to an upstream "contrib" Git
  268. repository once the steps in :ref:`dev-manual/changes:preparing changes for submission` have
  269. been followed:
  270. .. note::
  271. You can find general Git information on how to push a change upstream
  272. in the
  273. `Git Community Book <https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows>`__.
  274. 1. *Push Your Commits to a "Contrib" Upstream:* If you have arranged for
  275. permissions to push to an upstream contrib repository, push the
  276. change to that repository::
  277. $ git push upstream_remote_repo local_branch_name
  278. For example, suppose you have permissions to push
  279. into the upstream ``meta-intel-contrib`` repository and you are
  280. working in a local branch named `your_name`\ ``/README``. The following
  281. command pushes your local commits to the ``meta-intel-contrib``
  282. upstream repository and puts the commit in a branch named
  283. `your_name`\ ``/README``::
  284. $ git push meta-intel-contrib your_name/README
  285. 2. *Determine Who to Notify:* Determine the maintainer or the mailing
  286. list that you need to notify for the change.
  287. Before submitting any change, you need to be sure who the maintainer
  288. is or what mailing list that you need to notify. Use either these
  289. methods to find out:
  290. - *Maintenance File:* Examine the ``maintainers.inc`` file, which is
  291. located in the :term:`Source Directory` at
  292. ``meta/conf/distro/include``, to see who is responsible for code.
  293. - *Search by File:* Using :ref:`overview-manual/development-environment:git`, you can
  294. enter the following command to bring up a short list of all
  295. commits against a specific file::
  296. git shortlog -- filename
  297. Just provide the name of the file for which you are interested. The
  298. information returned is not ordered by history but does include a
  299. list of everyone who has committed grouped by name. From the list,
  300. you can see who is responsible for the bulk of the changes against
  301. the file.
  302. - *Examine the List of Mailing Lists:* For a list of the Yocto
  303. Project and related mailing lists, see the ":ref:`Mailing
  304. lists <resources-mailinglist>`" section in
  305. the Yocto Project Reference Manual.
  306. 3. *Make a Pull Request:* Notify the maintainer or the mailing list that
  307. you have pushed a change by making a pull request.
  308. The Yocto Project provides two scripts that conveniently let you
  309. generate and send pull requests to the Yocto Project. These scripts
  310. are ``create-pull-request`` and ``send-pull-request``. You can find
  311. these scripts in the ``scripts`` directory within the
  312. :term:`Source Directory` (e.g.
  313. ``poky/scripts``).
  314. Using these scripts correctly formats the requests without
  315. introducing any whitespace or HTML formatting. The maintainer that
  316. receives your patches either directly or through the mailing list
  317. needs to be able to save and apply them directly from your emails.
  318. Using these scripts is the preferred method for sending patches.
  319. First, create the pull request. For example, the following command
  320. runs the script, specifies the upstream repository in the contrib
  321. directory into which you pushed the change, and provides a subject
  322. line in the created patch files::
  323. $ poky/scripts/create-pull-request -u meta-intel-contrib -s "Updated Manual Section Reference in README"
  324. Running this script forms ``*.patch`` files in a folder named
  325. ``pull-``\ `PID` in the current directory. One of the patch files is a
  326. cover letter.
  327. Before running the ``send-pull-request`` script, you must edit the
  328. cover letter patch to insert information about your change. After
  329. editing the cover letter, send the pull request. For example, the
  330. following command runs the script and specifies the patch directory
  331. and email address. In this example, the email address is a mailing
  332. list::
  333. $ poky/scripts/send-pull-request -p ~/meta-intel/pull-10565 -t meta-intel@lists.yoctoproject.org
  334. You need to follow the prompts as the script is interactive.
  335. .. note::
  336. For help on using these scripts, simply provide the ``-h``
  337. argument as follows::
  338. $ poky/scripts/create-pull-request -h
  339. $ poky/scripts/send-pull-request -h
  340. Responding to Patch Review
  341. --------------------------
  342. You may get feedback on your submitted patches from other community members
  343. or from the automated patchtest service. If issues are identified in your
  344. patch then it is usually necessary to address these before the patch will be
  345. accepted into the project. In this case you should amend the patch according
  346. to the feedback and submit an updated version to the relevant mailing list,
  347. copying in the reviewers who provided feedback to the previous version of the
  348. patch.
  349. The patch should be amended using ``git commit --amend`` or perhaps ``git
  350. rebase`` for more expert git users. You should also modify the ``[PATCH]``
  351. tag in the email subject line when sending the revised patch to mark the new
  352. iteration as ``[PATCH v2]``, ``[PATCH v3]``, etc as appropriate. This can be
  353. done by passing the ``-v`` argument to ``git format-patch`` with a version
  354. number.
  355. Lastly please ensure that you also test your revised changes. In particular
  356. please don't just edit the patch file written out by ``git format-patch`` and
  357. resend it.
  358. Submitting Changes to Stable Release Branches
  359. ---------------------------------------------
  360. The process for proposing changes to a Yocto Project stable branch differs
  361. from the steps described above. Changes to a stable branch must address
  362. identified bugs or CVEs and should be made carefully in order to avoid the
  363. risk of introducing new bugs or breaking backwards compatibility. Typically
  364. bug fixes must already be accepted into the master branch before they can be
  365. backported to a stable branch unless the bug in question does not affect the
  366. master branch or the fix on the master branch is unsuitable for backporting.
  367. The list of stable branches along with the status and maintainer for each
  368. branch can be obtained from the
  369. :yocto_wiki:`Releases wiki page </Releases>`.
  370. .. note::
  371. Changes will not typically be accepted for branches which are marked as
  372. End-Of-Life (EOL).
  373. With this in mind, the steps to submit a change for a stable branch are as
  374. follows:
  375. 1. *Identify the bug or CVE to be fixed:* This information should be
  376. collected so that it can be included in your submission.
  377. See :ref:`dev-manual/vulnerabilities:checking for vulnerabilities`
  378. for details about CVE tracking.
  379. 2. *Check if the fix is already present in the master branch:* This will
  380. result in the most straightforward path into the stable branch for the
  381. fix.
  382. a. *If the fix is present in the master branch --- submit a backport request
  383. by email:* You should send an email to the relevant stable branch
  384. maintainer and the mailing list with details of the bug or CVE to be
  385. fixed, the commit hash on the master branch that fixes the issue and
  386. the stable branches which you would like this fix to be backported to.
  387. b. *If the fix is not present in the master branch --- submit the fix to the
  388. master branch first:* This will ensure that the fix passes through the
  389. project's usual patch review and test processes before being accepted.
  390. It will also ensure that bugs are not left unresolved in the master
  391. branch itself. Once the fix is accepted in the master branch a backport
  392. request can be submitted as above.
  393. c. *If the fix is unsuitable for the master branch --- submit a patch
  394. directly for the stable branch:* This method should be considered as a
  395. last resort. It is typically necessary when the master branch is using
  396. a newer version of the software which includes an upstream fix for the
  397. issue or when the issue has been fixed on the master branch in a way
  398. that introduces backwards incompatible changes. In this case follow the
  399. steps in :ref:`dev-manual/changes:preparing changes for submission` and
  400. :ref:`dev-manual/changes:using email to submit a patch` but modify the subject header of your patch
  401. email to include the name of the stable branch which you are
  402. targetting. This can be done using the ``--subject-prefix`` argument to
  403. ``git format-patch``, for example to submit a patch to the dunfell
  404. branch use
  405. ``git format-patch --subject-prefix='&DISTRO_NAME_NO_CAP_MINUS_ONE;][PATCH' ...``.