dev-manual-model.xml 120 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195
  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-model'>
  5. <title>Common Development Models</title>
  6. <para>
  7. Many development models exist for which you can use the Yocto Project.
  8. This chapter overviews simple methods that use tools provided by the
  9. Yocto Project:
  10. <itemizedlist>
  11. <listitem><para><emphasis>System Development:</emphasis>
  12. System Development covers Board Support Package (BSP) development
  13. and kernel modification or configuration.
  14. For an example on how to create a BSP, see the
  15. "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
  16. section in the Yocto Project Board Support Package (BSP)
  17. Developer's Guide.
  18. For more complete information on how to work with the kernel,
  19. see the
  20. <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
  21. </para></listitem>
  22. <listitem><para><emphasis>User Application Development:</emphasis>
  23. User Application Development covers development of applications
  24. that you intend to run on target hardware.
  25. For information on how to set up your host development system for
  26. user-space application development, see the
  27. <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
  28. For a simple example of user-space application development using
  29. the <trademark class='trade'>Eclipse</trademark> IDE, see the
  30. "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-developing-applications-using-eclipse'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></ulink>" section.
  31. </para></listitem>
  32. <listitem><para><emphasis>Temporary Source Code Modification:</emphasis>
  33. Direct modification of temporary source code is a convenient
  34. development model to quickly iterate and develop towards a
  35. solution.
  36. Once you implement the solution, you should of course take
  37. steps to get the changes upstream and applied in the affected
  38. recipes.
  39. </para></listitem>
  40. <listitem><para><emphasis>Image Development using Toaster:</emphasis>
  41. You can use <ulink url='&YOCTO_HOME_URL;/Tools-resources/projects/toaster'>Toaster</ulink>
  42. to build custom operating system images within the build
  43. environment.
  44. Toaster provides an efficient interface to the OpenEmbedded build
  45. that allows you to start builds and examine build statistics.
  46. </para></listitem>
  47. <listitem><para><emphasis>Using a Development Shell:</emphasis>
  48. You can use a
  49. <link linkend='platdev-appdev-devshell'><filename>devshell</filename></link>
  50. to efficiently debug
  51. commands or simply edit packages.
  52. Working inside a development shell is a quick way to set up the
  53. OpenEmbedded build environment to work on parts of a project.
  54. </para></listitem>
  55. </itemizedlist>
  56. </para>
  57. <section id='system-development-model'>
  58. <title>System Development Workflow</title>
  59. <para>
  60. System development involves modification or creation of an image that you want to run on
  61. a specific hardware target.
  62. Usually, when you want to create an image that runs on embedded hardware, the image does
  63. not require the same number of features that a full-fledged Linux distribution provides.
  64. Thus, you can create a much smaller image that is designed to use only the
  65. features for your particular hardware.
  66. </para>
  67. <para>
  68. To help you understand how system development works in the Yocto Project, this section
  69. covers two types of image development: BSP creation and kernel modification or
  70. configuration.
  71. </para>
  72. <section id='developing-a-board-support-package-bsp'>
  73. <title>Developing a Board Support Package (BSP)</title>
  74. <para>
  75. A BSP is a collection of recipes that, when applied during a build, results in
  76. an image that you can run on a particular board.
  77. Thus, the package when compiled into the new image, supports the operation of the board.
  78. </para>
  79. <note>
  80. For a brief list of terms used when describing the development process in the Yocto Project,
  81. see the "<link linkend='yocto-project-terms'>Yocto Project Terms</link>" section.
  82. </note>
  83. <para>
  84. The remainder of this section presents the basic
  85. steps used to create a BSP using the Yocto Project's
  86. <ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>BSP Tools</ulink>.
  87. Although not required for BSP creation, the
  88. <filename>meta-intel</filename> repository, which contains
  89. many BSPs supported by the Yocto Project, is part of the example.
  90. </para>
  91. <para>
  92. For an example that shows how to create a new layer using the tools, see the
  93. "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
  94. section in the Yocto Project Board Support Package (BSP) Developer's Guide.
  95. </para>
  96. <para>
  97. The following illustration and list summarize the BSP creation general workflow.
  98. </para>
  99. <para>
  100. <imagedata fileref="figures/bsp-dev-flow.png" width="6in" depth="7in" align="center" scalefit="1" />
  101. </para>
  102. <para>
  103. <orderedlist>
  104. <listitem><para><emphasis>Set up your host development system to support
  105. development using the Yocto Project</emphasis>: See the
  106. "<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distribution</ulink>"
  107. and the
  108. "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>" sections both
  109. in the Yocto Project Quick Start for requirements.</para></listitem>
  110. <listitem><para><emphasis>Establish a local copy of the project files on your
  111. system</emphasis>: You need this <link linkend='source-directory'>Source
  112. Directory</link> available on your host system.
  113. Having these files on your system gives you access to the build
  114. process and to the tools you need.
  115. For information on how to set up the Source Directory,
  116. see the
  117. "<link linkend='getting-setup'>Getting Set Up</link>" section.</para></listitem>
  118. <listitem><para><emphasis>Establish the <filename>meta-intel</filename>
  119. repository on your system</emphasis>: Having local copies
  120. of these supported BSP layers on your system gives you
  121. access to layers you might be able to build on or modify
  122. to create your BSP.
  123. For information on how to get these files, see the
  124. "<link linkend='getting-setup'>Getting Set Up</link>" section.</para></listitem>
  125. <listitem><para><emphasis>Create your own BSP layer using the
  126. <ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'><filename>yocto-bsp</filename></ulink> script</emphasis>:
  127. Layers are ideal for
  128. isolating and storing work for a given piece of hardware.
  129. A layer is really just a location or area in which you place
  130. the recipes and configurations for your BSP.
  131. In fact, a BSP is, in itself, a special type of layer.
  132. The simplest way to create a new BSP layer that is compliant with the
  133. Yocto Project is to use the <filename>yocto-bsp</filename> script.
  134. For information about that script, see the
  135. "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
  136. section in the Yocto Project Board Support (BSP) Developer's Guide.
  137. </para>
  138. <para>
  139. Another example that illustrates a layer
  140. is an application.
  141. Suppose you are creating an application that has
  142. library or other dependencies in order for it to
  143. compile and run.
  144. The layer, in this case, would be where all the
  145. recipes that define those dependencies are kept.
  146. The key point for a layer is that it is an isolated
  147. area that contains all the relevant information for
  148. the project that the OpenEmbedded build system knows
  149. about.
  150. For more information on layers, see the
  151. "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>"
  152. section.
  153. For more information on BSP layers, see the
  154. "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
  155. section in the Yocto Project Board Support Package (BSP)
  156. Developer's Guide.
  157. <note>
  158. <para>
  159. Five BSPs exist that are part of the Yocto Project release:
  160. <filename>beaglebone</filename> (ARM),
  161. <filename>mpc8315e</filename> (PowerPC),
  162. and <filename>edgerouter</filename> (MIPS).
  163. The recipes and configurations for these five BSPs
  164. are located and dispersed within the
  165. <link linkend='source-directory'>Source Directory</link>.
  166. </para>
  167. <para>
  168. Three core Intel BSPs exist as part of the Yocto
  169. Project release in the
  170. <filename>meta-intel</filename> layer:
  171. <itemizedlist>
  172. <listitem><para><filename>intel-core2-32</filename>,
  173. which is a BSP optimized for the Core2 family of CPUs
  174. as well as all CPUs prior to the Silvermont core.
  175. </para></listitem>
  176. <listitem><para><filename>intel-corei7-64</filename>,
  177. which is a BSP optimized for Nehalem and later
  178. Core and Xeon CPUs as well as Silvermont and later
  179. Atom CPUs, such as the Baytrail SoCs.
  180. </para></listitem>
  181. <listitem><para><filename>intel-quark</filename>,
  182. which is a BSP optimized for the Intel Galileo
  183. gen1 &amp; gen2 development boards.
  184. </para></listitem>
  185. </itemizedlist>
  186. </para>
  187. </note>
  188. </para>
  189. <para>When you set up a layer for a new BSP, you should follow a standard layout.
  190. This layout is described in the
  191. "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout'>Example Filesystem Layout</ulink>"
  192. section of the Board Support Package (BSP) Development Guide.
  193. In the standard layout, you will notice a suggested structure for recipes and
  194. configuration information.
  195. You can see the standard layout for a BSP by examining
  196. any supported BSP found in the <filename>meta-intel</filename> layer inside
  197. the Source Directory.</para></listitem>
  198. <listitem><para><emphasis>Make configuration changes to your new BSP
  199. layer</emphasis>: The standard BSP layer structure organizes the files you need
  200. to edit in <filename>conf</filename> and several <filename>recipes-*</filename>
  201. directories within the BSP layer.
  202. Configuration changes identify where your new layer is on the local system
  203. and identify which kernel you are going to use.
  204. When you run the <filename>yocto-bsp</filename> script, you are able to interactively
  205. configure many things for the BSP (e.g. keyboard, touchscreen, and so forth).
  206. </para></listitem>
  207. <listitem><para><emphasis>Make recipe changes to your new BSP layer</emphasis>: Recipe
  208. changes include altering recipes (<filename>.bb</filename> files), removing
  209. recipes you do not use, and adding new recipes or append files
  210. (<filename>.bbappend</filename>) that you need to support your hardware.
  211. </para></listitem>
  212. <listitem><para><emphasis>Prepare for the build</emphasis>: Once you have made all the
  213. changes to your BSP layer, there remains a few things
  214. you need to do for the OpenEmbedded build system in order for it to create your image.
  215. You need to get the build environment ready by sourcing an environment setup script
  216. (i.e. <filename>oe-init-build-env</filename> or
  217. <filename>oe-init-build-env-memres</filename>)
  218. and you need to be sure two key configuration files are configured appropriately:
  219. the <filename>conf/local.conf</filename> and the
  220. <filename>conf/bblayers.conf</filename> file.
  221. You must make the OpenEmbedded build system aware of your new layer.
  222. See the
  223. "<link linkend='enabling-your-layer'>Enabling Your Layer</link>" section
  224. for information on how to let the build system know about your new layer.</para>
  225. <para>The entire process for building an image is overviewed in the section
  226. "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>" section
  227. of the Yocto Project Quick Start.
  228. You might want to reference this information.</para></listitem>
  229. <listitem><para><emphasis>Build the image</emphasis>: The OpenEmbedded build system
  230. uses the BitBake tool to build images based on the type of image you want to create.
  231. You can find more information about BitBake in the
  232. <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
  233. </para>
  234. <para>The build process supports several types of images to satisfy different needs.
  235. See the
  236. "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" chapter
  237. in the Yocto Project Reference Manual for information on
  238. supported images.</para></listitem>
  239. </orderedlist>
  240. </para>
  241. <para>
  242. You can view a video presentation on "Building Custom Embedded Images with Yocto"
  243. at <ulink url='http://free-electrons.com/blog/elc-2011-videos'>Free Electrons</ulink>.
  244. After going to the page, just search for "Embedded".
  245. You can also find supplemental information in the
  246. <ulink url='&YOCTO_DOCS_BSP_URL;'>
  247. Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
  248. Finally, there is helpful material and links on this
  249. <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'>wiki page</ulink>.
  250. Although a bit dated, you might find the information on the wiki
  251. helpful.
  252. </para>
  253. </section>
  254. <section id='modifying-the-kernel'>
  255. <title><anchor id='kernel-spot' />Modifying the Kernel</title>
  256. <para>
  257. Kernel modification involves changing the Yocto Project kernel, which could involve changing
  258. configuration options as well as adding new kernel recipes.
  259. Configuration changes can be added in the form of configuration fragments, while recipe
  260. modification comes through the kernel's <filename>recipes-kernel</filename> area
  261. in a kernel layer you create.
  262. </para>
  263. <para>
  264. The remainder of this section presents a high-level overview of the Yocto Project
  265. kernel architecture and the steps to modify the kernel.
  266. You can reference the
  267. "<link linkend='patching-the-kernel'>Patching the Kernel</link>" section
  268. for an example that changes the source code of the kernel.
  269. For information on how to configure the kernel, see the
  270. "<link linkend='configuring-the-kernel'>Configuring the Kernel</link>" section.
  271. For more information on the kernel and on modifying the kernel, see the
  272. <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
  273. </para>
  274. <section id='kernel-overview'>
  275. <title>Kernel Overview</title>
  276. <para>
  277. Traditionally, when one thinks of a patched kernel, they think of a base kernel
  278. source tree and a fixed structure that contains kernel patches.
  279. The Yocto Project, however, employs mechanisms that, in a sense, result in a kernel source
  280. generator.
  281. By the end of this section, this analogy will become clearer.
  282. </para>
  283. <para>
  284. You can find a web interface to the Yocto Project kernel source repositories at
  285. <ulink url='&YOCTO_GIT_URL;'></ulink>.
  286. If you look at the interface, you will see to the left a grouping of
  287. Git repositories titled "Yocto Linux Kernel."
  288. Within this group, you will find several kernels supported by
  289. the Yocto Project:
  290. <itemizedlist>
  291. <listitem><para><emphasis>
  292. <filename>linux-yocto-3.14</filename></emphasis> - The
  293. stable Yocto Project kernel to use with the Yocto
  294. Project Releases 1.6 and 1.7.
  295. This kernel is based on the Linux 3.14 released kernel.
  296. </para></listitem>
  297. <listitem><para><emphasis>
  298. <filename>linux-yocto-3.17</filename></emphasis> - An
  299. additional, unsupported Yocto Project kernel used with
  300. the Yocto Project Release 1.7.
  301. This kernel is based on the Linux 3.17 released kernel.
  302. </para></listitem>
  303. <listitem><para><emphasis>
  304. <filename>linux-yocto-3.19</filename></emphasis> - The
  305. stable Yocto Project kernel to use with the Yocto
  306. Project Release 1.8.
  307. This kernel is based on the Linux 3.19 released kernel.
  308. </para></listitem>
  309. <listitem><para><emphasis>
  310. <filename>linux-yocto-4.1</filename></emphasis> - The
  311. stable Yocto Project kernel to use with the Yocto
  312. Project Release 2.0.
  313. This kernel is based on the Linux 4.1 released kernel.
  314. </para></listitem>
  315. <listitem><para><emphasis>
  316. <filename>linux-yocto-4.4</filename></emphasis> - The
  317. stable Yocto Project kernel to use with the Yocto
  318. Project Release 2.1.
  319. This kernel is based on the Linux 4.4 released kernel.
  320. </para></listitem>
  321. <listitem><para><emphasis>
  322. <filename>linux-yocto-dev</filename></emphasis> - A
  323. development kernel based on the latest upstream release
  324. candidate available.
  325. </para></listitem>
  326. </itemizedlist>
  327. <note>
  328. Long Term Support Initiative (LTSI) for Yocto Project kernels
  329. is as follows:
  330. <itemizedlist>
  331. <listitem><para>For Yocto Project releases 1.7, 1.8, and 2.0,
  332. the LTSI kernel is <filename>linux-yocto-3.14</filename>.
  333. </para></listitem>
  334. <listitem><para>For Yocto Project release 2.1, the
  335. LTSI kernel is <filename>linux-yocto-4.1</filename>.
  336. </para></listitem>
  337. </itemizedlist>
  338. </note>
  339. </para>
  340. <para>
  341. The kernels are maintained using the Git revision control system
  342. that structures them using the familiar "tree", "branch", and "leaf" scheme.
  343. Branches represent diversions from general code to more specific code, while leaves
  344. represent the end-points for a complete and unique kernel whose source files,
  345. when gathered from the root of the tree to the leaf, accumulate to create the files
  346. necessary for a specific piece of hardware and its features.
  347. The following figure displays this concept:
  348. <para>
  349. <imagedata fileref="figures/kernel-overview-1.png"
  350. width="6in" depth="6in" align="center" scale="100" />
  351. </para>
  352. <para>
  353. Within the figure, the "Kernel.org Branch Point" represents the point in the tree
  354. where a supported base kernel is modified from the Linux kernel.
  355. For example, this could be the branch point for the <filename>linux-yocto-3.19</filename>
  356. kernel.
  357. Thus, everything further to the right in the structure is based on the
  358. <filename>linux-yocto-3.19</filename> kernel.
  359. Branch points to the right in the figure represent where the
  360. <filename>linux-yocto-3.19</filename> kernel is modified for specific hardware
  361. or types of kernels, such as real-time kernels.
  362. Each leaf thus represents the end-point for a kernel designed to run on a specific
  363. targeted device.
  364. </para>
  365. <para>
  366. The overall result is a Git-maintained repository from which all the supported
  367. kernel types can be derived for all the supported devices.
  368. A big advantage to this scheme is the sharing of common features by keeping them in
  369. "larger" branches within the tree.
  370. This practice eliminates redundant storage of similar features shared among kernels.
  371. </para>
  372. <note>
  373. Keep in mind the figure does not take into account all the supported Yocto
  374. Project kernel types, but rather shows a single generic kernel just for conceptual purposes.
  375. Also keep in mind that this structure represents the Yocto Project source repositories
  376. that are either pulled from during the build or established on the host development system
  377. prior to the build by either cloning a particular kernel's Git repository or by
  378. downloading and unpacking a tarball.
  379. </note>
  380. <para>
  381. Upstream storage of all the available kernel source code is one thing, while
  382. representing and using the code on your host development system is another.
  383. Conceptually, you can think of the kernel source repositories as all the
  384. source files necessary for all the supported kernels.
  385. As a developer, you are just interested in the source files for the kernel on
  386. which you are working.
  387. And, furthermore, you need them available on your host system.
  388. </para>
  389. <para>
  390. Kernel source code is available on your host system a couple of different
  391. ways.
  392. If you are working in the kernel all the time, you probably would want
  393. to set up your own local Git repository of the kernel tree.
  394. If you just need to make some patches to the kernel, you can access
  395. temporary kernel source files that were extracted and used
  396. during a build.
  397. We will just talk about working with the temporary source code.
  398. For more information on how to get kernel source code onto your
  399. host system, see the
  400. "<link linkend='local-kernel-files'>Yocto Project Kernel</link>"
  401. bulleted item earlier in the manual.
  402. </para>
  403. <para>
  404. What happens during the build?
  405. When you build the kernel on your development system, all files needed for the build
  406. are taken from the source repositories pointed to by the
  407. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> variable
  408. and gathered in a temporary work area
  409. where they are subsequently used to create the unique kernel.
  410. Thus, in a sense, the process constructs a local source tree specific to your
  411. kernel to generate the new kernel image - a source generator if you will.
  412. </para>
  413. The following figure shows the temporary file structure
  414. created on your host system when the build occurs.
  415. This
  416. <link linkend='build-directory'>Build Directory</link> contains all the
  417. source files used during the build.
  418. </para>
  419. <para>
  420. <imagedata fileref="figures/kernel-overview-2-generic.png"
  421. width="6in" depth="5in" align="center" scale="100" />
  422. </para>
  423. <para>
  424. Again, for additional information on the Yocto Project kernel's
  425. architecture and its branching strategy, see the
  426. <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
  427. You can also reference the
  428. "<link linkend='patching-the-kernel'>Patching the Kernel</link>"
  429. section for a detailed example that modifies the kernel.
  430. </para>
  431. </section>
  432. <section id='kernel-modification-workflow'>
  433. <title>Kernel Modification Workflow</title>
  434. <para>
  435. This illustration and the following list summarizes the kernel modification general workflow.
  436. </para>
  437. <para>
  438. <imagedata fileref="figures/kernel-dev-flow.png"
  439. width="6in" depth="5in" align="center" scalefit="1" />
  440. </para>
  441. <para>
  442. <orderedlist>
  443. <listitem><para><emphasis>Set up your host development system to support
  444. development using the Yocto Project</emphasis>: See
  445. "<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distribution</ulink>" and
  446. "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>" sections both
  447. in the Yocto Project Quick Start for requirements.</para></listitem>
  448. <listitem><para><emphasis>Establish a local copy of project files on your
  449. system</emphasis>: Having the <link linkend='source-directory'>Source
  450. Directory</link> on your system gives you access to the build process and tools
  451. you need.
  452. For information on how to get these files, see the bulleted item
  453. "<link linkend='local-yp-release'>Yocto Project Release</link>" earlier in this manual.
  454. </para></listitem>
  455. <listitem><para><emphasis>Establish the temporary kernel source files</emphasis>:
  456. Temporary kernel source files are kept in the
  457. <link linkend='build-directory'>Build Directory</link>
  458. created by the
  459. OpenEmbedded build system when you run BitBake.
  460. If you have never built the kernel in which you are
  461. interested, you need to run an initial build to
  462. establish local kernel source files.</para>
  463. <para>If you are building an image for the first time, you need to get the build
  464. environment ready by sourcing an environment setup script
  465. (i.e. <filename>oe-init-build-env</filename> or
  466. <filename>oe-init-build-env-memres</filename>).
  467. You also need to be sure two key configuration files
  468. (<filename>local.conf</filename> and <filename>bblayers.conf</filename>)
  469. are configured appropriately.</para>
  470. <para>The entire process for building an image is overviewed in the
  471. "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
  472. section of the Yocto Project Quick Start.
  473. You might want to reference this information.
  474. You can find more information on BitBake in the
  475. <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
  476. </para>
  477. <para>The build process supports several types of images to satisfy different needs.
  478. See the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" chapter in
  479. the Yocto Project Reference Manual for information on supported images.
  480. </para></listitem>
  481. <listitem><para><emphasis>Make changes to the kernel source code if
  482. applicable</emphasis>: Modifying the kernel does not always mean directly
  483. changing source files.
  484. However, if you have to do this, you make the changes to the files in the
  485. Build Directory.</para></listitem>
  486. <listitem><para><emphasis>Make kernel configuration changes if applicable</emphasis>:
  487. If your situation calls for changing the kernel's
  488. configuration, you can use
  489. <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'><filename>menuconfig</filename></ulink>,
  490. which allows you to interactively develop and test the
  491. configuration changes you are making to the kernel.
  492. Saving changes you make with
  493. <filename>menuconfig</filename> updates
  494. the kernel's <filename>.config</filename> file.
  495. <note><title>Warning</title>
  496. Try to resist the temptation to directly edit an
  497. existing <filename>.config</filename> file, which is
  498. found in the Build Directory at
  499. <filename>tmp/sysroots/<replaceable>machine-name</replaceable>/kernel</filename>.
  500. Doing so, can produce unexpected results when the
  501. OpenEmbedded build system regenerates the configuration
  502. file.
  503. </note>
  504. Once you are satisfied with the configuration
  505. changes made using <filename>menuconfig</filename>
  506. and you have saved them, you can directly compare the
  507. resulting <filename>.config</filename> file against an
  508. existing original and gather those changes into a
  509. <link linkend='creating-config-fragments'>configuration fragment file</link>
  510. to be referenced from within the kernel's
  511. <filename>.bbappend</filename> file.</para>
  512. <para>Additionally, if you are working in a BSP layer
  513. and need to modify the BSP's kernel's configuration,
  514. you can use the
  515. <ulink url='&YOCTO_DOCS_BSP_URL;#managing-kernel-patches-and-config-items-with-yocto-kernel'><filename>yocto-kernel</filename></ulink>
  516. script as well as <filename>menuconfig</filename>.
  517. The <filename>yocto-kernel</filename> script lets
  518. you interactively set up kernel configurations.
  519. </para></listitem>
  520. <listitem><para><emphasis>Rebuild the kernel image with your changes</emphasis>:
  521. Rebuilding the kernel image applies your changes.
  522. </para></listitem>
  523. </orderedlist>
  524. </para>
  525. </section>
  526. </section>
  527. </section>
  528. <section id='application-development-workflow-using-an-sdk'>
  529. <title>Application Development Workflow Using an SDK</title>
  530. <para>
  531. Standard and extensible Software Development Kits (SDK) make it easy
  532. to develop applications inside or outside of the Yocto Project
  533. development environment.
  534. Tools exist to help the application developer during any phase
  535. of development.
  536. For information on how to install and use an SDK, see the
  537. <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
  538. </para>
  539. </section>
  540. <section id="dev-modifying-source-code">
  541. <title>Modifying Source Code</title>
  542. <para>
  543. A common development workflow consists of modifying project source
  544. files that are external to the Yocto Project and then integrating
  545. that project's build output into an image built using the
  546. OpenEmbedded build system.
  547. Given this scenario, development engineers typically want to stick
  548. to their familiar project development tools and methods, which allows
  549. them to just focus on the project.
  550. </para>
  551. <para>
  552. Several workflows exist that allow you to develop, build, and test
  553. code that is going to be integrated into an image built using the
  554. OpenEmbedded build system.
  555. This section describes two:
  556. <itemizedlist>
  557. <listitem><para><emphasis><filename>devtool</filename>:</emphasis>
  558. A set of tools to aid in working on the source code built by
  559. the OpenEmbedded build system.
  560. Section
  561. "<link linkend='using-devtool-in-your-workflow'>Using <filename>devtool</filename> in Your Workflow</link>"
  562. describes this workflow.
  563. If you want more information that showcases the workflow, click
  564. <ulink url='https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view'>here</ulink>
  565. for a presentation by Trevor Woerner that, while somewhat dated,
  566. provides detailed background information and a complete
  567. working tutorial.
  568. </para></listitem>
  569. <listitem><para><emphasis><ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink>:</emphasis>
  570. A powerful tool that allows you to capture source
  571. code changes without having a clean source tree.
  572. While Quilt is not the preferred workflow of the two, this
  573. section includes it for users that are committed to using
  574. the tool.
  575. See the
  576. "<link linkend='using-a-quilt-workflow'>Using Quilt in Your Workflow</link>"
  577. section for more information.
  578. </para></listitem>
  579. </itemizedlist>
  580. </para>
  581. <section id='using-devtool-in-your-workflow'>
  582. <title>Using <filename>devtool</filename> in Your Workflow</title>
  583. <para>
  584. As mentioned earlier, <filename>devtool</filename> helps
  585. you easily develop projects whose build output must be part of
  586. an image built using the OpenEmbedded build system.
  587. </para>
  588. <para>
  589. Three entry points exist that allow you to develop using
  590. <filename>devtool</filename>:
  591. <itemizedlist>
  592. <listitem><para><emphasis><filename>devtool add</filename></emphasis>
  593. </para></listitem>
  594. <listitem><para><emphasis><filename>devtool modify</filename></emphasis>
  595. </para></listitem>
  596. <listitem><para><emphasis><filename>devtool upgrade</filename></emphasis>
  597. </para></listitem>
  598. </itemizedlist>
  599. </para>
  600. <para>
  601. The remainder of this section presents these workflows.
  602. </para>
  603. <section id='use-devtool-to-integrate-new-code'>
  604. <title>Use <filename>devtool add</filename> to Integrate New Code</title>
  605. <para>
  606. The <filename>devtool add</filename> command generates
  607. a new recipe based on existing source code.
  608. This command takes advantage of the
  609. <link linkend='devtool-the-workspace-layer-structure'>workspace</link>
  610. layer that many <filename>devtool</filename> commands
  611. use.
  612. The command is flexible enough to allow you to extract source
  613. code into both the workspace or a separate local Git repository
  614. and to use existing code that does not need to be extracted.
  615. </para>
  616. <para>
  617. Depending on your particular scenario, the arguments and options
  618. you use with <filename>devtool add</filename> form different
  619. combinations.
  620. The following diagram shows common development flows
  621. you would use with the <filename>devtool add</filename>
  622. command:
  623. </para>
  624. <para>
  625. <imagedata fileref="figures/devtool-add-flow.png" align="center" />
  626. </para>
  627. <para>
  628. <orderedlist>
  629. <listitem><para><emphasis>Generating the New Recipe</emphasis>:
  630. The top part of the flow shows three scenarios by which
  631. you could use <filename>devtool add</filename> to
  632. generate a recipe based on existing source code.</para>
  633. <para>In a shared development environment, it is
  634. typical where other developers are responsible for
  635. various areas of source code.
  636. As a developer, you are probably interested in using
  637. that source code as part of your development using
  638. the Yocto Project.
  639. All you need is access to the code, a recipe, and a
  640. controlled area in which to do your work.</para>
  641. <para>Within the diagram, three possible scenarios
  642. feed into the <filename>devtool add</filename> workflow:
  643. <itemizedlist>
  644. <listitem><para><emphasis>Left</emphasis>:
  645. The left scenario represents a common situation
  646. where the source code does not exist locally
  647. and needs to be extracted.
  648. In this situation, you just let it get
  649. extracted to the default workspace - you do not
  650. want it in some specific location outside of the
  651. workspace.
  652. Thus, everything you need will be located in the
  653. workspace:
  654. <literallayout class='monospaced'>
  655. $ devtool add <replaceable>recipe fetchuri</replaceable>
  656. </literallayout>
  657. With this command, <filename>devtool</filename>
  658. creates a recipe and an append file in the
  659. workspace as well as extracts the upstream
  660. source files into a local Git repository also
  661. within the <filename>sources</filename> folder.
  662. </para></listitem>
  663. <listitem><para><emphasis>Middle</emphasis>:
  664. The middle scenario also represents a situation where
  665. the source code does not exist locally.
  666. In this case, the code is again upstream
  667. and needs to be extracted to some
  668. local area - this time outside of the default
  669. workspace.
  670. As always, if required <filename>devtool</filename> creates
  671. a Git repository locally during the extraction.
  672. Furthermore, the first positional argument
  673. <replaceable>srctree</replaceable> in this case
  674. identifies where the
  675. <filename>devtool add</filename> command
  676. will locate the extracted code outside of the
  677. workspace:
  678. <literallayout class='monospaced'>
  679. $ devtool add <replaceable>recipe srctree fetchuri</replaceable>
  680. </literallayout>
  681. In summary, the source code is pulled from
  682. <replaceable>fetchuri</replaceable> and extracted
  683. into the location defined by
  684. <replaceable>srctree</replaceable> as a local
  685. Git repository.</para>
  686. <para>Within workspace, <filename>devtool</filename>
  687. creates both the recipe and an append file
  688. for the recipe.
  689. </para></listitem>
  690. <listitem><para><emphasis>Right</emphasis>:
  691. The right scenario represents a situation
  692. where the source tree (srctree) has been
  693. previously prepared outside of the
  694. <filename>devtool</filename> workspace.
  695. </para>
  696. <para>The following command names the recipe
  697. and identifies where the existing source tree
  698. is located:
  699. <literallayout class='monospaced'>
  700. $ devtool add <replaceable>recipe srctree</replaceable>
  701. </literallayout>
  702. The command examines the source code and creates
  703. a recipe for it placing the recipe into the
  704. workspace.</para>
  705. <para>Because the extracted source code already exists,
  706. <filename>devtool</filename> does not try to
  707. relocate it into the workspace - just the new
  708. the recipe is placed in the workspace.</para>
  709. <para>Aside from a recipe folder, the command
  710. also creates an append folder and places an initial
  711. <filename>*.bbappend</filename> within.
  712. </para></listitem>
  713. </itemizedlist>
  714. </para></listitem>
  715. <listitem><para><emphasis>Edit the Recipe</emphasis>:
  716. At this point, you can use <filename>devtool edit-recipe</filename>
  717. to open up the editor as defined by the
  718. <filename>$EDITOR</filename> environment variable
  719. and modify the file:
  720. <literallayout class='monospaced'>
  721. $ devtool edit-recipe <replaceable>recipe</replaceable>
  722. </literallayout>
  723. From within the editor, you can make modifications to the
  724. recipe that take affect when you build it later.
  725. </para></listitem>
  726. <listitem><para><emphasis>Build the Recipe or Rebuild the Image</emphasis>:
  727. At this point in the flow, the next step you
  728. take depends on what you are going to do with
  729. the new code.</para>
  730. <para>If you need to take the build output and eventually
  731. move it to the target hardware, you would use
  732. <filename>devtool build</filename>:
  733. <note>
  734. You could use <filename>bitbake</filename> to build
  735. the recipe as well.
  736. </note>
  737. <literallayout class='monospaced'>
  738. $ devtool build <replaceable>recipe</replaceable>
  739. </literallayout></para>
  740. <para>On the other hand, if you want an image to
  741. contain the recipe's packages for immediate deployment
  742. onto a device (e.g. for testing purposes), you can use
  743. the <filename>devtool build-image</filename> command:
  744. <literallayout class='monospaced'>
  745. $ devtool build-image <replaceable>image</replaceable>
  746. </literallayout>
  747. </para></listitem>
  748. <listitem><para><emphasis>Deploy the Build Output</emphasis>:
  749. When you use the <filename>devtool build</filename>
  750. command to build out your recipe, you probably want to
  751. see if the resulting build output works as expected on target
  752. hardware.
  753. <note>
  754. This step assumes you have a previously built
  755. image that is already either running in QEMU or
  756. running on actual hardware.
  757. Also, it is assumed that for deployment of the image
  758. to the target, SSH is installed in the image and if
  759. the image is running on real hardware that you have
  760. network access to and from your development machine.
  761. </note>
  762. You can deploy your build output to that target hardware by
  763. using the <filename>devtool deploy-target</filename> command:
  764. <literallayout class='monospaced'>
  765. $ devtool deploy-target <replaceable>recipe target</replaceable>
  766. </literallayout>
  767. The <replaceable>target</replaceable> is a live target machine
  768. running as an SSH server.</para>
  769. <para>You can, of course, also deploy the image you build
  770. using the <filename>devtool build-image</filename> command
  771. to actual hardware.
  772. However, <filename>devtool</filename> does not provide a
  773. specific command that allows you to do this.
  774. </para></listitem>
  775. <listitem><para><emphasis>Optionally Update the Recipe With Patch Files</emphasis>:
  776. Once you are satisfied with the recipe, if you have made
  777. any changes to the source tree that you want to have
  778. applied by the recipe, you need to generate patches
  779. from those changes.
  780. You do this before moving the recipe
  781. to its final layer and cleaning up the workspace area
  782. <filename>devtool</filename> uses.
  783. This optional step is especially relevant if you are
  784. using or adding third-party software.</para>
  785. <para>To convert commits created using Git to patch files,
  786. use the <filename>devtool update-recipe</filename> command.
  787. <note>
  788. Any changes you want to turn into patches must be
  789. committed to the Git repository in the source tree.
  790. </note>
  791. <literallayout class='monospaced'>
  792. $ devtool update-recipe <replaceable>recipe</replaceable>
  793. </literallayout>
  794. </para></listitem>
  795. <listitem><para><emphasis>Move the Recipe to its Permanent Layer</emphasis>:
  796. Before cleaning up the workspace, you need to move the
  797. final recipe to its permanent layer.
  798. You must do this before using the
  799. <filename>devtool reset</filename> command if you want to
  800. retain the recipe.
  801. </para></listitem>
  802. <listitem><para><emphasis>Reset the Recipe</emphasis>:
  803. As a final step, you can restore the state such that
  804. standard layers and the upstream source is used to build
  805. the recipe rather than data in the workspace.
  806. To reset the recipe, use the <filename>devtool reset</filename>
  807. command:
  808. <literallayout class='monospaced'>
  809. $ devtool reset <replaceable>recipe</replaceable>
  810. </literallayout>
  811. </para></listitem>
  812. </orderedlist>
  813. </para>
  814. </section>
  815. <section id='devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe'>
  816. <title>Use <filename>devtool modify</filename> to Enable Work on Code Associated with an Existing Recipe</title>
  817. <para>
  818. The <filename>devtool modify</filename> command prepares the
  819. way to work on existing code that already has a recipe in
  820. place.
  821. The command is flexible enough to allow you to extract code,
  822. specify the existing recipe, and keep track of and gather any
  823. patch files from other developers that are
  824. associated with the code.
  825. </para>
  826. <para>
  827. Depending on your particular scenario, the arguments and options
  828. you use with <filename>devtool modify</filename> form different
  829. combinations.
  830. The following diagram shows common development flows
  831. you would use with the <filename>devtool modify</filename>
  832. command:
  833. </para>
  834. <para>
  835. <imagedata fileref="figures/devtool-modify-flow.png" align="center" />
  836. </para>
  837. <para>
  838. <orderedlist>
  839. <listitem><para><emphasis>Preparing to Modify the Code</emphasis>:
  840. The top part of the flow shows three scenarios by which
  841. you could use <filename>devtool modify</filename> to
  842. prepare to work on source files.
  843. Each scenario assumes the following:
  844. <itemizedlist>
  845. <listitem><para>The recipe exists in some layer external
  846. to the <filename>devtool</filename> workspace.
  847. </para></listitem>
  848. <listitem><para>The source files exist upstream in an
  849. un-extracted state or locally in a previously
  850. extracted state.
  851. </para></listitem>
  852. </itemizedlist>
  853. The typical situation is where another developer has
  854. created some layer for use with the Yocto Project and
  855. their recipe already resides in that layer.
  856. Furthermore, their source code is readily available
  857. either upstream or locally.
  858. <itemizedlist>
  859. <listitem><para><emphasis>Left</emphasis>:
  860. The left scenario represents a common situation
  861. where the source code does not exist locally
  862. and needs to be extracted.
  863. In this situation, the source is extracted
  864. into the default workspace location.
  865. The recipe, in this scenario, is in its own
  866. layer outside the workspace
  867. (i.e.
  868. <filename>meta-</filename><replaceable>layername</replaceable>).
  869. </para>
  870. <para>The following command identifies the recipe
  871. and by default extracts the source files:
  872. <literallayout class='monospaced'>
  873. $ devtool modify <replaceable>recipe</replaceable>
  874. </literallayout>
  875. Once <filename>devtool</filename>locates the recipe,
  876. it uses the
  877. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
  878. variable to locate the source code and
  879. any local patch files from other developers are
  880. located.
  881. <note>
  882. You cannot provide an URL for
  883. <replaceable>srctree</replaceable> when using the
  884. <filename>devtool modify</filename> command.
  885. </note>
  886. With this scenario, however, since no
  887. <replaceable>srctree</replaceable> argument exists, the
  888. <filename>devtool modify</filename> command by default
  889. extracts the source files to a Git structure.
  890. Furthermore, the location for the extracted source is the
  891. default area within the workspace.
  892. The result is that the command sets up both the source
  893. code and an append file within the workspace with the
  894. recipe remaining in its original location.
  895. </para></listitem>
  896. <listitem><para><emphasis>Middle</emphasis>:
  897. The middle scenario represents a situation where
  898. the source code also does not exist locally.
  899. In this case, the code is again upstream
  900. and needs to be extracted to some
  901. local area as a Git repository.
  902. The recipe, in this scenario, is again in its own
  903. layer outside the workspace.</para>
  904. <para>The following command tells
  905. <filename>devtool</filename> what recipe with
  906. which to work and, in this case, identifies a local
  907. area for the extracted source files that is outside
  908. of the default workspace:
  909. <literallayout class='monospaced'>
  910. $ devtool modify <replaceable>recipe srctree</replaceable>
  911. </literallayout>
  912. As with all extractions, the command uses
  913. the recipe's <filename>SRC_URI</filename> to locate the
  914. source files.
  915. Once the files are located, the command by default
  916. extracts them.
  917. Providing the <replaceable>srctree</replaceable>
  918. argument instructs <filename>devtool</filename> where
  919. place the extracted source.</para>
  920. <para>Within workspace, <filename>devtool</filename>
  921. creates an append file for the recipe.
  922. The recipe remains in its original location but
  923. the source files are extracted to the location you
  924. provided with <replaceable>srctree</replaceable>.
  925. </para></listitem>
  926. <listitem><para><emphasis>Right</emphasis>:
  927. The right scenario represents a situation
  928. where the source tree
  929. (<replaceable>srctree</replaceable>) exists as a
  930. previously extracted Git structure outside of
  931. the <filename>devtool</filename> workspace.
  932. In this example, the recipe also exists
  933. elsewhere in its own layer.
  934. </para>
  935. <para>The following command tells
  936. <filename>devtool</filename> the recipe
  937. with which to work, uses the "-n" option to indicate
  938. source does not need to be extracted, and uses
  939. <replaceable>srctree</replaceable> to point to the
  940. previously extracted source files:
  941. <literallayout class='monospaced'>
  942. $ devtool modify -n <replaceable>recipe srctree</replaceable>
  943. </literallayout>
  944. </para>
  945. <para>Once the command finishes, it creates only
  946. an append file for the recipe in the workspace.
  947. The recipe and the source code remain in their
  948. original locations.
  949. </para></listitem>
  950. </itemizedlist>
  951. </para></listitem>
  952. <listitem><para><emphasis>Edit the Source</emphasis>:
  953. Once you have used the <filename>devtool modify</filename>
  954. command, you are free to make changes to the source
  955. files.
  956. You can use any editor you like to make and save
  957. your source code modifications.
  958. </para></listitem>
  959. <listitem><para><emphasis>Build the Recipe</emphasis>:
  960. Once you have updated the source files, you can build
  961. the recipe.
  962. You can either use <filename>devtool build</filename> or
  963. <filename>bitbake</filename>.
  964. Either method produces build output that is stored
  965. in
  966. <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>.
  967. </para></listitem>
  968. <listitem><para><emphasis>Deploy the Build Output</emphasis>:
  969. When you use the <filename>devtool build</filename>
  970. command or <filename>bitbake</filename> to build out your
  971. recipe, you probably want to see if the resulting build
  972. output works as expected on target hardware.
  973. <note>
  974. This step assumes you have a previously built
  975. image that is already either running in QEMU or
  976. running on actual hardware.
  977. Also, it is assumed that for deployment of the image
  978. to the target, SSH is installed in the image and if
  979. the image is running on real hardware that you have
  980. network access to and from your development machine.
  981. </note>
  982. You can deploy your build output to that target hardware by
  983. using the <filename>devtool deploy-target</filename> command:
  984. <literallayout class='monospaced'>
  985. $ devtool deploy-target <replaceable>recipe target</replaceable>
  986. </literallayout>
  987. The <replaceable>target</replaceable> is a live target machine
  988. running as an SSH server.</para>
  989. <para>You can, of course, also deploy the image you build
  990. using the <filename>devtool build-image</filename> command
  991. to actual hardware.
  992. However, <filename>devtool</filename> does not provide a
  993. specific command that allows you to do this.
  994. </para></listitem>
  995. <listitem><para><emphasis>Optionally Create Patch Files for Your Changes</emphasis>:
  996. After you have debugged your changes, you can
  997. use <filename>devtool update-recipe</filename> to
  998. generate patch files for all the commits you have
  999. made.
  1000. <note>
  1001. Patch files are generated only for changes
  1002. you have committed.
  1003. </note>
  1004. <literallayout class='monospaced'>
  1005. $ devtool update-recipe <replaceable>recipe</replaceable>
  1006. </literallayout>
  1007. By default, the
  1008. <filename>devtool update-recipe</filename> command
  1009. creates the patch files in a folder named the same
  1010. as the recipe beneath the folder in which the recipe
  1011. resides, and updates the recipe's
  1012. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
  1013. statement to point to the generated patch files.
  1014. <note>
  1015. You can use the
  1016. "--append <replaceable>LAYERDIR</replaceable>"
  1017. option to cause the command to create append files
  1018. in a specific layer rather than the default
  1019. recipe layer.
  1020. </note>
  1021. </para></listitem>
  1022. <listitem><para><emphasis>Restore the Workspace</emphasis>:
  1023. The <filename>devtool reset</filename> restores the
  1024. state so that standard layers and upstream sources are
  1025. used to build the recipe rather than what is in the
  1026. workspace.
  1027. <literallayout class='monospaced'>
  1028. $ devtool reset <replaceable>recipe</replaceable>
  1029. </literallayout>
  1030. </para></listitem>
  1031. </orderedlist>
  1032. </para>
  1033. </section>
  1034. <section id='devtool-use-devtool-upgrade-to-create-a-version-of-the-recipe-that-supports-a-newer-version-of-the-software'>
  1035. <title>Use <filename>devtool upgrade</filename> to Create a Version of the Recipe that Supports a Newer Version of the Software</title>
  1036. <para>
  1037. The <filename>devtool upgrade</filename> command updates
  1038. an existing recipe so that you can build it for an updated
  1039. set of source files.
  1040. The command is flexible enough to allow you to specify
  1041. source code revision and versioning schemes, extract code into
  1042. or out of the <filename>devtool</filename> workspace, and
  1043. work with any source file forms that the fetchers support.
  1044. </para>
  1045. <para>
  1046. Depending on your particular scenario, the arguments and options
  1047. you use with <filename>devtool upgrade</filename> form different
  1048. combinations.
  1049. The following diagram shows a common development flow
  1050. you would use with the <filename>devtool modify</filename>
  1051. command:
  1052. </para>
  1053. <para>
  1054. <imagedata fileref="figures/devtool-upgrade-flow.png" align="center" />
  1055. </para>
  1056. <para>
  1057. <orderedlist>
  1058. <listitem><para><emphasis>Initiate the Upgrade</emphasis>:
  1059. The top part of the flow shows a typical scenario by which
  1060. you could use <filename>devtool upgrade</filename>.
  1061. The following conditions exist:
  1062. <itemizedlist>
  1063. <listitem><para>The recipe exists in some layer external
  1064. to the <filename>devtool</filename> workspace.
  1065. </para></listitem>
  1066. <listitem><para>The source files for the new release
  1067. exist adjacent to the same location pointed to by
  1068. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
  1069. in the recipe (e.g. a tarball with the new version
  1070. number in the name, or as a different revision in
  1071. the upstream Git repository).
  1072. </para></listitem>
  1073. </itemizedlist>
  1074. A common situation is where third-party software has
  1075. undergone a revision so that it has been upgraded.
  1076. The recipe you have access to is likely in your own layer.
  1077. Thus, you need to upgrade the recipe to use the
  1078. newer version of the software:
  1079. <literallayout class='monospaced'>
  1080. $ devtool upgrade -V <replaceable>version recipe</replaceable>
  1081. </literallayout>
  1082. By default, the <filename>devtool upgrade</filename> command
  1083. extracts source code into the <filename>sources</filename>
  1084. directory in the workspace.
  1085. If you want the code extracted to any other location, you
  1086. need to provide the <replaceable>srctree</replaceable>
  1087. positional argument with the command as follows:
  1088. <literallayout class='monospaced'>
  1089. $ devtool upgrade -V <replaceable>version recipe srctree</replaceable>
  1090. </literallayout>
  1091. Also, in this example, the "-V" option is used to specify
  1092. the new version.
  1093. If the source files pointed to by the
  1094. <filename>SRC_URI</filename> statement in the recipe are
  1095. in a Git repository, you must provide the "-S" option and
  1096. specify a revision for the software.</para>
  1097. <para>Once <filename>devtool</filename> locates the recipe,
  1098. it uses the <filename>SRC_URI</filename> variable to locate
  1099. the source code and any local patch files from other
  1100. developers are located.
  1101. The result is that the command sets up the source
  1102. code, the new version of the recipe, and an append file
  1103. all within the workspace.
  1104. </para></listitem>
  1105. <listitem><para><emphasis>Resolve any Conflicts created by the Upgrade</emphasis>:
  1106. At this point, there could be some conflicts due to the
  1107. software being upgraded to a new version.
  1108. This would occur if your recipe specifies some patch files in
  1109. <filename>SRC_URI</filename> that conflict with changes
  1110. made in the new version of the software.
  1111. If this is the case, you need to resolve the conflicts
  1112. by editing the source and following the normal
  1113. <filename>git rebase</filename> conflict resolution
  1114. process.</para>
  1115. <para>Before moving onto the next step, be sure to resolve any
  1116. such conflicts created through use of a newer or different
  1117. version of the software.
  1118. </para></listitem>
  1119. <listitem><para><emphasis>Build the Recipe</emphasis>:
  1120. Once you have your recipe in order, you can build it.
  1121. You can either use <filename>devtool build</filename> or
  1122. <filename>bitbake</filename>.
  1123. Either method produces build output that is stored
  1124. in
  1125. <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>.
  1126. </para></listitem>
  1127. <listitem><para><emphasis>Deploy the Build Output</emphasis>:
  1128. When you use the <filename>devtool build</filename>
  1129. command or <filename>bitbake</filename> to build out your
  1130. recipe, you probably want to see if the resulting build
  1131. output works as expected on target hardware.
  1132. <note>
  1133. This step assumes you have a previously built
  1134. image that is already either running in QEMU or
  1135. running on actual hardware.
  1136. Also, it is assumed that for deployment of the image
  1137. to the target, SSH is installed in the image and if
  1138. the image is running on real hardware that you have
  1139. network access to and from your development machine.
  1140. </note>
  1141. You can deploy your build output to that target hardware by
  1142. using the <filename>devtool deploy-target</filename> command:
  1143. <literallayout class='monospaced'>
  1144. $ devtool deploy-target <replaceable>recipe target</replaceable>
  1145. </literallayout>
  1146. The <replaceable>target</replaceable> is a live target machine
  1147. running as an SSH server.</para>
  1148. <para>You can, of course, also deploy the image you build
  1149. using the <filename>devtool build-image</filename> command
  1150. to actual hardware.
  1151. However, <filename>devtool</filename> does not provide a
  1152. specific command that allows you to do this.
  1153. </para></listitem>
  1154. <listitem><para><emphasis>Optionally Create Patch Files for Your Changes</emphasis>:
  1155. After you have debugged your changes, you can
  1156. use <filename>devtool update-recipe</filename> to
  1157. generate patch files for all the commits you have
  1158. made.
  1159. <note>
  1160. Patch files are generated only for changes
  1161. you have committed.
  1162. </note>
  1163. <literallayout class='monospaced'>
  1164. $ devtool update-recipe <replaceable>recipe</replaceable>
  1165. </literallayout>
  1166. By default, the
  1167. <filename>devtool update-recipe</filename> command
  1168. creates the patch files in a folder named the same
  1169. as the recipe beneath the folder in which the recipe
  1170. resides, and updates the recipe's
  1171. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
  1172. statement to point to the generated patch files.
  1173. </para></listitem>
  1174. <listitem><para><emphasis>Move the Recipe to its Permanent Layer</emphasis>:
  1175. Before cleaning up the workspace, you need to move the
  1176. final recipe to its permanent layer.
  1177. You can either overwrite the original recipe or you can
  1178. overlay the upgraded recipe into a separate layer.
  1179. You must do this before using the
  1180. <filename>devtool reset</filename> command if you want to
  1181. retain the upgraded recipe.
  1182. </para></listitem>
  1183. <listitem><para><emphasis>Restore the Workspace</emphasis>:
  1184. The <filename>devtool reset</filename> restores the
  1185. state so that standard layers and upstream sources are
  1186. used to build the recipe rather than what is in the
  1187. workspace.
  1188. <literallayout class='monospaced'>
  1189. $ devtool reset <replaceable>recipe</replaceable>
  1190. </literallayout>
  1191. </para></listitem>
  1192. </orderedlist>
  1193. </para>
  1194. </section>
  1195. </section>
  1196. <section id='devtool-quick-reference'>
  1197. <title><filename>devtool</filename> Quick Reference</title>
  1198. <para>
  1199. <filename>devtool</filename> has more functionality than simply
  1200. adding a new recipe and the supporting Metadata to a temporary
  1201. workspace layer.
  1202. This section provides a short reference on
  1203. <filename>devtool</filename> and its commands.
  1204. </para>
  1205. <section id='devtool-getting-help'>
  1206. <title>Getting Help</title>
  1207. <para>
  1208. The easiest way to get help with the
  1209. <filename>devtool</filename> command is using the
  1210. <filename>--help</filename> option:
  1211. <literallayout class='monospaced'>
  1212. usage: devtool [--basepath BASEPATH] [--bbpath BBPATH] [-d] [-q]
  1213. [--color COLOR] [-h]
  1214. &lt;subcommand&gt; ...
  1215. OpenEmbedded development tool
  1216. optional arguments:
  1217. --basepath BASEPATH Base directory of SDK / build directory
  1218. --bbpath BBPATH Explicitly specify the BBPATH, rather than getting it
  1219. from the metadata
  1220. -d, --debug Enable debug output
  1221. -q, --quiet Print only errors
  1222. --color COLOR Colorize output (where COLOR is auto, always, never)
  1223. -h, --help show this help message and exit
  1224. subcommands:
  1225. Beginning work on a recipe:
  1226. add Add a new recipe
  1227. modify Modify the source for an existing recipe
  1228. upgrade Upgrade an existing recipe
  1229. Getting information:
  1230. status Show workspace status
  1231. search Search available recipes
  1232. Working on a recipe in the workspace:
  1233. build Build a recipe
  1234. edit-recipe Edit a recipe file in your workspace
  1235. configure-help Get help on configure script options
  1236. update-recipe Apply changes from external source tree to recipe
  1237. reset Remove a recipe from your workspace
  1238. Testing changes on target:
  1239. deploy-target Deploy recipe output files to live target machine
  1240. undeploy-target Undeploy recipe output files in live target machine
  1241. build-image Build image including workspace recipe packages
  1242. Advanced:
  1243. create-workspace Set up workspace in an alternative location
  1244. extract Extract the source for an existing recipe
  1245. sync Synchronize the source tree for an existing recipe
  1246. Use devtool &lt;subcommand&gt; --help to get help on a specific command
  1247. </literallayout>
  1248. </para>
  1249. <para>
  1250. As directed in the general help output, you can get more
  1251. syntax on a specific command by providing the command
  1252. name and using <filename>--help</filename>:
  1253. <literallayout class='monospaced'>
  1254. $ devtool add --help
  1255. usage: devtool add [-h] [--same-dir | --no-same-dir] [--fetch URI]
  1256. [--version VERSION] [--no-git] [--binary] [--also-native]
  1257. [--src-subdir SUBDIR]
  1258. [recipename] [srctree] [fetchuri]
  1259. Adds a new recipe to the workspace to build a specified source tree. Can
  1260. optionally fetch a remote URI and unpack it to create the source tree.
  1261. positional arguments:
  1262. recipename Name for new recipe to add (just name - no version,
  1263. path or extension). If not specified, will attempt to
  1264. auto-detect it.
  1265. srctree Path to external source tree. If not specified, a
  1266. subdirectory of
  1267. /home/scottrif/poky/build/workspace/sources will be
  1268. used.
  1269. fetchuri Fetch the specified URI and extract it to create the
  1270. source tree
  1271. optional arguments:
  1272. -h, --help show this help message and exit
  1273. --same-dir, -s Build in same directory as source
  1274. --no-same-dir Force build in a separate build directory
  1275. --fetch URI, -f URI Fetch the specified URI and extract it to create the
  1276. source tree (deprecated - pass as positional argument
  1277. instead)
  1278. --version VERSION, -V VERSION
  1279. Version to use within recipe (PV)
  1280. --no-git, -g If fetching source, do not set up source tree as a git
  1281. repository
  1282. --binary, -b Treat the source tree as something that should be
  1283. installed verbatim (no compilation, same directory
  1284. structure). Useful with binary packages e.g. RPMs.
  1285. --also-native Also add native variant (i.e. support building recipe
  1286. for the build host as well as the target machine)
  1287. --src-subdir SUBDIR Specify subdirectory within source tree to use
  1288. </literallayout>
  1289. </para>
  1290. </section>
  1291. <section id='devtool-the-workspace-layer-structure'>
  1292. <title>The Workspace Layer Structure</title>
  1293. <para>
  1294. <filename>devtool</filename> uses a "Workspace" layer
  1295. in which to accomplish builds.
  1296. This layer is not specific to any single
  1297. <filename>devtool</filename> command but is rather a common
  1298. working area used across the tool.
  1299. </para>
  1300. <para>
  1301. The following figure shows the workspace structure:
  1302. </para>
  1303. <para>
  1304. <imagedata fileref="figures/build-workspace-directory.png"
  1305. width="6in" depth="5in" align="left" scale="70" />
  1306. </para>
  1307. <para>
  1308. <literallayout class='monospaced'>
  1309. attic - A directory created if devtool believes it preserve
  1310. anything when you run "devtool reset". For example, if you
  1311. run "devtool add", make changes to the recipe, and then
  1312. run "devtool reset", devtool takes notice that the file has
  1313. been changed and moves it into the attic should you still
  1314. want the recipe.
  1315. README - Provides information on what is in workspace layer and how to
  1316. manage it.
  1317. .devtool_md5 - A checksum file used by devtool.
  1318. appends - A directory that contains *.bbappend files, which point to
  1319. external source.
  1320. conf - A configuration directory that contains the layer.conf file.
  1321. recipes - A directory containing recipes. This directory contains a
  1322. folder for each directory added whose name matches that of the
  1323. added recipe. devtool places the <replaceable>recipe</replaceable>.bb file
  1324. within that sub-directory.
  1325. sources - A directory containing a working copy of the source files used
  1326. when building the recipe. This is the default directory used
  1327. as the location of the source tree when you do not provide a
  1328. source tree path. This directory contains a folder for each
  1329. set of source files matched to a corresponding recipe.
  1330. </literallayout>
  1331. </para>
  1332. </section>
  1333. <section id='devtool-adding-a-new-recipe-to-the-workspace'>
  1334. <title>Adding a New Recipe to the Workspace Layer</title>
  1335. <para>
  1336. Use the <filename>devtool add</filename> command to add a new recipe
  1337. to the workspace layer.
  1338. The recipe you add should not exist -
  1339. <filename>devtool</filename> creates it for you.
  1340. The source files the recipe uses should exist in an external
  1341. area.
  1342. </para>
  1343. <para>
  1344. The following example creates and adds a new recipe named
  1345. <filename>jackson</filename> to a workspace layer the tool creates.
  1346. The source code built by the recipes resides in
  1347. <filename>/home/scottrif/sources/jackson</filename>:
  1348. <literallayout class='monospaced'>
  1349. $ devtool add jackson /home/scottrif/sources/jackson
  1350. </literallayout>
  1351. </para>
  1352. <para>
  1353. If you add a recipe and the workspace layer does not exist,
  1354. the command creates the layer and populates it as
  1355. described in
  1356. "<link linkend='devtool-the-workspace-layer-structure'>The Workspace Layer Structure</link>"
  1357. section.
  1358. </para>
  1359. <para>
  1360. Running <filename>devtool add</filename> when the
  1361. workspace layer exists causes the tool to add the recipe,
  1362. append files, and source files into the existing workspace layer.
  1363. The <filename>.bbappend</filename> file is created to point
  1364. to the external source tree.
  1365. </para>
  1366. </section>
  1367. <section id='devtool-extracting-the-source-for-an-existing-recipe'>
  1368. <title>Extracting the Source for an Existing Recipe</title>
  1369. <para>
  1370. Use the <filename>devtool extract</filename> command to
  1371. extract the source for an existing recipe.
  1372. When you use this command, you must supply the root name
  1373. of the recipe (i.e. no version, paths, or extensions), and
  1374. you must supply the directory to which you want the source
  1375. extracted.
  1376. </para>
  1377. <para>
  1378. Additional command options let you control the name of a
  1379. development branch into which you can checkout the source
  1380. and whether or not to keep a temporary directory, which is
  1381. useful for debugging.
  1382. </para>
  1383. </section>
  1384. <section id='devtool-synchronizing-a-recipes-extracted-source-tree'>
  1385. <title>Synchronizing a Recipe's Extracted Source Tree</title>
  1386. <para>
  1387. Use the <filename>devtool sync</filename> command to
  1388. synchronize a previously extracted source tree for an
  1389. existing recipe.
  1390. When you use this command, you must supply the root name
  1391. of the recipe (i.e. no version, paths, or extensions), and
  1392. you must supply the directory to which you want the source
  1393. extracted.
  1394. </para>
  1395. <para>
  1396. Additional command options let you control the name of a
  1397. development branch into which you can checkout the source
  1398. and whether or not to keep a temporary directory, which is
  1399. useful for debugging.
  1400. </para>
  1401. </section>
  1402. <section id='devtool-modifying-a-recipe'>
  1403. <title>Modifying an Existing Recipe</title>
  1404. <para>
  1405. Use the <filename>devtool modify</filename> command to begin
  1406. modifying the source of an existing recipe.
  1407. This command is very similar to the
  1408. <link linkend='devtool-adding-a-new-recipe-to-the-workspace'><filename>add</filename></link>
  1409. command except that it does not physically create the
  1410. recipe in the workspace layer because the recipe already
  1411. exists in an another layer.
  1412. </para>
  1413. <para>
  1414. The <filename>devtool modify</filename> command extracts the
  1415. source for a recipe, sets it up as a Git repository if the
  1416. source had not already been fetched from Git, checks out a
  1417. branch for development, and applies any patches from the recipe
  1418. as commits on top.
  1419. You can use the following command to checkout the source
  1420. files:
  1421. <literallayout class='monospaced'>
  1422. $ devtool modify <replaceable>recipe</replaceable>
  1423. </literallayout>
  1424. Using the above command form, <filename>devtool</filename> uses
  1425. the existing recipe's
  1426. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
  1427. statement to locate the upstream source, extracts the source
  1428. into the default sources location in the workspace.
  1429. The default development branch used is "devtool".
  1430. </para>
  1431. </section>
  1432. <section id='devtool-edit-an-existing-recipe'>
  1433. <title>Edit an Existing Recipe</title>
  1434. <para>
  1435. Use the <filename>devtool edit-recipe</filename> command
  1436. to run the default editor, which is identified using the
  1437. <filename>EDITOR</filename> variable, on the specified recipe.
  1438. </para>
  1439. <para>
  1440. When you use the <filename>devtool edit-recipe</filename>
  1441. command, you must supply the root name of the recipe
  1442. (i.e. no version, paths, or extensions).
  1443. Also, the recipe file itself must reside in the workspace
  1444. as a result of the <filename>devtool add</filename> or
  1445. <filename>devtool upgrade</filename> commands.
  1446. However, you can override that requirement by using the
  1447. "-a" or "--any-recipe" option.
  1448. Using either of these options allows you to edit any recipe
  1449. regardless of its location.
  1450. </para>
  1451. </section>
  1452. <section id='devtool-updating-a-recipe'>
  1453. <title>Updating a Recipe</title>
  1454. <para>
  1455. Use the <filename>devtool update-recipe</filename> command to
  1456. update your recipe with patches that reflect changes you make
  1457. to the source files.
  1458. For example, if you know you are going to work on some
  1459. code, you could first use the
  1460. <link linkend='devtool-modifying-a-recipe'><filename>devtool modify</filename></link>
  1461. command to extract the code and set up the workspace.
  1462. After which, you could modify, compile, and test the code.
  1463. </para>
  1464. <para>
  1465. When you are satisfied with the results and you have committed
  1466. your changes to the Git repository, you can then
  1467. run the <filename>devtool update-recipe</filename> to create the
  1468. patches and update the recipe:
  1469. <literallayout class='monospaced'>
  1470. $ devtool update-recipe <replaceable>recipe</replaceable>
  1471. </literallayout>
  1472. If you run the <filename>devtool update-recipe</filename>
  1473. without committing your changes, the command ignores the
  1474. changes.
  1475. </para>
  1476. <para>
  1477. Often, you might want to apply customizations made to your
  1478. software in your own layer rather than apply them to the
  1479. original recipe.
  1480. If so, you can use the
  1481. <filename>-a</filename> or <filename>--append</filename>
  1482. option with the <filename>devtool update-recipe</filename>
  1483. command.
  1484. These options allow you to specify the layer into which to
  1485. write an append file:
  1486. <literallayout class='monospaced'>
  1487. $ devtool update-recipe <replaceable>recipe</replaceable> -a <replaceable>base-layer-directory</replaceable>
  1488. </literallayout>
  1489. The <filename>*.bbappend</filename> file is created at the
  1490. appropriate path within the specified layer directory, which
  1491. may or may not be in your <filename>bblayers.conf</filename>
  1492. file.
  1493. If an append file already exists, the command updates it
  1494. appropriately.
  1495. </para>
  1496. </section>
  1497. <section id='devtool-upgrading-a-recipe'>
  1498. <title>Upgrading a Recipe</title>
  1499. <para>
  1500. Use the <filename>devtool upgrade</filename> command
  1501. to upgrade an existing recipe to a new upstream version.
  1502. The command puts the upgraded recipe file into the
  1503. workspace along with any associated files, and extracts
  1504. the source tree to a specified location should patches
  1505. need rebased or added to as a result of the upgrade.
  1506. </para>
  1507. <para>
  1508. When you use the <filename>devtool upgrade</filename> command,
  1509. you must supply the root name of the recipe (i.e. no version,
  1510. paths, or extensions), and you must supply the directory
  1511. to which you want the source extracted.
  1512. Additional command options let you control things such as
  1513. the version number to which you want to upgrade (i.e. the
  1514. <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>),
  1515. the source revision to which you want to upgrade (i.e. the
  1516. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>,
  1517. whether or not to apply patches, and so forth.
  1518. </para>
  1519. </section>
  1520. <section id='devtool-resetting-a-recipe'>
  1521. <title>Resetting a Recipe</title>
  1522. <para>
  1523. Use the <filename>devtool reset</filename> command to remove a
  1524. recipe and its configuration (e.g. the corresponding
  1525. <filename>.bbappend</filename> file) from the workspace layer.
  1526. Realize that this command deletes the recipe and the
  1527. append file.
  1528. The command does not physically move them for you.
  1529. Consequently, you must be sure to physically relocate your
  1530. updated recipe and the append file outside of the workspace
  1531. layer before running the <filename>devtool reset</filename>
  1532. command.
  1533. </para>
  1534. <para>
  1535. If the <filename>devtool reset</filename> command detects that
  1536. the recipe or the append files have been modified, the
  1537. command preserves the modified files in a separate "attic"
  1538. subdirectory under the workspace layer.
  1539. </para>
  1540. <para>
  1541. Here is an example that resets the workspace directory that
  1542. contains the <filename>mtr</filename> recipe:
  1543. <literallayout class='monospaced'>
  1544. $ devtool reset mtr
  1545. NOTE: Cleaning sysroot for recipe mtr...
  1546. NOTE: Leaving source tree /home/scottrif/poky/build/workspace/sources/mtr as-is; if you no
  1547. longer need it then please delete it manually
  1548. $
  1549. </literallayout>
  1550. </para>
  1551. </section>
  1552. <section id='devtool-building-your-recipe'>
  1553. <title>Building Your Recipe</title>
  1554. <para>
  1555. Use the <filename>devtool build</filename> command to cause the
  1556. OpenEmbedded build system to build your recipe.
  1557. The <filename>devtool build</filename> command is equivalent to
  1558. <filename>bitbake -c populate_sysroot</filename>.
  1559. </para>
  1560. <para>
  1561. When you use the <filename>devtool build</filename> command,
  1562. you must supply the root name of the recipe (i.e. no version,
  1563. paths, or extensions).
  1564. You can use either the "-s" or the "--disable-parallel-make"
  1565. option to disable parallel makes during the build.
  1566. Here is an example:
  1567. <literallayout class='monospaced'>
  1568. $ devtool build <replaceable>recipe</replaceable>
  1569. </literallayout>
  1570. </para>
  1571. </section>
  1572. <section id='devtool-building-your-image'>
  1573. <title>Building Your Image</title>
  1574. <para>
  1575. Use the <filename>devtool build-image</filename> command
  1576. to build an image, extending it to include packages from
  1577. recipes in the workspace.
  1578. Using this command is useful when you want an image that
  1579. ready for immediate deployment onto a device for testing.
  1580. For proper integration into a final image, you need to
  1581. edit your custom image recipe appropriately.
  1582. </para>
  1583. <para>
  1584. When you use the <filename>devtool build-image</filename>
  1585. command, you must supply the name of the image.
  1586. This command has no command line options:
  1587. <literallayout class='monospaced'>
  1588. $ devtool build-image <replaceable>image</replaceable>
  1589. </literallayout>
  1590. </para>
  1591. </section>
  1592. <section id='devtool-deploying-your-software-on-the-target-machine'>
  1593. <title>Deploying Your Software on the Target Machine</title>
  1594. <para>
  1595. Use the <filename>devtool deploy-target</filename> command to
  1596. deploy the recipe's build output to the live target machine:
  1597. <literallayout class='monospaced'>
  1598. $ devtool deploy-target <replaceable>recipe</replaceable>&nbsp;<replaceable>target</replaceable>
  1599. </literallayout>
  1600. The <replaceable>target</replaceable> is the address of the
  1601. target machine, which must be running an SSH server (i.e.
  1602. <filename>user@hostname[:destdir]</filename>).
  1603. </para>
  1604. <para>
  1605. This command deploys all files installed during the
  1606. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
  1607. task.
  1608. Furthermore, you do not need to have package management enabled
  1609. within the target machine.
  1610. If you do, the package manager is bypassed.
  1611. <note><title>Notes</title>
  1612. <para>
  1613. The <filename>deploy-target</filename>
  1614. functionality is for development only.
  1615. You should never use it to update an image that will be
  1616. used in production.
  1617. </para>
  1618. </note>
  1619. </para>
  1620. </section>
  1621. <section id='devtool-removing-your-software-from-the-target-machine'>
  1622. <title>Removing Your Software from the Target Machine</title>
  1623. <para>
  1624. Use the <filename>devtool undeploy-target</filename> command to
  1625. remove deployed build output from the target machine.
  1626. For the <filename>devtool undeploy-target</filename> command to
  1627. work, you must have previously used the
  1628. <link linkend='devtool-deploying-your-software-on-the-target-machine'><filename>devtool deploy-target</filename></link>
  1629. command.
  1630. <literallayout class='monospaced'>
  1631. $ devtool undeploy-target <replaceable>recipe</replaceable>&nbsp;<replaceable>target</replaceable>
  1632. </literallayout>
  1633. The <replaceable>target</replaceable> is the address of the
  1634. target machine, which must be running an SSH server (i.e.
  1635. <filename>user@hostname</filename>).
  1636. </para>
  1637. </section>
  1638. <section id='devtool-creating-the-workspace'>
  1639. <title>Creating the Workspace Layer in an Alternative Location</title>
  1640. <para>
  1641. Use the <filename>devtool create-workspace</filename> command to
  1642. create a new workspace layer in your
  1643. <link linkend='build-directory'>Build Directory</link>.
  1644. When you create a new workspace layer, it is populated with the
  1645. <filename>README</filename> file and the
  1646. <filename>conf</filename> directory only.
  1647. </para>
  1648. <para>
  1649. The following example creates a new workspace layer in your
  1650. current working and by default names the workspace layer
  1651. "workspace":
  1652. <literallayout class='monospaced'>
  1653. $ devtool create-workspace
  1654. </literallayout>
  1655. </para>
  1656. <para>
  1657. You can create a workspace layer anywhere by supplying
  1658. a pathname with the command.
  1659. The following command creates a new workspace layer named
  1660. "new-workspace":
  1661. <literallayout class='monospaced'>
  1662. $ devtool create-workspace /home/scottrif/new-workspace
  1663. </literallayout>
  1664. </para>
  1665. </section>
  1666. <section id='devtool-get-the-status-of-the-recipes-in-your-workspace'>
  1667. <title>Get the Status of the Recipes in Your Workspace</title>
  1668. <para>
  1669. Use the <filename>devtool status</filename> command to
  1670. list the recipes currently in your workspace.
  1671. Information includes the paths to their respective
  1672. external source trees.
  1673. </para>
  1674. <para>
  1675. The <filename>devtool status</filename> command has no
  1676. command-line options:
  1677. <literallayout class='monospaced'>
  1678. devtool status
  1679. </literallayout>
  1680. Following is sample output after using
  1681. <link linkend='devtool-adding-a-new-recipe-to-the-workspace'><filename>devtool add</filename></link>
  1682. to create and add the <filename>mtr_0.86.bb</filename> recipe
  1683. to the <filename>workspace</filename> directory:
  1684. <literallayout class='monospaced'>
  1685. $ devtool status
  1686. mtr: /home/scottrif/poky/build/workspace/sources/mtr (/home/scottrif/poky/build/workspace/recipes/mtr/mtr_0.86.bb)
  1687. $
  1688. </literallayout>
  1689. </para>
  1690. </section>
  1691. <section id='devtool-search-for-available-target-recipes'>
  1692. <title>Search for Available Target Recipes</title>
  1693. <para>
  1694. Use the <filename>devtool search</filename> command to
  1695. search for available target recipes.
  1696. The command matches the recipe name, package name,
  1697. description, and installed files.
  1698. The command displays the recipe name as a result of a
  1699. match.
  1700. </para>
  1701. <para>
  1702. When you use the <filename>devtool search</filename> command,
  1703. you must supply a <replaceable>keyword</replaceable>.
  1704. The command uses the <replaceable>keyword</replaceable> when
  1705. searching for a match.
  1706. </para>
  1707. </section>
  1708. </section>
  1709. <section id="using-a-quilt-workflow">
  1710. <title>Using Quilt in Your Workflow</title>
  1711. <para>
  1712. <ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink>
  1713. is a powerful tool that allows you to capture source code changes
  1714. without having a clean source tree.
  1715. This section outlines the typical workflow you can use to modify
  1716. source code, test changes, and then preserve the changes in the
  1717. form of a patch all using Quilt.
  1718. <note><title>Tip</title>
  1719. With regard to preserving changes to source files if you
  1720. clean a recipe or have <filename>rm_work</filename> enabled,
  1721. the workflow described in the
  1722. "<link linkend='using-devtool-in-your-workflow'>Using <filename>devtool</filename> in Your Workflow</link>"
  1723. section is a safer development flow than than the flow that
  1724. uses Quilt.
  1725. </note>
  1726. </para>
  1727. <para>
  1728. Follow these general steps:
  1729. <orderedlist>
  1730. <listitem><para><emphasis>Find the Source Code:</emphasis>
  1731. Temporary source code used by the OpenEmbedded build system
  1732. is kept in the
  1733. <link linkend='build-directory'>Build Directory</link>.
  1734. See the
  1735. "<link linkend='finding-the-temporary-source-code'>Finding Temporary Source Code</link>"
  1736. section to learn how to locate the directory that has the
  1737. temporary source code for a particular package.
  1738. </para></listitem>
  1739. <listitem><para><emphasis>Change Your Working Directory:</emphasis>
  1740. You need to be in the directory that has the temporary source code.
  1741. That directory is defined by the
  1742. <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
  1743. variable.</para></listitem>
  1744. <listitem><para><emphasis>Create a New Patch:</emphasis>
  1745. Before modifying source code, you need to create a new patch.
  1746. To create a new patch file, use <filename>quilt new</filename> as below:
  1747. <literallayout class='monospaced'>
  1748. $ quilt new my_changes.patch
  1749. </literallayout></para></listitem>
  1750. <listitem><para><emphasis>Notify Quilt and Add Files:</emphasis>
  1751. After creating the patch, you need to notify Quilt about the files
  1752. you plan to edit.
  1753. You notify Quilt by adding the files to the patch you just created:
  1754. <literallayout class='monospaced'>
  1755. $ quilt add file1.c file2.c file3.c
  1756. </literallayout>
  1757. </para></listitem>
  1758. <listitem><para><emphasis>Edit the Files:</emphasis>
  1759. Make your changes in the source code to the files you added
  1760. to the patch.
  1761. </para></listitem>
  1762. <listitem><para><emphasis>Test Your Changes:</emphasis>
  1763. Once you have modified the source code, the easiest way to
  1764. your changes is by calling the
  1765. <filename>do_compile</filename> task as shown in the
  1766. following example:
  1767. <literallayout class='monospaced'>
  1768. $ bitbake -c compile -f <replaceable>package</replaceable>
  1769. </literallayout>
  1770. The <filename>-f</filename> or <filename>--force</filename>
  1771. option forces the specified task to execute.
  1772. If you find problems with your code, you can just keep editing and
  1773. re-testing iteratively until things work as expected.
  1774. <note>All the modifications you make to the temporary source code
  1775. disappear once you run the
  1776. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-clean'><filename>do_clean</filename></ulink>
  1777. or
  1778. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>do_cleanall</filename></ulink>
  1779. tasks using BitBake (i.e.
  1780. <filename>bitbake -c clean <replaceable>package</replaceable></filename>
  1781. and
  1782. <filename>bitbake -c cleanall <replaceable>package</replaceable></filename>).
  1783. Modifications will also disappear if you use the <filename>rm_work</filename>
  1784. feature as described in the
  1785. "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
  1786. section of the Yocto Project Quick Start.
  1787. </note></para></listitem>
  1788. <listitem><para><emphasis>Generate the Patch:</emphasis>
  1789. Once your changes work as expected, you need to use Quilt to generate the final patch that
  1790. contains all your modifications.
  1791. <literallayout class='monospaced'>
  1792. $ quilt refresh
  1793. </literallayout>
  1794. At this point, the <filename>my_changes.patch</filename> file has all your edits made
  1795. to the <filename>file1.c</filename>, <filename>file2.c</filename>, and
  1796. <filename>file3.c</filename> files.</para>
  1797. <para>You can find the resulting patch file in the <filename>patches/</filename>
  1798. subdirectory of the source (<filename>S</filename>) directory.</para></listitem>
  1799. <listitem><para><emphasis>Copy the Patch File:</emphasis>
  1800. For simplicity, copy the patch file into a directory named <filename>files</filename>,
  1801. which you can create in the same directory that holds the recipe
  1802. (<filename>.bb</filename>) file or the
  1803. append (<filename>.bbappend</filename>) file.
  1804. Placing the patch here guarantees that the OpenEmbedded build system will find
  1805. the patch.
  1806. Next, add the patch into the
  1807. <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename>
  1808. of the recipe.
  1809. Here is an example:
  1810. <literallayout class='monospaced'>
  1811. SRC_URI += "file://my_changes.patch"
  1812. </literallayout></para></listitem>
  1813. </orderedlist>
  1814. </para>
  1815. </section>
  1816. <section id='finding-the-temporary-source-code'>
  1817. <title>Finding Temporary Source Code</title>
  1818. <para>
  1819. You might find it helpful during development to modify the
  1820. temporary source code used by recipes to build packages.
  1821. For example, suppose you are developing a patch and you need to
  1822. experiment a bit to figure out your solution.
  1823. After you have initially built the package, you can iteratively
  1824. tweak the source code, which is located in the
  1825. <link linkend='build-directory'>Build Directory</link>, and then
  1826. you can force a re-compile and quickly test your altered code.
  1827. Once you settle on a solution, you can then preserve your changes
  1828. in the form of patches.
  1829. If you are using Quilt for development, see the
  1830. "<link linkend='using-a-quilt-workflow'>Using Quilt in Your Workflow</link>"
  1831. section for more information.
  1832. </para>
  1833. <para>
  1834. During a build, the unpacked temporary source code used by recipes
  1835. to build packages is available in the Build Directory as
  1836. defined by the
  1837. <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'>S</ulink></filename> variable.
  1838. Below is the default value for the <filename>S</filename> variable as defined in the
  1839. <filename>meta/conf/bitbake.conf</filename> configuration file in the
  1840. <link linkend='source-directory'>Source Directory</link>:
  1841. <literallayout class='monospaced'>
  1842. S = "${WORKDIR}/${BP}"
  1843. </literallayout>
  1844. You should be aware that many recipes override the <filename>S</filename> variable.
  1845. For example, recipes that fetch their source from Git usually set
  1846. <filename>S</filename> to <filename>${WORKDIR}/git</filename>.
  1847. <note>
  1848. The
  1849. <ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink>
  1850. represents the base recipe name, which consists of the name and version:
  1851. <literallayout class='monospaced'>
  1852. BP = "${BPN}-${PV}"
  1853. </literallayout>
  1854. </note>
  1855. </para>
  1856. <para>
  1857. The path to the work directory for the recipe
  1858. (<ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>)
  1859. is defined as follows:
  1860. <literallayout class='monospaced'>
  1861. ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}
  1862. </literallayout>
  1863. The actual directory depends on several things:
  1864. <itemizedlist>
  1865. <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>:
  1866. The top-level build output directory</listitem>
  1867. <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></ulink>:
  1868. The target system identifier</listitem>
  1869. <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>:
  1870. The recipe name</listitem>
  1871. <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-EXTENDPE'><filename>EXTENDPE</filename></ulink>:
  1872. The epoch - (if
  1873. <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>
  1874. is not specified, which is usually the case for most
  1875. recipes, then <filename>EXTENDPE</filename> is blank)</listitem>
  1876. <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
  1877. The recipe version</listitem>
  1878. <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
  1879. The recipe revision</listitem>
  1880. </itemizedlist>
  1881. </para>
  1882. <para>
  1883. As an example, assume a Source Directory top-level folder
  1884. named <filename>poky</filename>, a default Build Directory at
  1885. <filename>poky/build</filename>, and a
  1886. <filename>qemux86-poky-linux</filename> machine target
  1887. system.
  1888. Furthermore, suppose your recipe is named
  1889. <filename>foo_1.3.0.bb</filename>.
  1890. In this case, the work directory the build system uses to
  1891. build the package would be as follows:
  1892. <literallayout class='monospaced'>
  1893. poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0
  1894. </literallayout>
  1895. </para>
  1896. <para>
  1897. Now that you know where to locate the directory that has the
  1898. temporary source code, you can use a Quilt as described in section
  1899. "<link linkend='using-a-quilt-workflow'>Using Quilt in Your Workflow</link>"
  1900. to make your edits, test the changes, and preserve the changes in
  1901. the form of patches.
  1902. </para>
  1903. </section>
  1904. </section>
  1905. <section id='image-development-using-toaster'>
  1906. <title>Image Development Using Toaster</title>
  1907. <para>
  1908. Toaster is a web interface to the Yocto Project's OpenEmbedded build
  1909. system.
  1910. You can initiate builds using Toaster as well as examine the results
  1911. and statistics of builds.
  1912. See the
  1913. <ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-intro'>Toaster User Manual</ulink>
  1914. for information on how to set up and use Toaster to build images.
  1915. </para>
  1916. </section>
  1917. <section id="platdev-appdev-devshell">
  1918. <title>Using a Development Shell</title>
  1919. <para>
  1920. When debugging certain commands or even when just editing packages,
  1921. <filename>devshell</filename> can be a useful tool.
  1922. When you invoke <filename>devshell</filename>, all tasks up to and
  1923. including
  1924. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
  1925. are run for the specified target.
  1926. Then, a new terminal is opened and you are placed in
  1927. <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink><filename>}</filename>,
  1928. the source directory.
  1929. In the new terminal, all the OpenEmbedded build-related environment variables are
  1930. still defined so you can use commands such as <filename>configure</filename> and
  1931. <filename>make</filename>.
  1932. The commands execute just as if the OpenEmbedded build system were executing them.
  1933. Consequently, working this way can be helpful when debugging a build or preparing
  1934. software to be used with the OpenEmbedded build system.
  1935. </para>
  1936. <para>
  1937. Following is an example that uses <filename>devshell</filename> on a target named
  1938. <filename>matchbox-desktop</filename>:
  1939. <literallayout class='monospaced'>
  1940. $ bitbake matchbox-desktop -c devshell
  1941. </literallayout>
  1942. </para>
  1943. <para>
  1944. This command spawns a terminal with a shell prompt within the OpenEmbedded build environment.
  1945. The <ulink url='&YOCTO_DOCS_REF_URL;#var-OE_TERMINAL'><filename>OE_TERMINAL</filename></ulink>
  1946. variable controls what type of shell is opened.
  1947. </para>
  1948. <para>
  1949. For spawned terminals, the following occurs:
  1950. <itemizedlist>
  1951. <listitem><para>The <filename>PATH</filename> variable includes the
  1952. cross-toolchain.</para></listitem>
  1953. <listitem><para>The <filename>pkgconfig</filename> variables find the correct
  1954. <filename>.pc</filename> files.</para></listitem>
  1955. <listitem><para>The <filename>configure</filename> command finds the
  1956. Yocto Project site files as well as any other necessary files.</para></listitem>
  1957. </itemizedlist>
  1958. </para>
  1959. <para>
  1960. Within this environment, you can run configure or compile
  1961. commands as if they were being run by
  1962. the OpenEmbedded build system itself.
  1963. As noted earlier, the working directory also automatically changes to the
  1964. Source Directory (<ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>).
  1965. </para>
  1966. <para>
  1967. To manually run a specific task using <filename>devshell</filename>,
  1968. run the corresponding <filename>run.*</filename> script in
  1969. the
  1970. <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/temp</filename>
  1971. directory (e.g.,
  1972. <filename>run.do_configure.</filename><replaceable>pid</replaceable>).
  1973. If a task's script does not exist, which would be the case if the task was
  1974. skipped by way of the sstate cache, you can create the task by first running
  1975. it outside of the <filename>devshell</filename>:
  1976. <literallayout class='monospaced'>
  1977. $ bitbake -c <replaceable>task</replaceable>
  1978. </literallayout>
  1979. <note><title>Notes</title>
  1980. <itemizedlist>
  1981. <listitem><para>Execution of a task's <filename>run.*</filename>
  1982. script and BitBake's execution of a task are identical.
  1983. In other words, running the script re-runs the task
  1984. just as it would be run using the
  1985. <filename>bitbake -c</filename> command.
  1986. </para></listitem>
  1987. <listitem><para>Any <filename>run.*</filename> file that does not
  1988. have a <filename>.pid</filename> extension is a
  1989. symbolic link (symlink) to the most recent version of that
  1990. file.
  1991. </para></listitem>
  1992. </itemizedlist>
  1993. </note>
  1994. </para>
  1995. <para>
  1996. Remember, that the <filename>devshell</filename> is a mechanism that allows
  1997. you to get into the BitBake task execution environment.
  1998. And as such, all commands must be called just as BitBake would call them.
  1999. That means you need to provide the appropriate options for
  2000. cross-compilation and so forth as applicable.
  2001. </para>
  2002. <para>
  2003. When you are finished using <filename>devshell</filename>, exit the shell
  2004. or close the terminal window.
  2005. </para>
  2006. <note><title>Notes</title>
  2007. <itemizedlist>
  2008. <listitem><para>
  2009. It is worth remembering that when using <filename>devshell</filename>
  2010. you need to use the full compiler name such as <filename>arm-poky-linux-gnueabi-gcc</filename>
  2011. instead of just using <filename>gcc</filename>.
  2012. The same applies to other applications such as <filename>binutils</filename>,
  2013. <filename>libtool</filename> and so forth.
  2014. BitBake sets up environment variables such as <filename>CC</filename>
  2015. to assist applications, such as <filename>make</filename> to find the correct tools.
  2016. </para></listitem>
  2017. <listitem><para>
  2018. It is also worth noting that <filename>devshell</filename> still works over
  2019. X11 forwarding and similar situations.
  2020. </para></listitem>
  2021. </itemizedlist>
  2022. </note>
  2023. </section>
  2024. </chapter>