dev-manual-newbie.xml 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990
  1. <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  2. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
  3. [<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
  4. <chapter id='dev-manual-newbie'>
  5. <title>The Yocto Project Open Source Development Environment</title>
  6. <section id="usingpoky-changes-collaborate">
  7. <title>Setting Up a Team Yocto Project Development Environment</title>
  8. <para>
  9. It might not be immediately clear how you can use the Yocto
  10. Project in a team development environment, or scale it for a large
  11. team of developers.
  12. One of the strengths of the Yocto Project is that it is extremely
  13. flexible.
  14. Thus, you can adapt it to many different use cases and scenarios.
  15. However, these characteristics can cause a struggle if you are trying
  16. to create a working setup that scales across a large team.
  17. </para>
  18. <para>
  19. To help you understand how to set up this type of environment,
  20. this section presents a procedure that gives you the information
  21. to learn how to get the results you want.
  22. The procedure is high-level and presents some of the project's most
  23. successful experiences, practices, solutions, and available
  24. technologies that work well.
  25. Keep in mind, the procedure here is a starting point.
  26. You can build off it and customize it to fit any
  27. particular working environment and set of practices.
  28. <orderedlist>
  29. <listitem><para>
  30. <emphasis>Determine Who is Going to be Developing:</emphasis>
  31. You need to understand who is going to be doing anything
  32. related to the Yocto Project and what their roles would be.
  33. Making this determination is essential to completing the
  34. steps two and three, which are to get your equipment together
  35. and set up your development environment's hardware topology.
  36. </para>
  37. <para>The following roles exist:
  38. <itemizedlist>
  39. <listitem><para>
  40. <emphasis>Application Development:</emphasis>
  41. These types of developers do application level work
  42. on top of an existing software stack.
  43. </para></listitem>
  44. <listitem><para>
  45. <emphasis>Core System Development:</emphasis>
  46. These types of developers work on the contents of the
  47. operating system image itself.
  48. </para></listitem>
  49. <listitem><para>
  50. <emphasis>Build Engineer:</emphasis>
  51. This type of developer manages Autobuilders and
  52. releases.
  53. Not all environments need a Build Engineer.
  54. </para></listitem>
  55. <listitem><para>
  56. <emphasis>Test Engineer:</emphasis>
  57. This type of developer creates and manages automated
  58. tests needed to ensure all application and core
  59. system development meets desired quality standards.
  60. </para></listitem>
  61. </itemizedlist>
  62. </para></listitem>
  63. <listitem><para>
  64. <emphasis>Gather the Hardware:</emphasis>
  65. Based on the size and make-up of the team, get the hardware
  66. together.
  67. Any development, build, or test engineer should be using
  68. a system that is running a supported Linux distribution.
  69. Systems, in general, should be high performance (e.g. dual,
  70. six-core Xeons with 24 Gbytes of RAM and plenty of disk space).
  71. You can help ensure efficiency by having any machines used
  72. for testing or that run Autobuilders be as high performance
  73. as possible.
  74. </para></listitem>
  75. <listitem><para>
  76. <emphasis>Understand the Hardware Topology of the Environment:</emphasis>
  77. Now that you know how many developers and support engineers
  78. are required, you can understand the topology of the
  79. hardware environment.
  80. The following figure shows a moderately sized Yocto Project
  81. development environment.
  82. <para role="writernotes">
  83. Need figure.</para>
  84. </para></listitem>
  85. <listitem><para>
  86. <emphasis>Use Git as Your Source Control Manager (SCM):</emphasis>
  87. Keeping your
  88. <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
  89. and any software you are developing under the
  90. control of an SCM system that is compatible
  91. with the OpenEmbedded build system is advisable.
  92. Of the SCMs BitBake supports, the
  93. Yocto Project team strongly recommends using
  94. <ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink>.
  95. Git is a distributed system that is easy to backup,
  96. allows you to work remotely, and then connects back to the
  97. infrastructure.
  98. <note>
  99. For information about BitBake, see the
  100. <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
  101. </note></para>
  102. <para>It is relatively easy to set up Git services and create
  103. infrastructure like
  104. <ulink url='&YOCTO_GIT_URL;'>http://git.yoctoproject.org</ulink>,
  105. which is based on server software called
  106. <filename>gitolite</filename> with <filename>cgit</filename>
  107. being used to generate the web interface that lets you view the
  108. repositories.
  109. The <filename>gitolite</filename> software identifies users
  110. using SSH keys and allows branch-based
  111. access controls to repositories that you can control as little
  112. or as much as necessary.
  113. <note>
  114. The setup of these services is beyond the scope of this
  115. manual.
  116. However, sites such as these exist that describe how to
  117. perform setup:
  118. <itemizedlist>
  119. <listitem><para>
  120. <ulink url='http://git-scm.com/book/ch4-8.html'>Git documentation</ulink>:
  121. Describes how to install <filename>gitolite</filename>
  122. on the server.
  123. </para></listitem>
  124. <listitem><para>
  125. <ulink url='http://sitaramc.github.com/gitolite/master-toc.html'>The <filename>gitolite</filename> master index</ulink>:
  126. All topics for <filename>gitolite</filename>.
  127. </para></listitem>
  128. <listitem><para>
  129. <ulink url='https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools'>Interfaces, frontends, and tools</ulink>:
  130. Documentation on how to create interfaces and frontends
  131. for Git.
  132. </para></listitem>
  133. </itemizedlist>
  134. </note>
  135. </para></listitem>
  136. <listitem><para>
  137. <emphasis>Set up the Application Development Machines:</emphasis>
  138. As mentioned earlier, application developers are creating
  139. applications on top of existing software stacks.
  140. Following are some best practices for setting up machines
  141. that do application development:
  142. <itemizedlist>
  143. <listitem><para>
  144. Use a pre-built toolchain that
  145. contains the software stack itself.
  146. Then, develop the application code on top of the
  147. stack.
  148. This method works well for small numbers of relatively
  149. isolated applications.
  150. </para></listitem>
  151. <listitem><para>
  152. When possible, use the Yocto Project
  153. plug-in for the
  154. <trademark class='trade'>Eclipse</trademark> IDE
  155. and SDK development practices.
  156. For more information, see the
  157. "<ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>".
  158. </para></listitem>
  159. <listitem><para>
  160. Keep your cross-development toolchains updated.
  161. You can do this through provisioning either as new
  162. toolchain downloads or as updates through a package
  163. update mechanism using <filename>opkg</filename>
  164. to provide updates to an existing toolchain.
  165. The exact mechanics of how and when to do this are a
  166. question for local policy.
  167. </para></listitem>
  168. <listitem><para>
  169. Use multiple toolchains installed locally
  170. into different locations to allow development across
  171. versions.
  172. </para></listitem>
  173. </itemizedlist>
  174. </para></listitem>
  175. <listitem><para>
  176. <emphasis>Set up the Core Development Machines:</emphasis>
  177. As mentioned earlier, these types of developers work on the
  178. contents of the operating system itself.
  179. Following are some best practices for setting up machines
  180. used for developing images:
  181. <itemizedlist>
  182. <listitem><para>
  183. Have the Yocto Project build system itself available on
  184. the developer workstations so developers can run their own
  185. builds and directly rebuild the software stack.
  186. </para></listitem>
  187. <listitem><para>
  188. Keep the core system unchanged as much as
  189. possible and do your work in layers on top of the
  190. core system.
  191. Doing so gives you a greater level of portability when
  192. upgrading to new versions of the core system or Board
  193. Support Packages (BSPs).
  194. </para></listitem>
  195. <listitem><para>
  196. Share layers amongst the developers of a
  197. particular project and contain the policy configuration
  198. that defines the project.
  199. </para></listitem>
  200. </itemizedlist>
  201. </para></listitem>
  202. <listitem><para>
  203. <emphasis>Set up an Autobuilder:</emphasis>
  204. Autobuilders are often the core of the development
  205. environment.
  206. It is here that changes from individual developers are brought
  207. together and centrally tested and subsequent decisions about
  208. releases can be made.
  209. Autobuilders also allow for "continuous integration" style
  210. testing of software components and regression identification
  211. and tracking.</para>
  212. <para>See "<ulink url='http://autobuilder.yoctoproject.org'>Yocto Project Autobuilder</ulink>"
  213. for more information and links to buildbot.
  214. The Yocto Project team has found this implementation
  215. works well in this role.
  216. A public example of this is the Yocto Project
  217. Autobuilders, which we use to test the overall health of the
  218. project.</para>
  219. <para>The features of this system are:
  220. <itemizedlist>
  221. <listitem><para>
  222. Highlights when commits break the build.
  223. </para></listitem>
  224. <listitem><para>
  225. Populates an sstate cache from which
  226. developers can pull rather than requiring local
  227. builds.
  228. </para></listitem>
  229. <listitem><para>
  230. Allows commit hook triggers,
  231. which trigger builds when commits are made.
  232. </para></listitem>
  233. <listitem><para>
  234. Allows triggering of automated image booting
  235. and testing under the QuickEMUlator (QEMU).
  236. </para></listitem>
  237. <listitem><para>
  238. Supports incremental build testing and
  239. from-scratch builds.
  240. </para></listitem>
  241. <listitem><para>
  242. Shares output that allows developer
  243. testing and historical regression investigation.
  244. </para></listitem>
  245. <listitem><para>
  246. Creates output that can be used for releases.
  247. </para></listitem>
  248. <listitem><para>
  249. Allows scheduling of builds so that resources
  250. can be used efficiently.
  251. </para></listitem>
  252. </itemizedlist>
  253. </para></listitem>
  254. <listitem><para>
  255. <emphasis>Set up Test Machines:</emphasis>
  256. Use a small number of shared, high performance systems
  257. for testing purposes.
  258. Developers can use these systems for wider, more
  259. extensive testing while they continue to develop
  260. locally using their primary development system.
  261. </para></listitem>
  262. <listitem><para>
  263. <emphasis>Document Policies and Change Flow:</emphasis>
  264. The Yocto Project itself uses a hierarchical structure and a
  265. pull model.
  266. Scripts exist to create and send pull requests
  267. (i.e. <filename>create-pull-request</filename> and
  268. <filename>send-pull-request</filename>).
  269. This model is in line with other open source projects where
  270. maintainers are responsible for specific areas of the project
  271. and a single maintainer handles the final "top-of-tree" merges.
  272. <note>
  273. You can also use a more collective push model.
  274. The <filename>gitolite</filename> software supports both the
  275. push and pull models quite easily.
  276. </note></para>
  277. <para>As with any development environment, it is important
  278. to document the policy used as well as any main project
  279. guidelines so they are understood by everyone.
  280. It is also a good idea to have well structured
  281. commit messages, which are usually a part of a project's
  282. guidelines.
  283. Good commit messages are essential when looking back in time and
  284. trying to understand why changes were made.</para>
  285. <para>If you discover that changes are needed to the core
  286. layer of the project, it is worth sharing those with the
  287. community as soon as possible.
  288. Chances are if you have discovered the need for changes,
  289. someone else in the community needs them also.
  290. </para></listitem>
  291. <listitem><para>
  292. <emphasis>Development Environment Summary:</emphasis>
  293. Aside from the previous steps, some best practices exist
  294. within the Yocto Project development environment.
  295. Consider the following:
  296. <itemizedlist>
  297. <listitem><para>
  298. Use <ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink>
  299. as the source control system.
  300. </para></listitem>
  301. <listitem><para>
  302. Maintain your Metadata in layers that make sense
  303. for your situation.
  304. See the "<link linkend='understanding-and-creating-layers'>Understanding
  305. and Creating Layers</link>" section for more information on
  306. layers.
  307. </para></listitem>
  308. <listitem><para>
  309. Separate the project's Metadata and code by using
  310. separate Git repositories.
  311. See the
  312. "<ulink url='&YOCTO_DOCS_REF_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
  313. section for information on these repositories.
  314. See the
  315. "<link linkend='working-with-yocto-project-source-files'>Working With Yocto Project Source Files</link>"
  316. section for information on how to set up local Git
  317. repositories for related upstream Yocto Project
  318. Git repositories.
  319. </para></listitem>
  320. <listitem><para>
  321. Set up the directory for the shared state cache
  322. (<ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>)
  323. where it makes sense.
  324. For example, set up the sstate cache on a system used
  325. by developers in the same organization and share the
  326. same source directories on their machines.
  327. </para></listitem>
  328. <listitem><para>
  329. Set up an Autobuilder and have it populate the
  330. sstate cache and source directories.
  331. </para></listitem>
  332. <listitem><para>
  333. The Yocto Project community encourages you
  334. to send patches to the project to fix bugs or add features.
  335. If you do submit patches, follow the project commit
  336. guidelines for writing good commit messages.
  337. See the "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
  338. section.
  339. </para></listitem>
  340. <listitem><para>
  341. Send changes to the core sooner than later
  342. as others are likely to run into the same issues.
  343. For some guidance on mailing lists to use, see the list in the
  344. "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
  345. section.
  346. For a description of the available mailing lists, see the
  347. "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
  348. section in the Yocto Project Reference Manual.
  349. </para></listitem>
  350. </itemizedlist>
  351. </para></listitem>
  352. </orderedlist>
  353. </para>
  354. </section>
  355. <section id='submitting-a-defect-against-the-yocto-project'>
  356. <title>Submitting a Defect Against the Yocto Project</title>
  357. <para>
  358. Use the Yocto Project implementation of
  359. <ulink url='http://www.bugzilla.org/about/'>Bugzilla</ulink>
  360. to submit a defect (bug) against the Yocto Project.
  361. For additional information on this implementation of Bugzilla see the
  362. "<ulink url='&YOCTO_DOCS_REF_URL;#resources-bugtracker'>Yocto Project Bugzilla</ulink>"
  363. section in the Yocto Project Reference Manual.
  364. For more detail on any of the following steps, see the Yocto Project
  365. <ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>Bugzilla wiki page</ulink>.
  366. </para>
  367. <para>
  368. Use the following general steps to submit a bug"
  369. <orderedlist>
  370. <listitem><para>
  371. Open the Yocto Project implementation of
  372. <ulink url='&YOCTO_BUGZILLA_URL;'>Bugzilla</ulink>.
  373. </para></listitem>
  374. <listitem><para>
  375. Click "File a Bug" to enter a new bug.
  376. </para></listitem>
  377. <listitem><para>
  378. Choose the appropriate "Classification", "Product", and
  379. "Component" for which the bug was found.
  380. Bugs for the Yocto Project fall into one of several
  381. classifications, which in turn break down into several
  382. products and components.
  383. For example, for a bug against the
  384. <filename>meta-intel</filename> layer, you would choose
  385. "Build System, Metadata &amp; Runtime", "BSPs", and
  386. "bsps-meta-intel", respectively.
  387. </para></listitem>
  388. <listitem><para>
  389. Choose the "Version" of the Yocto Project for which you found
  390. the bug (e.g. &DISTRO;).
  391. </para></listitem>
  392. <listitem><para>
  393. Determine and select the "Severity" of the bug.
  394. The severity indicates how the bug impacted your work.
  395. </para></listitem>
  396. <listitem><para>
  397. Choose the "Hardware" that the bug impacts.
  398. </para></listitem>
  399. <listitem><para>
  400. Choose the "Architecture" that the bug impacts.
  401. </para></listitem>
  402. <listitem><para>
  403. Choose a "Documentation change" item for the bug.
  404. Fixing a bug might or might not affect the Yocto Project
  405. documentation.
  406. If you are unsure of the impact to the documentation, select
  407. "Don't Know".
  408. </para></listitem>
  409. <listitem><para>
  410. Provide a brief "Summary" of the bug.
  411. Try to limit your summary to just a line or two and be sure
  412. to capture the essence of the bug.
  413. </para></listitem>
  414. <listitem><para>
  415. Provide a detailed "Description" of the bug.
  416. You should provide as much detail as you can about the context,
  417. behavior, output, and so forth that surrounds the bug.
  418. You can even attach supporting files for output from logs by
  419. using the "Add an attachment" button.
  420. </para></listitem>
  421. <listitem><para>
  422. Click the "Submit Bug" button submit the bug.
  423. A new Bugzilla number is assigned to the bug and the defect
  424. is logged in the bug tracking system.
  425. </para></listitem>
  426. </orderedlist>
  427. Once you file a bug, the bug is processed by the Yocto Project Bug
  428. Triage Team and further details concerning the bug are assigned
  429. (e.g. priority and owner).
  430. You are the "Submitter" of the bug and any further categorization,
  431. progress, or comments on the bug result in Bugzilla sending you an
  432. automated email concerning the particular change or progress to the
  433. bug.
  434. </para>
  435. </section>
  436. <section id='how-to-submit-a-change'>
  437. <title>Submitting a Change to the Yocto Project</title>
  438. <para>
  439. Contributions to the Yocto Project and OpenEmbedded are very welcome.
  440. Because the system is extremely configurable and flexible, we recognize
  441. that developers will want to extend, configure or optimize it for
  442. their specific uses.
  443. </para>
  444. <para>
  445. The Yocto Project uses a mailing list and a patch-based workflow
  446. that is similar to the Linux kernel but contains important
  447. differences.
  448. In general, a mailing list exists through which you can submit
  449. patches.
  450. You should send patches to the appropriate mailing list so that they
  451. can be reviewed and merged by the appropriate maintainer.
  452. The specific mailing list you need to use depends on the
  453. location of the code you are changing.
  454. Each component (e.g. layer) should have a
  455. <filename>README</filename> file that indicates where to send
  456. the changes and which process to follow.
  457. </para>
  458. <para>
  459. You can send the patch to the mailing list using whichever approach
  460. you feel comfortable with to generate the patch.
  461. Once sent, the patch is usually reviewed by the community at large.
  462. If somebody has concerns with the patch, they will usually voice
  463. their concern over the mailing list.
  464. If a patch does not receive any negative reviews, the maintainer of
  465. the affected layer typically takes the patch, tests it, and then
  466. based on successful testing, merges the patch.
  467. </para>
  468. <para id='figuring-out-the-mailing-list-to-use'>
  469. The "poky" repository, which is the Yocto Project's reference build
  470. environment, is a hybrid repository that contains several
  471. individual pieces (e.g. BitBake, OpenEmbedded-Core, meta-yocto,
  472. documentation, and so forth) built using the combo-layer tool.
  473. The upstream location used for submitting changes varies by
  474. component:
  475. <itemizedlist>
  476. <listitem><para>
  477. <emphasis>Core Metadata:</emphasis>
  478. Send your patch to the
  479. <ulink url='http://lists.openembedded.org/mailman/listinfo/openembedded-core'>openembedded-core</ulink>
  480. mailing list. For example, a change to anything under
  481. the <filename>meta</filename> or
  482. <filename>scripts</filename> directories should be sent
  483. to this mailing list.
  484. </para></listitem>
  485. <listitem><para>
  486. <emphasis>BitBake:</emphasis>
  487. For changes to BitBake (i.e. anything under the
  488. <filename>bitbake</filename> directory), send your patch
  489. to the
  490. <ulink url='http://lists.openembedded.org/mailman/listinfo/bitbake-devel'>bitbake-devel</ulink>
  491. mailing list.
  492. </para></listitem>
  493. <listitem><para>
  494. <emphasis>"meta-yocto-bsp" and "meta-poky" trees:</emphasis>
  495. These trees are
  496. part of the "meta-yocto" repository in the Yocto Project
  497. source repositories.
  498. Use the
  499. <ulink url='https://lists.yoctoproject.org/listinfo/poky'>poky</ulink>
  500. mailing list.
  501. </para></listitem>
  502. </itemizedlist>
  503. </para>
  504. <para>
  505. For changes to other layers hosted in the Yocto Project source
  506. repositories (i.e. <filename>yoctoproject.org</filename>), tools,
  507. and the Yocto Project documentation, use the
  508. <ulink url='https://lists.yoctoproject.org/listinfo/yocto'>Yocto Project</ulink>
  509. general mailing list.
  510. <note>
  511. Sometimes a layer's documentation specifies to use a
  512. particular mailing list.
  513. If so, use that list.
  514. </note>
  515. For additional recipes that do not fit into the core Metadata, you
  516. should determine which layer the recipe should go into and submit
  517. the change in the manner recommended by the documentation (e.g.
  518. the <filename>README</filename> file) supplied with the layer.
  519. If in doubt, please ask on the Yocto general mailing list or on
  520. the openembedded-devel mailing list.
  521. </para>
  522. <para>
  523. You can also push a change upstream and request a maintainer to
  524. pull the change into the component's upstream repository.
  525. You do this by pushing to a contribution repository that is upstream.
  526. See the
  527. "<ulink url='&YOCTO_DOCS_REF_URL;#workflows'>Workflows</ulink>"
  528. section in the Yocto Project Reference Manual for additional
  529. concepts on working in the Yocto Project development environment.
  530. </para>
  531. <para>
  532. Two commonly used testing repositories exist for
  533. OpenEmbedded-Core:
  534. <itemizedlist>
  535. <listitem><para>
  536. <emphasis>"ross/mut" branch:</emphasis>
  537. The "mut" (master-under-test) tree
  538. exists in the <filename>poky-contrib</filename> repository
  539. in the
  540. <ulink url='&YOCTO_GIT_URL;'>Yocto Project source repositories</ulink>.
  541. </para></listitem>
  542. <listitem><para>
  543. <emphasis>"master-next" branch:</emphasis>
  544. This branch is part of the main
  545. "poky" repository in the Yocto Project source repositories.
  546. </para></listitem>
  547. </itemizedlist>
  548. Maintainers use these branches to test submissions prior to merging
  549. patches.
  550. Thus, you can get an idea of the status of a patch based on
  551. whether the patch has been merged into one of these branches.
  552. <note>
  553. This system is imperfect and changes can sometimes get lost in the
  554. flow.
  555. Asking about the status of a patch or change is reasonable if the
  556. change has been idle for a while with no feedback.
  557. The Yocto Project does have plans to use
  558. <ulink url='https://en.wikipedia.org/wiki/Patchwork_(software)'>Patchwork</ulink>
  559. to track the status of patches and also to automatically preview
  560. patches.
  561. </note>
  562. </para>
  563. <para>
  564. The following sections provide procedures for submitting a change.
  565. </para>
  566. <section id='pushing-a-change-upstream'>
  567. <title>Using Scripts to Push a Change Upstream and Request a Pull</title>
  568. <para>
  569. Follow this procedure to push a change to an upstream "contrib"
  570. Git repository:
  571. <note>
  572. You can find general Git information on how to push a change
  573. upstream in the
  574. <ulink url='http://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows'>Git Community Book</ulink>.
  575. </note>
  576. <orderedlist>
  577. <listitem><para>
  578. <emphasis>Make Your Changes Locally:</emphasis>
  579. Make your changes in your local Git repository.
  580. You should make small, controlled, isolated changes.
  581. Keeping changes small and isolated aids review,
  582. makes merging/rebasing easier and keeps the change
  583. history clean should anyone need to refer to it in
  584. future.
  585. </para></listitem>
  586. <listitem><para>
  587. <emphasis>Stage Your Changes:</emphasis>
  588. Stage your changes by using the <filename>git add</filename>
  589. command on each file you changed.
  590. </para></listitem>
  591. <listitem><para id='making-sure-you-have-correct-commit-information'>
  592. <emphasis>Commit Your Changes:</emphasis>
  593. Commit the change by using the
  594. <filename>git commit</filename> command.
  595. Make sure your commit information follows standards by
  596. following these accepted conventions:
  597. <itemizedlist>
  598. <listitem><para>
  599. Be sure to include a "Signed-off-by:" line in the
  600. same style as required by the Linux kernel.
  601. Adding this line signifies that you, the submitter,
  602. have agreed to the Developer's Certificate of
  603. Origin 1.1 as follows:
  604. <literallayout class='monospaced'>
  605. Developer's Certificate of Origin 1.1
  606. By making a contribution to this project, I certify that:
  607. (a) The contribution was created in whole or in part by me and I
  608. have the right to submit it under the open source license
  609. indicated in the file; or
  610. (b) The contribution is based upon previous work that, to the best
  611. of my knowledge, is covered under an appropriate open source
  612. license and I have the right under that license to submit that
  613. work with modifications, whether created in whole or in part
  614. by me, under the same open source license (unless I am
  615. permitted to submit under a different license), as indicated
  616. in the file; or
  617. (c) The contribution was provided directly to me by some other
  618. person who certified (a), (b) or (c) and I have not modified
  619. it.
  620. (d) I understand and agree that this project and the contribution
  621. are public and that a record of the contribution (including all
  622. personal information I submit with it, including my sign-off) is
  623. maintained indefinitely and may be redistributed consistent with
  624. this project or the open source license(s) involved.
  625. </literallayout>
  626. </para></listitem>
  627. <listitem><para>
  628. Provide a single-line summary of the change.
  629. and,
  630. if more explanation is needed, provide more
  631. detail in the body of the commit.
  632. This summary is typically viewable in the
  633. "shortlist" of changes.
  634. Thus, providing something short and descriptive
  635. that gives the reader a summary of the change is
  636. useful when viewing a list of many commits.
  637. You should prefix this short description with the
  638. recipe name (if changing a recipe), or else with
  639. the short form path to the file being changed.
  640. </para></listitem>
  641. <listitem><para>
  642. For the body of the commit message, provide
  643. detailed information that describes what you
  644. changed, why you made the change, and the approach
  645. you used.
  646. It might also be helpful if you mention how you
  647. tested the change.
  648. Provide as much detail as you can in the body of
  649. the commit message.
  650. <note>
  651. You do not need to provide a more detailed
  652. explanation of a change if the change is
  653. minor to the point of the single line
  654. summary providing all the information.
  655. </note>
  656. </para></listitem>
  657. <listitem><para>
  658. If the change addresses a specific bug or issue
  659. that is associated with a bug-tracking ID,
  660. include a reference to that ID in your detailed
  661. description.
  662. For example, the Yocto Project uses a specific
  663. convention for bug references - any commit that
  664. addresses a specific bug should use the following
  665. form for the detailed description.
  666. Be sure to use the actual bug-tracking ID from
  667. Bugzilla for
  668. <replaceable>bug-id</replaceable>:
  669. <literallayout class='monospaced'>
  670. Fixes [YOCTO #<replaceable>bug-id</replaceable>]
  671. <replaceable>detailed description of change</replaceable>
  672. </literallayout>
  673. </para></listitem>
  674. </itemizedlist>
  675. </para></listitem>
  676. <listitem><para>
  677. <emphasis>Push Your Commits to a "Contrib" Upstream:</emphasis>
  678. If you have arranged for permissions to push to an
  679. upstream contrib repository, push the change to that
  680. repository:
  681. <literallayout class='monospaced'>
  682. $ git push <replaceable>upstream_remote_repo</replaceable> <replaceable>local_branch_name</replaceable>
  683. </literallayout>
  684. For example, suppose you have permissions to push into the
  685. upstream <filename>meta-intel-contrib</filename>
  686. repository and you are working in a local branch named
  687. <replaceable>your_name</replaceable><filename>/README</filename>.
  688. The following command pushes your local commits to the
  689. <filename>meta-intel-contrib</filename> upstream
  690. repository and puts the commit in a branch named
  691. <replaceable>your_name</replaceable><filename>/README</filename>:
  692. <literallayout class='monospaced'>
  693. $ git push meta-intel-contrib <replaceable>your_name</replaceable>/README
  694. </literallayout>
  695. </para></listitem>
  696. <listitem><para id='push-determine-who-to-notify'>
  697. <emphasis>Determine Who to Notify:</emphasis>
  698. Determine the maintainer or the mailing list
  699. that you need to notify for the change.</para>
  700. <para>Before submitting any change, you need to be sure
  701. who the maintainer is or what mailing list that you need
  702. to notify.
  703. Use either these methods to find out:
  704. <itemizedlist>
  705. <listitem><para>
  706. <emphasis>Maintenance File:</emphasis>
  707. Examine the <filename>maintainers.inc</filename>
  708. file, which is located in the
  709. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
  710. at
  711. <filename>meta-poky/conf/distro/include</filename>,
  712. to see who is responsible for code.
  713. </para></listitem>
  714. <listitem><para>
  715. <emphasis>Search by File:</emphasis>
  716. Using <ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink>,
  717. you can enter the following command to bring up a
  718. short list of all commits against a specific file:
  719. <literallayout class='monospaced'>
  720. git shortlog -- <replaceable>filename</replaceable>
  721. </literallayout>
  722. Just provide the name of the file for which you
  723. are interested.
  724. The information returned is not ordered by history
  725. but does include a list of everyone who has
  726. committed grouped by name.
  727. From the list, you can see who is responsible for
  728. the bulk of the changes against the file.
  729. </para></listitem>
  730. <listitem><para>
  731. <emphasis>Examine the List of Mailing Lists:</emphasis>
  732. For a list of the Yocto Project and related mailing
  733. lists, see the
  734. "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>"
  735. section in the Yocto Project Reference Manual.
  736. </para></listitem>
  737. </itemizedlist>
  738. </para></listitem>
  739. <listitem><para>
  740. <emphasis>Make a Pull Request:</emphasis>
  741. Notify the maintainer or the mailing list that you have
  742. pushed a change by making a pull request.</para>
  743. <para>The Yocto Project provides two scripts that
  744. conveniently let you generate and send pull requests to the
  745. Yocto Project.
  746. These scripts are <filename>create-pull-request</filename>
  747. and <filename>send-pull-request</filename>.
  748. You can find these scripts in the
  749. <filename>scripts</filename> directory within the
  750. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
  751. (e.g. <filename>~/poky/scripts</filename>).
  752. </para>
  753. <para>Using these scripts correctly formats the requests
  754. without introducing any whitespace or HTML formatting.
  755. The maintainer that receives your patches either directly
  756. or through the mailing list needs to be able to save and
  757. apply them directly from your emails.
  758. Using these scripts is the preferred method for sending
  759. patches.</para>
  760. <para>First, create the pull request.
  761. For example, the following command runs the script,
  762. specifies the upstream repository in the contrib directory
  763. into which you pushed the change, and provides a subject
  764. line in the created patch files:
  765. <literallayout class='monospaced'>
  766. $ ~/poky/scripts/create-pull-request -u meta-intel-contrib -s "Updated Manual Section Reference in README"
  767. </literallayout>
  768. Running this script forms
  769. <filename>*.patch</filename> files in a folder named
  770. <filename>pull-</filename><replaceable>PID</replaceable>
  771. in the current directory.
  772. One of the patch files is a cover letter.</para>
  773. <para>Before running the
  774. <filename>send-pull-request</filename> script, you must
  775. edit the cover letter patch to insert information about
  776. your change.
  777. After editing the cover letter, send the pull request.
  778. For example, the following command runs the script and
  779. specifies the patch directory and email address.
  780. In this example, the email address is a mailing list:
  781. <literallayout class='monospaced'>
  782. $ ~/poky/scripts/send-pull-request -p ~/meta-intel/pull-10565 -t meta-intel@yoctoproject.org
  783. </literallayout>
  784. You need to follow the prompts as the script is
  785. interactive.
  786. <note>
  787. For help on using these scripts, simply provide the
  788. <filename>-h</filename> argument as follows:
  789. <literallayout class='monospaced'>
  790. $ poky/scripts/create-pull-request -h
  791. $ poky/scripts/send-pull-request -h
  792. </literallayout>
  793. </note>
  794. </para></listitem>
  795. </orderedlist>
  796. </para>
  797. </section>
  798. <section id='submitting-a-patch'>
  799. <title>Using Email to Submit a Patch</title>
  800. <para>
  801. You can submit patches without using the
  802. <filename>create-pull-request</filename> and
  803. <filename>send-pull-request</filename> scripts described in the
  804. previous section.
  805. However, keep in mind, the preferred method is to use the scripts.
  806. </para>
  807. <para>
  808. Depending on the components changed, you need to submit the email
  809. to a specific mailing list.
  810. For some guidance on which mailing list to use, see the
  811. <link linkend='figuring-out-the-mailing-list-to-use'>beginning</link>
  812. of this section.
  813. For a description of all the available mailing lists, see the
  814. "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
  815. section in the Yocto Project Reference Manual.
  816. </para>
  817. <para>
  818. Here is the general procedure on how to submit a patch through
  819. email without using the scripts:
  820. <orderedlist>
  821. <listitem><para>
  822. <emphasis>Make Your Changes Locally:</emphasis>
  823. Make your changes in your local Git repository.
  824. You should make small, controlled, isolated changes.
  825. Keeping changes small and isolated aids review,
  826. makes merging/rebasing easier and keeps the change
  827. history clean should anyone need to refer to it in
  828. future.
  829. </para></listitem>
  830. <listitem><para>
  831. <emphasis>Stage Your Changes:</emphasis>
  832. Stage your changes by using the <filename>git add</filename>
  833. command on each file you changed.
  834. </para></listitem>
  835. <listitem><para>
  836. <emphasis>Commit Your Changes:</emphasis>
  837. Commit the change by using the
  838. <filename>git commit --signoff</filename> command.
  839. Using the <filename>--signoff</filename> option identifies
  840. you as the person making the change and also satisfies
  841. the Developer's Certificate of Origin (DCO) shown earlier.
  842. </para>
  843. <para>When you form a commit, you must follow certain
  844. standards established by the Yocto Project development
  845. team.
  846. See
  847. <link linkend='making-sure-you-have-correct-commit-information'>Step 3</link>
  848. in the previous section for information on how to
  849. provide commit information that meets Yocto Project
  850. commit message standards.
  851. </para></listitem>
  852. <listitem><para>
  853. <emphasis>Format the Commit:</emphasis>
  854. Format the commit into an email message.
  855. To format commits, use the
  856. <filename>git format-patch</filename> command.
  857. When you provide the command, you must include a revision
  858. list or a number of patches as part of the command.
  859. For example, either of these two commands takes your most
  860. recent single commit and formats it as an email message in
  861. the current directory:
  862. <literallayout class='monospaced'>
  863. $ git format-patch -1
  864. </literallayout>
  865. or
  866. <literallayout class='monospaced'>
  867. $ git format-patch HEAD~
  868. </literallayout></para>
  869. <para>After the command is run, the current directory
  870. contains a numbered <filename>.patch</filename> file for
  871. the commit.</para>
  872. <para>If you provide several commits as part of the
  873. command, the <filename>git format-patch</filename> command
  874. produces a series of numbered files in the current
  875. directory – one for each commit.
  876. If you have more than one patch, you should also use the
  877. <filename>--cover</filename> option with the command,
  878. which generates a cover letter as the first "patch" in
  879. the series.
  880. You can then edit the cover letter to provide a
  881. description for the series of patches.
  882. For information on the
  883. <filename>git format-patch</filename> command,
  884. see <filename>GIT_FORMAT_PATCH(1)</filename> displayed
  885. using the <filename>man git-format-patch</filename>
  886. command.
  887. <note>
  888. If you are or will be a frequent contributor to the
  889. Yocto Project or to OpenEmbedded, you might consider
  890. requesting a contrib area and the necessary associated
  891. rights.
  892. </note>
  893. </para></listitem>
  894. <listitem><para>
  895. <emphasis>Import the Files Into Your Mail Client:</emphasis>
  896. Import the files into your mail client by using the
  897. <filename>git send-email</filename> command.
  898. <note>
  899. In order to use <filename>git send-email</filename>,
  900. you must have the proper Git packages installed on
  901. your host.
  902. For Ubuntu, Debian, and Fedora the package is
  903. <filename>git-email</filename>.
  904. </note></para>
  905. <para>The <filename>git send-email</filename> command
  906. sends email by using a local or remote Mail Transport Agent
  907. (MTA) such as <filename>msmtp</filename>,
  908. <filename>sendmail</filename>, or through a direct
  909. <filename>smtp</filename> configuration in your Git
  910. <filename>~/.gitconfig</filename> file.
  911. If you are submitting patches through email only, it is
  912. very important that you submit them without any whitespace
  913. or HTML formatting that either you or your mailer
  914. introduces.
  915. The maintainer that receives your patches needs to be able
  916. to save and apply them directly from your emails.
  917. A good way to verify that what you are sending will be
  918. applicable by the maintainer is to do a dry run and send
  919. them to yourself and then save and apply them as the
  920. maintainer would.</para>
  921. <para>The <filename>git send-email</filename> command is
  922. the preferred method for sending your patches using
  923. email since there is no risk of compromising whitespace
  924. in the body of the message, which can occur when you use
  925. your own mail client.
  926. The command also has several options that let you
  927. specify recipients and perform further editing of the
  928. email message.
  929. For information on how to use the
  930. <filename>git send-email</filename> command,
  931. see <filename>GIT-SEND-EMAIL(1)</filename> displayed using
  932. the <filename>man git-send-email</filename> command.
  933. </para></listitem>
  934. </orderedlist>
  935. </para>
  936. </section>
  937. </section>
  938. </chapter>
  939. <!--
  940. vim: expandtab tw=80 ts=4
  941. -->