sdk-extensible.xml 95 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789
  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='sdk-extensible'>
  5. <title>Using the Extensible SDK</title>
  6. <para>
  7. This chapter describes the extensible SDK and how to install it.
  8. Information covers the pieces of the SDK, how to install it, and
  9. presents a look at using the <filename>devtool</filename>
  10. functionality.
  11. The extensible SDK makes it easy to add new applications and libraries
  12. to an image, modify the source for an existing component, test
  13. changes on the target hardware, and ease integration into the rest of
  14. the
  15. <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>.
  16. <note>
  17. For a side-by-side comparison of main features supported for an
  18. extensible SDK as compared to a standard SDK, see the
  19. "<link linkend='sdk-manual-intro'>Introduction</link>"
  20. section.
  21. </note>
  22. </para>
  23. <para>
  24. In addition to the functionality available through
  25. <filename>devtool</filename>, you can alternatively make use of the
  26. toolchain directly, for example from Makefile, Autotools, and
  27. <trademark class='trade'>Eclipse</trademark>-based projects.
  28. See the
  29. "<link linkend='sdk-working-projects'>Using the SDK Toolchain Directly</link>"
  30. chapter for more information.
  31. </para>
  32. <section id='sdk-extensible-sdk-intro'>
  33. <title>Why use the Extensible SDK and What is in It?</title>
  34. <para>
  35. The extensible SDK provides a cross-development toolchain and
  36. libraries tailored to the contents of a specific image.
  37. You would use the Extensible SDK if you want a toolchain experience
  38. supplemented with the powerful set of <filename>devtool</filename>
  39. commands tailored for the Yocto Project environment.
  40. </para>
  41. <para>
  42. The installed extensible SDK consists of several files and
  43. directories.
  44. Basically, it contains an SDK environment setup script, some
  45. configuration files, an internal build system, and the
  46. <filename>devtool</filename> functionality.
  47. </para>
  48. </section>
  49. <section id='sdk-installing-the-extensible-sdk'>
  50. <title>Installing the Extensible SDK</title>
  51. <para>
  52. The first thing you need to do is install the SDK on your
  53. <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>Build Host</ulink>
  54. by running the <filename>*.sh</filename> installation script.
  55. </para>
  56. <para>
  57. You can download a tarball installer, which includes the
  58. pre-built toolchain, the <filename>runqemu</filename>
  59. script, the internal build system, <filename>devtool</filename>,
  60. and support files from the appropriate
  61. <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchain</ulink>
  62. directory within the Index of Releases.
  63. Toolchains are available for several 32-bit and 64-bit
  64. architectures with the <filename>x86_64</filename> directories,
  65. respectively.
  66. The toolchains the Yocto Project provides are based off the
  67. <filename>core-image-sato</filename> and
  68. <filename>core-image-minimal</filename> images and contain
  69. libraries appropriate for developing against that image.
  70. </para>
  71. <para>
  72. The names of the tarball installer scripts are such that a
  73. string representing the host system appears first in the
  74. filename and then is immediately followed by a string
  75. representing the target architecture.
  76. An extensible SDK has the string "-ext" as part of the name.
  77. Following is the general form:
  78. <literallayout class='monospaced'>
  79. poky-glibc-<replaceable>host_system</replaceable>-<replaceable>image_type</replaceable>-<replaceable>arch</replaceable>-toolchain-ext-<replaceable>release_version</replaceable>.sh
  80. Where:
  81. <replaceable>host_system</replaceable> is a string representing your development system:
  82. i686 or x86_64.
  83. <replaceable>image_type</replaceable> is the image for which the SDK was built:
  84. core-image-sato or core-image-minimal
  85. <replaceable>arch</replaceable> is a string representing the tuned target architecture:
  86. aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon
  87. <replaceable>release_version</replaceable> is a string representing the release number of the Yocto Project:
  88. &DISTRO;, &DISTRO;+snapshot
  89. </literallayout>
  90. For example, the following SDK installer is for a 64-bit
  91. development host system and a i586-tuned target architecture
  92. based off the SDK for <filename>core-image-sato</filename> and
  93. using the current &DISTRO; snapshot:
  94. <literallayout class='monospaced'>
  95. poky-glibc-x86_64-core-image-sato-i586-toolchain-ext-&DISTRO;.sh
  96. </literallayout>
  97. <note>
  98. As an alternative to downloading an SDK, you can build the
  99. SDK installer.
  100. For information on building the installer, see the
  101. "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
  102. section.
  103. Another helpful resource for building an installer is the
  104. <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>Cookbook guide to Making an Eclipse Debug Capable Image</ulink>
  105. wiki page.
  106. This wiki page focuses on development when using the Eclipse
  107. IDE.
  108. </note>
  109. </para>
  110. <para>
  111. The SDK and toolchains are self-contained and by default are
  112. installed into the <filename>poky_sdk</filename> folder in your
  113. home directory.
  114. You can choose to install the extensible SDK in any location when
  115. you run the installer.
  116. However, because files need to be written under that directory
  117. during the normal course of operation, the location you choose
  118. for installation must be writable for whichever
  119. users need to use the SDK.
  120. </para>
  121. <para>
  122. The following command shows how to run the installer given a
  123. toolchain tarball for a 64-bit x86 development host system and
  124. a 64-bit x86 target architecture.
  125. The example assumes the SDK installer is located in
  126. <filename>~/Downloads/</filename> and has execution rights.
  127. <note>
  128. If you do not have write permissions for the directory
  129. into which you are installing the SDK, the installer
  130. notifies you and exits.
  131. For that case, set up the proper permissions in the directory
  132. and run the installer again.
  133. </note>
  134. <literallayout class='monospaced'>
  135. $ ./Downloads/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.5.sh
  136. Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.5
  137. ==========================================================================
  138. Enter target directory for SDK (default: ~/poky_sdk):
  139. You are about to install the SDK to "/home/scottrif/poky_sdk". Proceed[Y/n]? Y
  140. Extracting SDK..............done
  141. Setting it up...
  142. Extracting buildtools...
  143. Preparing build system...
  144. Parsing recipes: 100% |##################################################################| Time: 0:00:52
  145. Initialising tasks: 100% |###############################################################| Time: 0:00:00
  146. Checking sstate mirror object availability: 100% |#######################################| Time: 0:00:00
  147. Loading cache: 100% |####################################################################| Time: 0:00:00
  148. Initialising tasks: 100% |###############################################################| Time: 0:00:00
  149. done
  150. SDK has been successfully set up and is ready to be used.
  151. Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
  152. $ . /home/scottrif/poky_sdk/environment-setup-core2-64-poky-linux
  153. </literallayout>
  154. </para>
  155. </section>
  156. <section id='sdk-running-the-extensible-sdk-environment-setup-script'>
  157. <title>Running the Extensible SDK Environment Setup Script</title>
  158. <para>
  159. Once you have the SDK installed, you must run the SDK environment
  160. setup script before you can actually use the SDK.
  161. This setup script resides in the directory you chose when you
  162. installed the SDK, which is either the default
  163. <filename>poky_sdk</filename> directory or the directory you
  164. chose during installation.
  165. </para>
  166. <para>
  167. Before running the script, be sure it is the one that matches the
  168. architecture for which you are developing.
  169. Environment setup scripts begin with the string
  170. "<filename>environment-setup</filename>" and include as part of
  171. their name the tuned target architecture.
  172. As an example, the following commands set the working directory
  173. to where the SDK was installed and then source the environment
  174. setup script.
  175. In this example, the setup script is for an IA-based
  176. target machine using i586 tuning:
  177. <literallayout class='monospaced'>
  178. $ cd /home/scottrif/poky_sdk
  179. $ source environment-setup-core2-64-poky-linux
  180. SDK environment now set up; additionally you may now run devtool to perform development tasks.
  181. Run devtool --help for further details.
  182. </literallayout>
  183. Running the setup script defines many environment variables needed
  184. in order to use the SDK (e.g. <filename>PATH</filename>,
  185. <ulink url='&YOCTO_DOCS_REF_URL;#var-CC'><filename>CC</filename></ulink>,
  186. <ulink url='&YOCTO_DOCS_REF_URL;#var-LD'><filename>LD</filename></ulink>,
  187. and so forth).
  188. If you want to see all the environment variables the script
  189. exports, examine the installation file itself.
  190. </para>
  191. </section>
  192. <section id='using-devtool-in-your-sdk-workflow'>
  193. <title>Using <filename>devtool</filename> in Your SDK Workflow</title>
  194. <para>
  195. The cornerstone of the extensible SDK is a command-line tool
  196. called <filename>devtool</filename>.
  197. This tool provides a number of features that help
  198. you build, test and package software within the extensible SDK, and
  199. optionally integrate it into an image built by the OpenEmbedded
  200. build system.
  201. <note><title>Tip</title>
  202. The use of <filename>devtool</filename> is not limited to
  203. the extensible SDK.
  204. You can use <filename>devtool</filename> to help you easily
  205. develop any project whose build output must be part of an
  206. image built using the build system.
  207. </note>
  208. </para>
  209. <para>
  210. The <filename>devtool</filename> command line is organized
  211. similarly to
  212. <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink> in that it
  213. has a number of sub-commands for each function.
  214. You can run <filename>devtool --help</filename> to see all the
  215. commands.
  216. <note>
  217. See the
  218. "<ulink url='&YOCTO_DOCS_REF_URL;#ref-devtool-reference'><filename>devtool</filename>&nbsp;Quick Reference</ulink>"
  219. in the Yocto Project Reference Manual for a
  220. <filename>devtool</filename> quick reference.
  221. </note>
  222. </para>
  223. <para>
  224. Three <filename>devtool</filename> subcommands exist that provide
  225. entry-points into development:
  226. <itemizedlist>
  227. <listitem><para>
  228. <emphasis><filename>devtool add</filename></emphasis>:
  229. Assists in adding new software to be built.
  230. </para></listitem>
  231. <listitem><para>
  232. <emphasis><filename>devtool modify</filename></emphasis>:
  233. Sets up an environment to enable you to modify the source of
  234. an existing component.
  235. </para></listitem>
  236. <listitem><para>
  237. <emphasis><filename>devtool upgrade</filename></emphasis>:
  238. Updates an existing recipe so that you can build it for
  239. an updated set of source files.
  240. </para></listitem>
  241. </itemizedlist>
  242. As with the build system, "recipes" represent software packages
  243. within <filename>devtool</filename>.
  244. When you use <filename>devtool add</filename>, a recipe is
  245. automatically created.
  246. When you use <filename>devtool modify</filename>, the specified
  247. existing recipe is used in order to determine where to get the
  248. source code and how to patch it.
  249. In both cases, an environment is set up so that when you build the
  250. recipe a source tree that is under your control is used in order to
  251. allow you to make changes to the source as desired.
  252. By default, new recipes and the source go into a "workspace"
  253. directory under the SDK.
  254. </para>
  255. <para>
  256. The remainder of this section presents the
  257. <filename>devtool add</filename>,
  258. <filename>devtool modify</filename>, and
  259. <filename>devtool upgrade</filename> workflows.
  260. </para>
  261. <section id='sdk-use-devtool-to-add-an-application'>
  262. <title>Use <filename>devtool add</filename> to Add an Application</title>
  263. <para>
  264. The <filename>devtool add</filename> command generates
  265. a new recipe based on existing source code.
  266. This command takes advantage of the
  267. <ulink url='&YOCTO_DOCS_REF_URL;#devtool-the-workspace-layer-structure'>workspace</ulink>
  268. layer that many <filename>devtool</filename> commands
  269. use.
  270. The command is flexible enough to allow you to extract source
  271. code into both the workspace or a separate local Git repository
  272. and to use existing code that does not need to be extracted.
  273. </para>
  274. <para>
  275. Depending on your particular scenario, the arguments and options
  276. you use with <filename>devtool add</filename> form different
  277. combinations.
  278. The following diagram shows common development flows
  279. you would use with the <filename>devtool add</filename>
  280. command:
  281. </para>
  282. <para>
  283. <imagedata fileref="figures/sdk-devtool-add-flow.png" align="center" />
  284. </para>
  285. <para>
  286. <orderedlist>
  287. <listitem><para><emphasis>Generating the New Recipe</emphasis>:
  288. The top part of the flow shows three scenarios by which
  289. you could use <filename>devtool add</filename> to
  290. generate a recipe based on existing source code.</para>
  291. <para>In a shared development environment, it is
  292. typical for other developers to be responsible for
  293. various areas of source code.
  294. As a developer, you are probably interested in using
  295. that source code as part of your development within
  296. the Yocto Project.
  297. All you need is access to the code, a recipe, and a
  298. controlled area in which to do your work.</para>
  299. <para>Within the diagram, three possible scenarios
  300. feed into the <filename>devtool add</filename> workflow:
  301. <itemizedlist>
  302. <listitem><para>
  303. <emphasis>Left</emphasis>:
  304. The left scenario in the figure represents a
  305. common situation where the source code does not
  306. exist locally and needs to be extracted.
  307. In this situation, the source code is extracted
  308. to the default workspace - you do not
  309. want the files in some specific location
  310. outside of the workspace.
  311. Thus, everything you need will be located in
  312. the workspace:
  313. <literallayout class='monospaced'>
  314. $ devtool add <replaceable>recipe fetchuri</replaceable>
  315. </literallayout>
  316. With this command, <filename>devtool</filename>
  317. extracts the upstream source files into a local
  318. Git repository within the
  319. <filename>sources</filename> folder.
  320. The command then creates a recipe named
  321. <replaceable>recipe</replaceable> and a
  322. corresponding append file in the workspace.
  323. If you do not provide
  324. <replaceable>recipe</replaceable>, the command
  325. makes an attempt to determine the recipe name.
  326. </para></listitem>
  327. <listitem><para>
  328. <emphasis>Middle</emphasis>:
  329. The middle scenario in the figure also
  330. represents a situation where the source code
  331. does not exist locally.
  332. In this case, the code is again upstream
  333. and needs to be extracted to some
  334. local area - this time outside of the default
  335. workspace.
  336. <note>
  337. If required, <filename>devtool</filename>
  338. always creates
  339. a Git repository locally during the
  340. extraction.
  341. </note>
  342. Furthermore, the first positional argument
  343. <replaceable>srctree</replaceable> in this
  344. case identifies where the
  345. <filename>devtool add</filename> command
  346. will locate the extracted code outside of the
  347. workspace.
  348. You need to specify an empty directory:
  349. <literallayout class='monospaced'>
  350. $ devtool add <replaceable>recipe srctree fetchuri</replaceable>
  351. </literallayout>
  352. In summary, the source code is pulled from
  353. <replaceable>fetchuri</replaceable> and
  354. extracted into the location defined by
  355. <replaceable>srctree</replaceable> as a local
  356. Git repository.</para>
  357. <para>Within workspace,
  358. <filename>devtool</filename> creates a
  359. recipe named <replaceable>recipe</replaceable>
  360. along with an associated append file.
  361. </para></listitem>
  362. <listitem><para>
  363. <emphasis>Right</emphasis>:
  364. The right scenario in the figure represents a
  365. situation where the
  366. <replaceable>srctree</replaceable> has been
  367. previously prepared outside of the
  368. <filename>devtool</filename> workspace.</para>
  369. <para>The following command provides a new
  370. recipe name and identifies the existing source
  371. tree location:
  372. <literallayout class='monospaced'>
  373. $ devtool add <replaceable>recipe srctree</replaceable>
  374. </literallayout>
  375. The command examines the source code and
  376. creates a recipe named
  377. <replaceable>recipe</replaceable> for the code
  378. and places the recipe into the workspace.
  379. </para>
  380. <para>Because the extracted source code already
  381. exists, <filename>devtool</filename> does not
  382. try to relocate the source code into the
  383. workspace - only the new recipe is placed
  384. in the workspace.</para>
  385. <para>Aside from a recipe folder, the command
  386. also creates an associated append folder and
  387. places an initial
  388. <filename>*.bbappend</filename> file within.
  389. </para></listitem>
  390. </itemizedlist>
  391. </para></listitem>
  392. <listitem><para>
  393. <emphasis>Edit the Recipe</emphasis>:
  394. You can use <filename>devtool edit-recipe</filename>
  395. to open up the editor as defined by the
  396. <filename>$EDITOR</filename> environment variable
  397. and modify the file:
  398. <literallayout class='monospaced'>
  399. $ devtool edit-recipe <replaceable>recipe</replaceable>
  400. </literallayout>
  401. From within the editor, you can make modifications to
  402. the recipe that take affect when you build it later.
  403. </para></listitem>
  404. <listitem><para>
  405. <emphasis>Build the Recipe or Rebuild the Image</emphasis>:
  406. The next step you take depends on what you are going
  407. to do with the new code.</para>
  408. <para>If you need to eventually move the build output
  409. to the target hardware, use the following
  410. <filename>devtool</filename> command:
  411. <literallayout class='monospaced'>
  412. $ devtool build <replaceable>recipe</replaceable>
  413. </literallayout></para>
  414. <para>On the other hand, if you want an image to
  415. contain the recipe's packages from the workspace
  416. for immediate deployment onto a device (e.g. for
  417. testing purposes), you can use
  418. the <filename>devtool build-image</filename> command:
  419. <literallayout class='monospaced'>
  420. $ devtool build-image <replaceable>image</replaceable>
  421. </literallayout>
  422. </para></listitem>
  423. <listitem><para>
  424. <emphasis>Deploy the Build Output</emphasis>:
  425. When you use the <filename>devtool build</filename>
  426. command to build out your recipe, you probably want to
  427. see if the resulting build output works as expected
  428. on the target hardware.
  429. <note>
  430. This step assumes you have a previously built
  431. image that is already either running in QEMU or
  432. is running on actual hardware.
  433. Also, it is assumed that for deployment of the
  434. image to the target, SSH is installed in the image
  435. and, if the image is running on real hardware,
  436. you have network access to and from your
  437. development machine.
  438. </note>
  439. You can deploy your build output to that target
  440. hardware by using the
  441. <filename>devtool deploy-target</filename> command:
  442. <literallayout class='monospaced'>
  443. $ devtool deploy-target <replaceable>recipe target</replaceable>
  444. </literallayout>
  445. The <replaceable>target</replaceable> is a live target
  446. machine running as an SSH server.</para>
  447. <para>You can, of course, also deploy the image you
  448. build to actual hardware by using the
  449. <filename>devtool build-image</filename> command.
  450. However, <filename>devtool</filename> does not provide
  451. a specific command that allows you to deploy the
  452. image to actual hardware.
  453. </para></listitem>
  454. <listitem><para>
  455. <emphasis>Finish Your Work With the Recipe</emphasis>:
  456. The <filename>devtool finish</filename> command creates
  457. any patches corresponding to commits in the local
  458. Git repository, moves the new recipe to a more permanent
  459. layer, and then resets the recipe so that the recipe is
  460. built normally rather than from the workspace.
  461. <literallayout class='monospaced'>
  462. $ devtool finish <replaceable>recipe layer</replaceable>
  463. </literallayout>
  464. <note>
  465. Any changes you want to turn into patches must be
  466. committed to the Git repository in the source tree.
  467. </note></para>
  468. <para>As mentioned, the
  469. <filename>devtool finish</filename> command moves the
  470. final recipe to its permanent layer.
  471. </para>
  472. <para>As a final process of the
  473. <filename>devtool finish</filename> command, the state
  474. of the standard layers and the upstream source is
  475. restored so that you can build the recipe from those
  476. areas rather than the workspace.
  477. <note>
  478. You can use the <filename>devtool reset</filename>
  479. command to put things back should you decide you
  480. do not want to proceed with your work.
  481. If you do use this command, realize that the source
  482. tree is preserved.
  483. </note>
  484. </para></listitem>
  485. </orderedlist>
  486. </para>
  487. </section>
  488. <section id='sdk-devtool-use-devtool-modify-to-modify-the-source-of-an-existing-component'>
  489. <title>Use <filename>devtool modify</filename> to Modify the Source of an Existing Component</title>
  490. <para>
  491. The <filename>devtool modify</filename> command prepares the
  492. way to work on existing code that already has a local recipe in
  493. place that is used to build the software.
  494. The command is flexible enough to allow you to extract code
  495. from an upstream source, specify the existing recipe, and
  496. keep track of and gather any patch files from other developers
  497. that are associated with the code.
  498. </para>
  499. <para>
  500. Depending on your particular scenario, the arguments and options
  501. you use with <filename>devtool modify</filename> form different
  502. combinations.
  503. The following diagram shows common development flows for the
  504. <filename>devtool modify</filename> command:
  505. </para>
  506. <para>
  507. <imagedata fileref="figures/sdk-devtool-modify-flow.png" align="center" />
  508. </para>
  509. <para>
  510. <orderedlist>
  511. <listitem><para>
  512. <emphasis>Preparing to Modify the Code</emphasis>:
  513. The top part of the flow shows three scenarios by which
  514. you could use <filename>devtool modify</filename> to
  515. prepare to work on source files.
  516. Each scenario assumes the following:
  517. <itemizedlist>
  518. <listitem><para>
  519. The recipe exists locally in a layer external
  520. to the <filename>devtool</filename> workspace.
  521. </para></listitem>
  522. <listitem><para>
  523. The source files exist either upstream in an
  524. un-extracted state or locally in a previously
  525. extracted state.
  526. </para></listitem>
  527. </itemizedlist>
  528. The typical situation is where another developer has
  529. created a layer for use with the Yocto Project and
  530. their recipe already resides in that layer.
  531. Furthermore, their source code is readily available
  532. either upstream or locally.
  533. <itemizedlist>
  534. <listitem><para>
  535. <emphasis>Left</emphasis>:
  536. The left scenario in the figure represents a
  537. common situation where the source code does
  538. not exist locally and it needs to be extracted
  539. from an upstream source.
  540. In this situation, the source is extracted
  541. into the default <filename>devtool</filename>
  542. workspace location.
  543. The recipe, in this scenario, is in its own
  544. layer outside the workspace
  545. (i.e.
  546. <filename>meta-</filename><replaceable>layername</replaceable>).
  547. </para>
  548. <para>The following command identifies the
  549. recipe and, by default, extracts the source
  550. files:
  551. <literallayout class='monospaced'>
  552. $ devtool modify <replaceable>recipe</replaceable>
  553. </literallayout>
  554. Once <filename>devtool</filename>locates the
  555. recipe, <filename>devtool</filename> uses the
  556. recipe's
  557. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
  558. statements to locate the source code and any
  559. local patch files from other developers.</para>
  560. <para>With this scenario, no
  561. <replaceable>srctree</replaceable> argument
  562. exists.
  563. Consequently, the default behavior of the
  564. <filename>devtool modify</filename> command is
  565. to extract the source files pointed to by the
  566. <filename>SRC_URI</filename> statements into a
  567. local Git structure.
  568. Furthermore, the location for the extracted
  569. source is the default area within the
  570. <filename>devtool</filename> workspace.
  571. The result is that the command sets up both
  572. the source code and an append file within the
  573. workspace while the recipe remains in its
  574. original location.
  575. </para></listitem>
  576. <listitem><para>
  577. <emphasis>Middle</emphasis>:
  578. The middle scenario in the figure represents a
  579. situation where the source code also does not
  580. exist locally.
  581. In this case, the code is again upstream
  582. and needs to be extracted to some
  583. local area as a Git repository.
  584. The recipe, in this scenario, is again local
  585. and in its own layer outside the workspace.
  586. </para>
  587. <para>The following command tells
  588. <filename>devtool</filename> what recipe with
  589. which to work and, in this case, identifies a
  590. local area for the extracted source files that
  591. is outside of the default
  592. <filename>devtool</filename> workspace:
  593. <literallayout class='monospaced'>
  594. $ devtool modify <replaceable>recipe srctree</replaceable>
  595. </literallayout>
  596. <note>
  597. You cannot provide a URL for
  598. <replaceable>srctree</replaceable> using
  599. the <filename>devtool</filename> command.
  600. </note>
  601. As with all extractions, the command uses
  602. the recipe's <filename>SRC_URI</filename>
  603. statements to locate the source files and any
  604. associated patch files.
  605. Once the files are located, the command by
  606. default extracts them into
  607. <replaceable>srctree</replaceable>.</para>
  608. <para>Within workspace,
  609. <filename>devtool</filename> creates an append
  610. file for the recipe.
  611. The recipe remains in its original location but
  612. the source files are extracted to the location
  613. you provide with
  614. <replaceable>srctree</replaceable>.
  615. </para></listitem>
  616. <listitem><para>
  617. <emphasis>Right</emphasis>:
  618. The right scenario in the figure represents a
  619. situation where the source tree
  620. (<replaceable>srctree</replaceable>) already
  621. exists locally as a previously extracted Git
  622. structure outside of the
  623. <filename>devtool</filename> workspace.
  624. In this example, the recipe also exists
  625. elsewhere locally in its own layer.
  626. </para>
  627. <para>The following command tells
  628. <filename>devtool</filename> the recipe
  629. with which to work, uses the "-n" option to
  630. indicate source does not need to be extracted,
  631. and uses <replaceable>srctree</replaceable> to
  632. point to the previously extracted source files:
  633. <literallayout class='monospaced'>
  634. $ devtool modify -n <replaceable>recipe srctree</replaceable>
  635. </literallayout>
  636. </para>
  637. <para>Once the command finishes, it creates only
  638. an append file for the recipe in the
  639. <filename>devtool</filename> workspace.
  640. The recipe and the source code remain in their
  641. original locations.
  642. </para></listitem>
  643. </itemizedlist>
  644. </para></listitem>
  645. <listitem><para>
  646. <emphasis>Edit the Source</emphasis>:
  647. Once you have used the
  648. <filename>devtool modify</filename> command, you are
  649. free to make changes to the source files.
  650. You can use any editor you like to make and save
  651. your source code modifications.
  652. </para></listitem>
  653. <listitem><para>
  654. <emphasis>Build the Recipe or Rebuild the Image</emphasis>:
  655. The next step you take depends on what you are going
  656. to do with the new code.</para>
  657. <para>If you need to eventually move the build output
  658. to the target hardware, use the following
  659. <filename>devtool</filename> command:
  660. <literallayout class='monospaced'>
  661. $ devtool build <replaceable>recipe</replaceable>
  662. </literallayout></para>
  663. <para>On the other hand, if you want an image to
  664. contain the recipe's packages from the workspace
  665. for immediate deployment onto a device (e.g. for
  666. testing purposes), you can use
  667. the <filename>devtool build-image</filename> command:
  668. <literallayout class='monospaced'>
  669. $ devtool build-image <replaceable>image</replaceable>
  670. </literallayout>
  671. </para></listitem>
  672. <listitem><para>
  673. <emphasis>Deploy the Build Output</emphasis>:
  674. When you use the <filename>devtool build</filename>
  675. command to build out your recipe, you probably want to
  676. see if the resulting build output works as expected
  677. on target hardware.
  678. <note>
  679. This step assumes you have a previously built
  680. image that is already either running in QEMU or
  681. running on actual hardware.
  682. Also, it is assumed that for deployment of the image
  683. to the target, SSH is installed in the image and if
  684. the image is running on real hardware that you have
  685. network access to and from your development machine.
  686. </note>
  687. You can deploy your build output to that target
  688. hardware by using the
  689. <filename>devtool deploy-target</filename> command:
  690. <literallayout class='monospaced'>
  691. $ devtool deploy-target <replaceable>recipe target</replaceable>
  692. </literallayout>
  693. The <replaceable>target</replaceable> is a live target
  694. machine running as an SSH server.</para>
  695. <para>You can, of course, use other methods to deploy
  696. the image you built using the
  697. <filename>devtool build-image</filename> command to
  698. actual hardware.
  699. <filename>devtool</filename> does not provide
  700. a specific command to deploy the image to actual
  701. hardware.
  702. </para></listitem>
  703. <listitem><para>
  704. <emphasis>Finish Your Work With the Recipe</emphasis>:
  705. The <filename>devtool finish</filename> command creates
  706. any patches corresponding to commits in the local
  707. Git repository, updates the recipe to point to them
  708. (or creates a <filename>.bbappend</filename> file to do
  709. so, depending on the specified destination layer), and
  710. then resets the recipe so that the recipe is built
  711. normally rather than from the workspace.
  712. <literallayout class='monospaced'>
  713. $ devtool finish <replaceable>recipe layer</replaceable>
  714. </literallayout>
  715. <note>
  716. Any changes you want to turn into patches must be
  717. staged and committed within the local Git
  718. repository before you use the
  719. <filename>devtool finish</filename> command.
  720. </note></para>
  721. <para>Because there is no need to move the recipe,
  722. <filename>devtool finish</filename> either updates the
  723. original recipe in the original layer or the command
  724. creates a <filename>.bbappend</filename> file in a
  725. different layer as provided by
  726. <replaceable>layer</replaceable>.</para>
  727. <para>As a final process of the
  728. <filename>devtool finish</filename> command, the state
  729. of the standard layers and the upstream source is
  730. restored so that you can build the recipe from those
  731. areas rather than from the workspace.
  732. <note>
  733. You can use the <filename>devtool reset</filename>
  734. command to put things back should you decide you
  735. do not want to proceed with your work.
  736. If you do use this command, realize that the source
  737. tree is preserved.
  738. </note>
  739. </para></listitem>
  740. </orderedlist>
  741. </para>
  742. </section>
  743. <section id='sdk-devtool-use-devtool-upgrade-to-create-a-version-of-the-recipe-that-supports-a-newer-version-of-the-software'>
  744. <title>Use <filename>devtool upgrade</filename> to Create a Version of the Recipe that Supports a Newer Version of the Software</title>
  745. <para>
  746. The <filename>devtool upgrade</filename> command upgrades
  747. an existing recipe to that of a more up-to-date version
  748. found upstream.
  749. Throughout the life of software, recipes continually undergo
  750. version upgrades by their upstream publishers.
  751. You can use the <filename>devtool upgrade</filename>
  752. workflow to make sure your recipes you are using for builds
  753. are up-to-date with their upstream counterparts.
  754. <note>
  755. Several methods exist by which you can upgrade recipes -
  756. <filename>devtool upgrade</filename> happens to be one.
  757. You can read about all the methods by which you can
  758. upgrade recipes in the
  759. "<ulink url='&YOCTO_DOCS_DEV_URL;#gs-upgrading-recipes'>Upgrading Recipes</ulink>"
  760. section of the Yocto Project Development Tasks Manual.
  761. </note>
  762. </para>
  763. <para>
  764. The <filename>devtool upgrade</filename> command is flexible
  765. enough to allow you to specify source code revision and
  766. versioning schemes, extract code into or out of the
  767. <filename>devtool</filename>
  768. <ulink url='&YOCTO_DOCS_REF_URL;#devtool-the-workspace-layer-structure'>workspace</ulink>,
  769. and work with any source file forms that the fetchers support.
  770. </para>
  771. <para>
  772. The following diagram shows the common development flow
  773. used with the <filename>devtool upgrade</filename> command:
  774. </para>
  775. <para>
  776. <imagedata fileref="figures/sdk-devtool-upgrade-flow.png" align="center" />
  777. </para>
  778. <para>
  779. <orderedlist>
  780. <listitem><para>
  781. <emphasis>Initiate the Upgrade</emphasis>:
  782. The top part of the flow shows the typical scenario by
  783. which you use the <filename>devtool upgrade</filename>
  784. command.
  785. The following conditions exist:
  786. <itemizedlist>
  787. <listitem><para>
  788. The recipe exists in a local layer external
  789. to the <filename>devtool</filename> workspace.
  790. </para></listitem>
  791. <listitem><para>
  792. The source files for the new release
  793. exist in the same location pointed to by
  794. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
  795. in the recipe (e.g. a tarball with the new
  796. version number in the name, or as a different
  797. revision in the upstream Git repository).
  798. </para></listitem>
  799. </itemizedlist>
  800. A common situation is where third-party software has
  801. undergone a revision so that it has been upgraded.
  802. The recipe you have access to is likely in your own
  803. layer.
  804. Thus, you need to upgrade the recipe to use the
  805. newer version of the software:
  806. <literallayout class='monospaced'>
  807. $ devtool upgrade -V <replaceable>version recipe</replaceable>
  808. </literallayout>
  809. By default, the <filename>devtool upgrade</filename>
  810. command extracts source code into the
  811. <filename>sources</filename> directory in the
  812. <ulink url='&YOCTO_DOCS_REF_URL;#devtool-the-workspace-layer-structure'>workspace</ulink>.
  813. If you want the code extracted to any other location,
  814. you need to provide the
  815. <replaceable>srctree</replaceable> positional argument
  816. with the command as follows:
  817. <literallayout class='monospaced'>
  818. $ devtool upgrade -V <replaceable>version recipe srctree</replaceable>
  819. </literallayout>
  820. <note>
  821. In this example, the "-V" option specifies the new
  822. version.
  823. If you don't use "-V", the command upgrades the
  824. recipe to the latest version.
  825. </note>
  826. If the source files pointed to by the
  827. <filename>SRC_URI</filename> statement in the recipe
  828. are in a Git repository, you must provide the "-S"
  829. option and specify a revision for the software.</para>
  830. <para>Once <filename>devtool</filename> locates the
  831. recipe, it uses the <filename>SRC_URI</filename>
  832. variable to locate the source code and any local patch
  833. files from other developers.
  834. The result is that the command sets up the source
  835. code, the new version of the recipe, and an append file
  836. all within the workspace.
  837. </para></listitem>
  838. <listitem><para>
  839. <emphasis>Resolve any Conflicts created by the Upgrade</emphasis>:
  840. Conflicts could exist due to the software being
  841. upgraded to a new version.
  842. Conflicts occur if your recipe specifies some patch
  843. files in <filename>SRC_URI</filename> that conflict
  844. with changes made in the new version of the software.
  845. For such cases, you need to resolve the conflicts
  846. by editing the source and following the normal
  847. <filename>git rebase</filename> conflict resolution
  848. process.</para>
  849. <para>Before moving onto the next step, be sure to
  850. resolve any such conflicts created through use of a
  851. newer or different version of the software.
  852. </para></listitem>
  853. <listitem><para>
  854. <emphasis>Build the Recipe or Rebuild the Image</emphasis>:
  855. The next step you take depends on what you are going
  856. to do with the new code.</para>
  857. <para>If you need to eventually move the build output
  858. to the target hardware, use the following
  859. <filename>devtool</filename> command:
  860. <literallayout class='monospaced'>
  861. $ devtool build <replaceable>recipe</replaceable>
  862. </literallayout></para>
  863. <para>On the other hand, if you want an image to
  864. contain the recipe's packages from the workspace
  865. for immediate deployment onto a device (e.g. for
  866. testing purposes), you can use
  867. the <filename>devtool build-image</filename> command:
  868. <literallayout class='monospaced'>
  869. $ devtool build-image <replaceable>image</replaceable>
  870. </literallayout>
  871. </para></listitem>
  872. <listitem><para>
  873. <emphasis>Deploy the Build Output</emphasis>:
  874. When you use the <filename>devtool build</filename>
  875. command or <filename>bitbake</filename> to build
  876. your recipe, you probably want to see if the resulting
  877. build output works as expected on target hardware.
  878. <note>
  879. This step assumes you have a previously built
  880. image that is already either running in QEMU or
  881. running on actual hardware.
  882. Also, it is assumed that for deployment of the
  883. image to the target, SSH is installed in the image
  884. and if the image is running on real hardware that
  885. you have network access to and from your
  886. development machine.
  887. </note>
  888. You can deploy your build output to that target
  889. hardware by using the
  890. <filename>devtool deploy-target</filename> command:
  891. <literallayout class='monospaced'>
  892. $ devtool deploy-target <replaceable>recipe target</replaceable>
  893. </literallayout>
  894. The <replaceable>target</replaceable> is a live target
  895. machine running as an SSH server.</para>
  896. <para>You can, of course, also deploy the image you
  897. build using the
  898. <filename>devtool build-image</filename> command
  899. to actual hardware.
  900. However, <filename>devtool</filename> does not provide
  901. a specific command that allows you to do this.
  902. </para></listitem>
  903. <listitem><para>
  904. <emphasis>Finish Your Work With the Recipe</emphasis>:
  905. The <filename>devtool finish</filename> command creates
  906. any patches corresponding to commits in the local
  907. Git repository, moves the new recipe to a more
  908. permanent layer, and then resets the recipe so that
  909. the recipe is built normally rather than from the
  910. workspace.
  911. If you specify a destination layer that is the same as
  912. the original source, then the old version of the
  913. recipe and associated files will be removed prior to
  914. adding the new version.
  915. <literallayout class='monospaced'>
  916. $ devtool finish <replaceable>recipe layer</replaceable>
  917. </literallayout>
  918. <note>
  919. Any changes you want to turn into patches must be
  920. committed to the Git repository in the source tree.
  921. </note></para>
  922. <para>As a final process of the
  923. <filename>devtool finish</filename> command, the state
  924. of the standard layers and the upstream source is
  925. restored so that you can build the recipe from those
  926. areas rather than the workspace.
  927. <note>
  928. You can use the <filename>devtool reset</filename>
  929. command to put things back should you decide you
  930. do not want to proceed with your work.
  931. If you do use this command, realize that the source
  932. tree is preserved.
  933. </note>
  934. </para></listitem>
  935. </orderedlist>
  936. </para>
  937. </section>
  938. </section>
  939. <section id='sdk-a-closer-look-at-devtool-add'>
  940. <title>A Closer Look at <filename>devtool add</filename></title>
  941. <para>
  942. The <filename>devtool add</filename> command automatically creates
  943. a recipe based on the source tree you provide with the command.
  944. Currently, the command has support for the following:
  945. <itemizedlist>
  946. <listitem><para>
  947. Autotools (<filename>autoconf</filename> and
  948. <filename>automake</filename>)
  949. </para></listitem>
  950. <listitem><para>
  951. CMake
  952. </para></listitem>
  953. <listitem><para>
  954. Scons
  955. </para></listitem>
  956. <listitem><para>
  957. <filename>qmake</filename>
  958. </para></listitem>
  959. <listitem><para>
  960. Plain <filename>Makefile</filename>
  961. </para></listitem>
  962. <listitem><para>
  963. Out-of-tree kernel module
  964. </para></listitem>
  965. <listitem><para>
  966. Binary package (i.e. "-b" option)
  967. </para></listitem>
  968. <listitem><para>
  969. Node.js module
  970. </para></listitem>
  971. <listitem><para>
  972. Python modules that use <filename>setuptools</filename>
  973. or <filename>distutils</filename>
  974. </para></listitem>
  975. </itemizedlist>
  976. </para>
  977. <para>
  978. Apart from binary packages, the determination of how a source tree
  979. should be treated is automatic based on the files present within
  980. that source tree.
  981. For example, if a <filename>CMakeLists.txt</filename> file is found,
  982. then the source tree is assumed to be using
  983. CMake and is treated accordingly.
  984. <note>
  985. In most cases, you need to edit the automatically generated
  986. recipe in order to make it build properly.
  987. Typically, you would go through several edit and build cycles
  988. until the recipe successfully builds.
  989. Once the recipe builds, you could use possible further
  990. iterations to test the recipe on the target device.
  991. </note>
  992. </para>
  993. <para>
  994. The remainder of this section covers specifics regarding how parts
  995. of the recipe are generated.
  996. </para>
  997. <section id='sdk-name-and-version'>
  998. <title>Name and Version</title>
  999. <para>
  1000. If you do not specify a name and version on the command
  1001. line, <filename>devtool add</filename> uses various metadata
  1002. within the source tree in an attempt to determine
  1003. the name and version of the software being built.
  1004. Based on what the tool determines, <filename>devtool</filename>
  1005. sets the name of the created recipe file accordingly.
  1006. </para>
  1007. <para>
  1008. If <filename>devtool</filename> cannot determine the name and
  1009. version, the command prints an error.
  1010. For such cases, you must re-run the command and provide
  1011. the name and version, just the name, or just the version as
  1012. part of the command line.
  1013. </para>
  1014. <para>
  1015. Sometimes the name or version determined from the source tree
  1016. might be incorrect.
  1017. For such a case, you must reset the recipe:
  1018. <literallayout class='monospaced'>
  1019. $ devtool reset -n <replaceable>recipename</replaceable>
  1020. </literallayout>
  1021. After running the <filename>devtool reset</filename> command,
  1022. you need to run <filename>devtool add</filename> again and
  1023. provide the name or the version.
  1024. </para>
  1025. </section>
  1026. <section id='sdk-dependency-detection-and-mapping'>
  1027. <title>Dependency Detection and Mapping</title>
  1028. <para>
  1029. The <filename>devtool add</filename> command attempts to
  1030. detect build-time dependencies and map them to other recipes
  1031. in the system.
  1032. During this mapping, the command fills in the names of those
  1033. recipes as part of the
  1034. <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
  1035. variable within the recipe.
  1036. If a dependency cannot be mapped, <filename>devtool</filename>
  1037. places a comment in the recipe indicating such.
  1038. The inability to map a dependency can result from naming not
  1039. being recognized or because the dependency simply is not
  1040. available.
  1041. For cases where the dependency is not available, you must use
  1042. the <filename>devtool add</filename> command to add an
  1043. additional recipe that satisfies the dependency.
  1044. Once you add that recipe, you need to update the
  1045. <filename>DEPENDS</filename> variable in the original recipe
  1046. to include the new recipe.
  1047. </para>
  1048. <para>
  1049. If you need to add runtime dependencies, you can do so by
  1050. adding the following to your recipe:
  1051. <literallayout class='monospaced'>
  1052. RDEPENDS_${PN} += "<replaceable>dependency1 dependency2 ...</replaceable>"
  1053. </literallayout>
  1054. <note>
  1055. The <filename>devtool add</filename> command often cannot
  1056. distinguish between mandatory and optional dependencies.
  1057. Consequently, some of the detected dependencies might
  1058. in fact be optional.
  1059. When in doubt, consult the documentation or the configure
  1060. script for the software the recipe is building for further
  1061. details.
  1062. In some cases, you might find you can substitute the
  1063. dependency with an option that disables the associated
  1064. functionality passed to the configure script.
  1065. </note>
  1066. </para>
  1067. </section>
  1068. <section id='sdk-license-detection'>
  1069. <title>License Detection</title>
  1070. <para>
  1071. The <filename>devtool add</filename> command attempts to
  1072. determine if the software you are adding is able to be
  1073. distributed under a common, open-source license.
  1074. If so, the command sets the
  1075. <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE'><filename>LICENSE</filename></ulink>
  1076. value accordingly.
  1077. You should double-check the value added by the command against
  1078. the documentation or source files for the software you are
  1079. building and, if necessary, update that
  1080. <filename>LICENSE</filename> value.
  1081. </para>
  1082. <para>
  1083. The <filename>devtool add</filename> command also sets the
  1084. <ulink url='&YOCTO_DOCS_REF_URL;#var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></ulink>
  1085. value to point to all files that appear to be license-related.
  1086. Realize that license statements often appear in comments at
  1087. the top of source files or within the documentation.
  1088. In such cases, the command does not recognize those license
  1089. statements.
  1090. Consequently, you might need to amend the
  1091. <filename>LIC_FILES_CHKSUM</filename> variable to point to one
  1092. or more of those comments if present.
  1093. Setting <filename>LIC_FILES_CHKSUM</filename> is particularly
  1094. important for third-party software.
  1095. The mechanism attempts to ensure correct licensing should you
  1096. upgrade the recipe to a newer upstream version in future.
  1097. Any change in licensing is detected and you receive an error
  1098. prompting you to check the license text again.
  1099. </para>
  1100. <para>
  1101. If the <filename>devtool add</filename> command cannot
  1102. determine licensing information, <filename>devtool</filename>
  1103. sets the <filename>LICENSE</filename> value to "CLOSED" and
  1104. leaves the <filename>LIC_FILES_CHKSUM</filename> value unset.
  1105. This behavior allows you to continue with development even
  1106. though the settings are unlikely to be correct in all cases.
  1107. You should check the documentation or source files for the
  1108. software you are building to determine the actual license.
  1109. </para>
  1110. </section>
  1111. <section id='sdk-adding-makefile-only-software'>
  1112. <title>Adding Makefile-Only Software</title>
  1113. <para>
  1114. The use of Make by itself is very common in both proprietary
  1115. and open-source software.
  1116. Unfortunately, Makefiles are often not written with
  1117. cross-compilation in mind.
  1118. Thus, <filename>devtool add</filename> often cannot do very
  1119. much to ensure that these Makefiles build correctly.
  1120. It is very common, for example, to explicitly call
  1121. <filename>gcc</filename> instead of using the
  1122. <ulink url='&YOCTO_DOCS_REF_URL;#var-CC'><filename>CC</filename></ulink>
  1123. variable.
  1124. Usually, in a cross-compilation environment,
  1125. <filename>gcc</filename> is the compiler for the build host
  1126. and the cross-compiler is named something similar to
  1127. <filename>arm-poky-linux-gnueabi-gcc</filename> and might
  1128. require arguments (e.g. to point to the associated sysroot
  1129. for the target machine).
  1130. </para>
  1131. <para>
  1132. When writing a recipe for Makefile-only software, keep the
  1133. following in mind:
  1134. <itemizedlist>
  1135. <listitem><para>
  1136. You probably need to patch the Makefile to use
  1137. variables instead of hardcoding tools within the
  1138. toolchain such as <filename>gcc</filename> and
  1139. <filename>g++</filename>.
  1140. </para></listitem>
  1141. <listitem><para>
  1142. The environment in which Make runs is set up with
  1143. various standard variables for compilation (e.g.
  1144. <filename>CC</filename>, <filename>CXX</filename>, and
  1145. so forth) in a similar manner to the environment set
  1146. up by the SDK's environment setup script.
  1147. One easy way to see these variables is to run the
  1148. <filename>devtool build</filename> command on the
  1149. recipe and then look in
  1150. <filename>oe-logs/run.do_compile</filename>.
  1151. Towards the top of this file, a list of environment
  1152. variables exists that are being set.
  1153. You can take advantage of these variables within the
  1154. Makefile.
  1155. </para></listitem>
  1156. <listitem><para>
  1157. If the Makefile sets a default for a variable using "=",
  1158. that default overrides the value set in the environment,
  1159. which is usually not desirable.
  1160. For this case, you can either patch the Makefile
  1161. so it sets the default using the "?=" operator, or
  1162. you can alternatively force the value on the
  1163. <filename>make</filename> command line.
  1164. To force the value on the command line, add the
  1165. variable setting to
  1166. <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OEMAKE'><filename>EXTRA_OEMAKE</filename></ulink>
  1167. or
  1168. <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink>
  1169. within the recipe.
  1170. Here is an example using <filename>EXTRA_OEMAKE</filename>:
  1171. <literallayout class='monospaced'>
  1172. EXTRA_OEMAKE += "'CC=${CC}' 'CXX=${CXX}'"
  1173. </literallayout>
  1174. In the above example, single quotes are used around the
  1175. variable settings as the values are likely to contain
  1176. spaces because required default options are passed to
  1177. the compiler.
  1178. </para></listitem>
  1179. <listitem><para>
  1180. Hardcoding paths inside Makefiles is often problematic
  1181. in a cross-compilation environment.
  1182. This is particularly true because those hardcoded paths
  1183. often point to locations on the build host and thus
  1184. will either be read-only or will introduce
  1185. contamination into the cross-compilation because they
  1186. are specific to the build host rather than the target.
  1187. Patching the Makefile to use prefix variables or other
  1188. path variables is usually the way to handle this
  1189. situation.
  1190. </para></listitem>
  1191. <listitem><para>
  1192. Sometimes a Makefile runs target-specific commands such
  1193. as <filename>ldconfig</filename>.
  1194. For such cases, you might be able to apply patches that
  1195. remove these commands from the Makefile.
  1196. </para></listitem>
  1197. </itemizedlist>
  1198. </para>
  1199. </section>
  1200. <section id='sdk-adding-native-tools'>
  1201. <title>Adding Native Tools</title>
  1202. <para>
  1203. Often, you need to build additional tools that run on the
  1204. <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>
  1205. as opposed to the target.
  1206. You should indicate this requirement by using one of the
  1207. following methods when you run
  1208. <filename>devtool add</filename>:
  1209. <itemizedlist>
  1210. <listitem><para>
  1211. Specify the name of the recipe such that it ends
  1212. with "-native".
  1213. Specifying the name like this produces a recipe that
  1214. only builds for the build host.
  1215. </para></listitem>
  1216. <listitem><para>
  1217. Specify the "&dash;&dash;also-native" option with the
  1218. <filename>devtool add</filename> command.
  1219. Specifying this option creates a recipe file that still
  1220. builds for the target but also creates a variant with
  1221. a "-native" suffix that builds for the build host.
  1222. </para></listitem>
  1223. </itemizedlist>
  1224. <note>
  1225. If you need to add a tool that is shipped as part of a
  1226. source tree that builds code for the target, you can
  1227. typically accomplish this by building the native and target
  1228. parts separately rather than within the same compilation
  1229. process.
  1230. Realize though that with the "&dash;&dash;also-native"
  1231. option, you can add the tool using just one recipe file.
  1232. </note>
  1233. </para>
  1234. </section>
  1235. <section id='sdk-adding-node-js-modules'>
  1236. <title>Adding Node.js Modules</title>
  1237. <para>
  1238. You can use the <filename>devtool add</filename> command two
  1239. different ways to add Node.js modules: 1) Through
  1240. <filename>npm</filename> and, 2) from a repository or local
  1241. source.
  1242. </para>
  1243. <para>
  1244. Use the following form to add Node.js modules through
  1245. <filename>npm</filename>:
  1246. <literallayout class='monospaced'>
  1247. $ devtool add "npm://registry.npmjs.org;name=forever;version=0.15.1"
  1248. </literallayout>
  1249. The name and version parameters are mandatory.
  1250. Lockdown and shrinkwrap files are generated and pointed to by
  1251. the recipe in order to freeze the version that is fetched for
  1252. the dependencies according to the first time.
  1253. This also saves checksums that are verified on future fetches.
  1254. Together, these behaviors ensure the reproducibility and
  1255. integrity of the build.
  1256. <note><title>Notes</title>
  1257. <itemizedlist>
  1258. <listitem><para>
  1259. You must use quotes around the URL.
  1260. The <filename>devtool add</filename> does not require
  1261. the quotes, but the shell considers ";" as a splitter
  1262. between multiple commands.
  1263. Thus, without the quotes,
  1264. <filename>devtool add</filename> does not receive the
  1265. other parts, which results in several "command not
  1266. found" errors.
  1267. </para></listitem>
  1268. <listitem><para>
  1269. In order to support adding Node.js modules, a
  1270. <filename>nodejs</filename> recipe must be part
  1271. of your SDK.
  1272. </para></listitem>
  1273. </itemizedlist>
  1274. </note>
  1275. </para>
  1276. <para>
  1277. As mentioned earlier, you can also add Node.js modules
  1278. directly from a repository or local source tree.
  1279. To add modules this way, use <filename>devtool add</filename>
  1280. in the following form:
  1281. <literallayout class='monospaced'>
  1282. $ devtool add https://github.com/diversario/node-ssdp
  1283. </literallayout>
  1284. In this example, <filename>devtool</filename> fetches the
  1285. specified Git repository, detects the code as Node.js
  1286. code, fetches dependencies using <filename>npm</filename>, and
  1287. sets
  1288. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
  1289. accordingly.
  1290. </para>
  1291. </section>
  1292. </section>
  1293. <section id='sdk-working-with-recipes'>
  1294. <title>Working With Recipes</title>
  1295. <para>
  1296. When building a recipe using the
  1297. <filename>devtool build</filename> command, the typical build
  1298. progresses as follows:
  1299. <orderedlist>
  1300. <listitem><para>
  1301. Fetch the source
  1302. </para></listitem>
  1303. <listitem><para>
  1304. Unpack the source
  1305. </para></listitem>
  1306. <listitem><para>
  1307. Configure the source
  1308. </para></listitem>
  1309. <listitem><para>
  1310. Compile the source
  1311. </para></listitem>
  1312. <listitem><para>
  1313. Install the build output
  1314. </para></listitem>
  1315. <listitem><para>
  1316. Package the installed output
  1317. </para></listitem>
  1318. </orderedlist>
  1319. For recipes in the workspace, fetching and unpacking is disabled
  1320. as the source tree has already been prepared and is persistent.
  1321. Each of these build steps is defined as a function (task), usually
  1322. with a "do_" prefix (e.g.
  1323. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>,
  1324. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink>,
  1325. and so forth).
  1326. These functions are typically shell scripts but can instead be
  1327. written in Python.
  1328. </para>
  1329. <para>
  1330. If you look at the contents of a recipe, you will see that the
  1331. recipe does not include complete instructions for building the
  1332. software.
  1333. Instead, common functionality is encapsulated in classes inherited
  1334. with the <filename>inherit</filename> directive.
  1335. This technique leaves the recipe to describe just the things that
  1336. are specific to the software being built.
  1337. A
  1338. <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-base'><filename>base</filename></ulink>
  1339. class exists that is implicitly inherited by all recipes and
  1340. provides the functionality that most recipes typically need.
  1341. </para>
  1342. <para>
  1343. The remainder of this section presents information useful when
  1344. working with recipes.
  1345. </para>
  1346. <section id='sdk-finding-logs-and-work-files'>
  1347. <title>Finding Logs and Work Files</title>
  1348. <para>
  1349. After the first run of the <filename>devtool build</filename>
  1350. command, recipes that were previously created using the
  1351. <filename>devtool add</filename> command or whose sources were
  1352. modified using the <filename>devtool modify</filename>
  1353. command contain symbolic links created within the source tree:
  1354. <itemizedlist>
  1355. <listitem><para>
  1356. <filename>oe-logs</filename>:
  1357. This link points to the directory in which log files
  1358. and run scripts for each build step are created.
  1359. </para></listitem>
  1360. <listitem><para>
  1361. <filename>oe-workdir</filename>:
  1362. This link points to the temporary work area for the
  1363. recipe.
  1364. The following locations under
  1365. <filename>oe-workdir</filename> are particularly
  1366. useful:
  1367. <itemizedlist>
  1368. <listitem><para>
  1369. <filename>image/</filename>:
  1370. Contains all of the files installed during
  1371. the
  1372. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
  1373. stage.
  1374. Within a recipe, this directory is referred
  1375. to by the expression
  1376. <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink><filename>}</filename>.
  1377. </para></listitem>
  1378. <listitem><para>
  1379. <filename>sysroot-destdir/</filename>:
  1380. Contains a subset of files installed within
  1381. <filename>do_install</filename> that have
  1382. been put into the shared sysroot.
  1383. For more information, see the
  1384. "<link linkend='sdk-sharing-files-between-recipes'>Sharing Files Between Recipes</link>"
  1385. section.
  1386. </para></listitem>
  1387. <listitem><para>
  1388. <filename>packages-split/</filename>:
  1389. Contains subdirectories for each package
  1390. produced by the recipe.
  1391. For more information, see the
  1392. "<link linkend='sdk-packaging'>Packaging</link>"
  1393. section.
  1394. </para></listitem>
  1395. </itemizedlist>
  1396. </para></listitem>
  1397. </itemizedlist>
  1398. You can use these links to get more information on what is
  1399. happening at each build step.
  1400. </para>
  1401. </section>
  1402. <section id='sdk-setting-configure-arguments'>
  1403. <title>Setting Configure Arguments</title>
  1404. <para>
  1405. If the software your recipe is building uses GNU autoconf,
  1406. then a fixed set of arguments is passed to it to enable
  1407. cross-compilation plus any extras specified by
  1408. <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></ulink>
  1409. or
  1410. <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink>
  1411. set within the recipe.
  1412. If you wish to pass additional options, add them to
  1413. <filename>EXTRA_OECONF</filename> or
  1414. <filename>PACKAGECONFIG_CONFARGS</filename>.
  1415. Other supported build tools have similar variables
  1416. (e.g.
  1417. <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECMAKE'><filename>EXTRA_OECMAKE</filename></ulink>
  1418. for CMake,
  1419. <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OESCONS'><filename>EXTRA_OESCONS</filename></ulink>
  1420. for Scons, and so forth).
  1421. If you need to pass anything on the <filename>make</filename>
  1422. command line, you can use <filename>EXTRA_OEMAKE</filename> or the
  1423. <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink>
  1424. variables to do so.
  1425. </para>
  1426. <para>
  1427. You can use the <filename>devtool configure-help</filename> command
  1428. to help you set the arguments listed in the previous paragraph.
  1429. The command determines the exact options being passed, and shows
  1430. them to you along with any custom arguments specified through
  1431. <filename>EXTRA_OECONF</filename> or
  1432. <filename>PACKAGECONFIG_CONFARGS</filename>.
  1433. If applicable, the command also shows you the output of the
  1434. configure script's "&dash;&dash;help" option as a reference.
  1435. </para>
  1436. </section>
  1437. <section id='sdk-sharing-files-between-recipes'>
  1438. <title>Sharing Files Between Recipes</title>
  1439. <para>
  1440. Recipes often need to use files provided by other recipes on
  1441. the
  1442. <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>.
  1443. For example, an application linking to a common library needs
  1444. access to the library itself and its associated headers.
  1445. The way this access is accomplished within the extensible SDK is
  1446. through the sysroot.
  1447. One sysroot exists per "machine" for which the SDK is being
  1448. built.
  1449. In practical terms, this means a sysroot exists for the target
  1450. machine, and a sysroot exists for the build host.
  1451. </para>
  1452. <para>
  1453. Recipes should never write files directly into the sysroot.
  1454. Instead, files should be installed into standard locations
  1455. during the
  1456. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
  1457. task within the
  1458. <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink><filename>}</filename>
  1459. directory.
  1460. A subset of these files automatically goes into the sysroot.
  1461. The reason for this limitation is that almost all files that go
  1462. into the sysroot are cataloged in manifests in order to ensure
  1463. they can be removed later when a recipe is modified or removed.
  1464. Thus, the sysroot is able to remain free from stale files.
  1465. </para>
  1466. </section>
  1467. <section id='sdk-packaging'>
  1468. <title>Packaging</title>
  1469. <para>
  1470. Packaging is not always particularly relevant within the
  1471. extensible SDK.
  1472. However, if you examine how build output gets into the final image
  1473. on the target device, it is important to understand packaging
  1474. because the contents of the image are expressed in terms of
  1475. packages and not recipes.
  1476. </para>
  1477. <para>
  1478. During the
  1479. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package'><filename>do_package</filename></ulink>
  1480. task, files installed during the
  1481. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
  1482. task are split into one main package, which is almost always
  1483. named the same as the recipe, and into several other packages.
  1484. This separation exists because not all of those installed files
  1485. are useful in every image.
  1486. For example, you probably do not need any of the documentation
  1487. installed in a production image.
  1488. Consequently, for each recipe the documentation files are
  1489. separated into a <filename>-doc</filename> package.
  1490. Recipes that package software containing optional modules or
  1491. plugins might undergo additional package splitting as well.
  1492. </para>
  1493. <para>
  1494. After building a recipe, you can see where files have gone by
  1495. looking in the <filename>oe-workdir/packages-split</filename>
  1496. directory, which contains a subdirectory for each package.
  1497. Apart from some advanced cases, the
  1498. <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink>
  1499. and
  1500. <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink>
  1501. variables controls splitting.
  1502. The <filename>PACKAGES</filename> variable lists all of the
  1503. packages to be produced, while the <filename>FILES</filename>
  1504. variable specifies which files to include in each package by
  1505. using an override to specify the package.
  1506. For example, <filename>FILES_${PN}</filename> specifies the
  1507. files to go into the main package (i.e. the main package has
  1508. the same name as the recipe and
  1509. <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>
  1510. evaluates to the recipe name).
  1511. The order of the <filename>PACKAGES</filename> value is
  1512. significant.
  1513. For each installed file, the first package whose
  1514. <filename>FILES</filename> value matches the file is the
  1515. package into which the file goes.
  1516. Defaults exist for both the <filename>PACKAGES</filename> and
  1517. <filename>FILES</filename> variables.
  1518. Consequently, you might find you do not even need to set these
  1519. variables in your recipe unless the software the recipe is
  1520. building installs files into non-standard locations.
  1521. </para>
  1522. </section>
  1523. </section>
  1524. <section id='sdk-restoring-the-target-device-to-its-original-state'>
  1525. <title>Restoring the Target Device to its Original State</title>
  1526. <para>
  1527. If you use the <filename>devtool deploy-target</filename>
  1528. command to write a recipe's build output to the target, and
  1529. you are working on an existing component of the system, then you
  1530. might find yourself in a situation where you need to restore the
  1531. original files that existed prior to running the
  1532. <filename>devtool deploy-target</filename> command.
  1533. Because the <filename>devtool deploy-target</filename> command
  1534. backs up any files it overwrites, you can use the
  1535. <filename>devtool undeploy-target</filename> command to restore
  1536. those files and remove any other files the recipe deployed.
  1537. Consider the following example:
  1538. <literallayout class='monospaced'>
  1539. $ devtool undeploy-target lighttpd root@192.168.7.2
  1540. </literallayout>
  1541. If you have deployed multiple applications, you can remove them
  1542. all using the "-a" option thus restoring the target device to its
  1543. original state:
  1544. <literallayout class='monospaced'>
  1545. $ devtool undeploy-target -a root@192.168.7.2
  1546. </literallayout>
  1547. Information about files deployed to the target as well as any
  1548. backed up files are stored on the target itself.
  1549. This storage, of course, requires some additional space
  1550. on the target machine.
  1551. <note>
  1552. The <filename>devtool deploy-target</filename> and
  1553. <filename>devtool undeploy-target</filename> commands do not
  1554. currently interact with any package management system on the
  1555. target device (e.g. RPM or OPKG).
  1556. Consequently, you should not intermingle
  1557. <filename>devtool deploy-target</filename> and package
  1558. manager operations on the target device.
  1559. Doing so could result in a conflicting set of files.
  1560. </note>
  1561. </para>
  1562. </section>
  1563. <section id='sdk-installing-additional-items-into-the-extensible-sdk'>
  1564. <title>Installing Additional Items Into the Extensible SDK</title>
  1565. <para>
  1566. Out of the box the extensible SDK typically only comes with a small
  1567. number of tools and libraries.
  1568. A minimal SDK starts mostly empty and is populated on-demand.
  1569. Sometimes you must explicitly install extra items into the SDK.
  1570. If you need these extra items, you can first search for the items
  1571. using the <filename>devtool search</filename> command.
  1572. For example, suppose you need to link to libGL but you are not sure
  1573. which recipe provides libGL.
  1574. You can use the following command to find out:
  1575. <literallayout class='monospaced'>
  1576. $ devtool search libGL
  1577. mesa A free implementation of the OpenGL API
  1578. </literallayout>
  1579. Once you know the recipe (i.e. <filename>mesa</filename> in this
  1580. example), you can install it:
  1581. <literallayout class='monospaced'>
  1582. $ devtool sdk-install mesa
  1583. </literallayout>
  1584. By default, the <filename>devtool sdk-install</filename> command
  1585. assumes the item is available in pre-built form from your SDK
  1586. provider.
  1587. If the item is not available and it is acceptable to build the item
  1588. from source, you can add the "-s" option as follows:
  1589. <literallayout class='monospaced'>
  1590. $ devtool sdk-install -s mesa
  1591. </literallayout>
  1592. It is important to remember that building the item from source
  1593. takes significantly longer than installing the pre-built artifact.
  1594. Also, if no recipe exists for the item you want to add to the SDK,
  1595. you must instead add the item using the
  1596. <filename>devtool add</filename> command.
  1597. </para>
  1598. </section>
  1599. <section id='sdk-applying-updates-to-an-installed-extensible-sdk'>
  1600. <title>Applying Updates to an Installed Extensible SDK</title>
  1601. <para>
  1602. If you are working with an installed extensible SDK that gets
  1603. occasionally updated (e.g. a third-party SDK), then you will need
  1604. to manually "pull down" the updates into the installed SDK.
  1605. </para>
  1606. <para>
  1607. To update your installed SDK, use <filename>devtool</filename> as
  1608. follows:
  1609. <literallayout class='monospaced'>
  1610. $ devtool sdk-update
  1611. </literallayout>
  1612. The previous command assumes your SDK provider has set the default
  1613. update URL for you through the
  1614. <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_UPDATE_URL'><filename>SDK_UPDATE_URL</filename></ulink>
  1615. variable as described in the
  1616. "<link linkend='sdk-providing-updates-to-the-extensible-sdk-after-installation'>Providing Updates to the Extensible SDK After Installation</link>"
  1617. section.
  1618. If the SDK provider has not set that default URL, you need to
  1619. specify it yourself in the command as follows:
  1620. <literallayout class='monospaced'>
  1621. $ devtool sdk-update <replaceable>path_to_update_directory</replaceable>
  1622. </literallayout>
  1623. <note>
  1624. The URL needs to point specifically to a published SDK and
  1625. not to an SDK installer that you would download and install.
  1626. </note>
  1627. </para>
  1628. </section>
  1629. <section id='sdk-creating-a-derivative-sdk-with-additional-components'>
  1630. <title>Creating a Derivative SDK With Additional Components</title>
  1631. <para>
  1632. You might need to produce an SDK that contains your own custom
  1633. libraries.
  1634. A good example would be if you were a vendor with customers that
  1635. use your SDK to build their own platform-specific software and
  1636. those customers need an SDK that has custom libraries.
  1637. In such a case, you can produce a derivative SDK based on the
  1638. currently installed SDK fairly easily by following these steps:
  1639. <orderedlist>
  1640. <listitem><para>
  1641. If necessary, install an extensible SDK that
  1642. you want to use as a base for your derivative SDK.
  1643. </para></listitem>
  1644. <listitem><para>
  1645. Source the environment script for the SDK.
  1646. </para></listitem>
  1647. <listitem><para>
  1648. Add the extra libraries or other components you want by
  1649. using the <filename>devtool add</filename> command.
  1650. </para></listitem>
  1651. <listitem><para>
  1652. Run the <filename>devtool build-sdk</filename> command.
  1653. </para></listitem>
  1654. </orderedlist>
  1655. The previous steps take the recipes added to the workspace and
  1656. construct a new SDK installer that contains those recipes and the
  1657. resulting binary artifacts.
  1658. The recipes go into their own separate layer in the constructed
  1659. derivative SDK, which leaves the workspace clean and ready for
  1660. users to add their own recipes.
  1661. </para>
  1662. </section>
  1663. </chapter>
  1664. <!--
  1665. vim: expandtab tw=80 ts=4
  1666. -->