toaster-manual-reference.xml 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052
  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='toaster-manual-reference'>
  5. <title>Concepts and Reference</title>
  6. <para>
  7. In order to configure and use Toaster, you should understand some
  8. concepts and have some basic command reference material available.
  9. This final chapter provides conceptual information on layer sources,
  10. releases, and JSON configuration files.
  11. Also provided is a quick look at some useful
  12. <filename>manage.py</filename> commands that are Toaster-specific.
  13. Information on <filename>manage.py</filename> commands does exist
  14. across the Web and the information in this manual by no means
  15. attempts to provide a command comprehensive reference.
  16. </para>
  17. <section id='layer-source'>
  18. <title>Layer Source</title>
  19. <para>
  20. In general, a "layer source" is a source of information about
  21. existing layers.
  22. In particular, we are concerned with layers that you can use
  23. with the Yocto Project and Toaster.
  24. This chapter describes a particular type of layer source called
  25. a "layer index."
  26. </para>
  27. <para>
  28. A layer index is a web application that contains information
  29. about a set of custom layers.
  30. A good example of an existing layer index is the
  31. OpenEmbedded Metadata Index.
  32. A public instance of this layer index exists at
  33. <ulink url='http://layers.openembedded.org'></ulink>.
  34. You can find the code for this layer index's web application at
  35. <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/'></ulink>.
  36. </para>
  37. <para>
  38. When you tie a layer source into Toaster, it can query the layer
  39. source through a
  40. <ulink url='http://en.wikipedia.org/wiki/Representational_state_transfer'>REST</ulink>
  41. API, store the information about the layers in the Toaster
  42. database, and then show the information to users.
  43. Users are then able to view that information and build layers
  44. from Toaster itself without worrying about cloning or editing
  45. the BitBake layers configuration file
  46. <filename>bblayers.conf</filename>.
  47. </para>
  48. <para>
  49. Tying a layer source into Toaster is convenient when you have
  50. many custom layers that need to be built on a regular basis by
  51. a community of developers.
  52. In fact, Toaster comes pre-configured with the OpenEmbedded
  53. Metadata Index.
  54. <note>
  55. You do not have to use a layer source to use Toaster.
  56. Tying into a layer source is optional.
  57. </note>
  58. </para>
  59. <section id='layer-source-using-with-toaster'>
  60. <title>Setting Up and Using a Layer Source</title>
  61. <para>
  62. To use your own layer source, you need to set up the layer
  63. source and then tie it into Toaster.
  64. This section describes how to tie into a layer index in a manner
  65. similar to the way Toaster ties into the OpenEmbedded Metadata
  66. Index.
  67. </para>
  68. <section id='understanding-your-layers'>
  69. <title>Understanding Your Layers</title>
  70. <para>
  71. The obvious first step for using a layer index is to have
  72. several custom layers that developers build and access using
  73. the Yocto Project on a regular basis.
  74. This set of layers needs to exist and you need to be
  75. familiar with where they reside.
  76. You will need that information when you set up the
  77. code for the web application that "hooks" into your set of
  78. layers.
  79. </para>
  80. <para>
  81. For general information on layers, see the
  82. "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
  83. and
  84. "<ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>Using the Yocto Project's BSP Tools</ulink>"
  85. sections in the Yocto Project Board Support Package (BSP)
  86. Developer's Guide.
  87. </para>
  88. </section>
  89. <section id='configuring-toaster-to-hook-into-your-layer-source'>
  90. <title>Configuring Toaster to Hook Into Your Layer Index</title>
  91. <para>
  92. If you want Toaster to use your layer index, you must host
  93. the web application in a server to which Toaster can
  94. connect.
  95. You also need to give Toaster the information about your
  96. layer index.
  97. In other words, you have to configure Toaster to use your
  98. layer index.
  99. This section describes two methods by which you can
  100. configure and use your layer index.
  101. </para>
  102. <para>
  103. In the previous section, the code for the OpenEmbedded
  104. Metadata Index (i.e.
  105. <ulink url='http://layers.openembedded.org'></ulink>) was
  106. referenced.
  107. You can use this code, which is at
  108. <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/'></ulink>,
  109. as a base to create your own layer index.
  110. </para>
  111. <section id='use-the-administration-interface'>
  112. <title>Use the Administration Interface</title>
  113. <para>
  114. Access the administration interface through a
  115. browser by entering the URL of your Toaster instance and
  116. adding "<filename>/admin</filename>" to the end of the
  117. URL.
  118. As an example, if you are running Toaster locally, use
  119. the following URL:
  120. <literallayout class='monospaced'>
  121. http://127.0.0.1:8000/admin
  122. </literallayout>
  123. </para>
  124. <para>
  125. The administration interface has a "Layer sources"
  126. section that includes an "Add layer source" button.
  127. Click that button and provide the required information.
  128. Make sure you select "layerindex" as the layer source type.
  129. </para>
  130. </section>
  131. <section id='select-the-toasterconf-json-file'>
  132. <title>Use the <filename>toasterconf.json</filename> File</title>
  133. <para>
  134. If you do not want to use the Administration
  135. Interface, you can edit the
  136. <link linkend='toaster-json-files'><filename>toasterconf.json</filename></link>
  137. file and reload it to Toaster.
  138. </para>
  139. <para>
  140. The Toaster startup script in
  141. <filename>/bitbake/bin/toaster</filename> specifies
  142. the location of a Toaster configuration file
  143. <filename>toasterconf.json</filename> as the value of
  144. the <filename>TOASTER_CONF</filename> variable.
  145. This configuration file is used to set up the initial
  146. configuration values within the Toaster database
  147. including the layer sources.
  148. Two versions of the configuration file exist:
  149. <itemizedlist>
  150. <listitem><para>
  151. The first version of the file is found in the
  152. <filename>conf</filename> directory of the
  153. <filename>meta-poky</filename> layer
  154. (i.e.
  155. <filename>meta-poky/conf/toasterconf.json</filename>).
  156. This version contains the default Yocto Project
  157. configuration for Toaster.
  158. </para></listitem>
  159. <listitem><para>
  160. The second version of the file is in the
  161. <filename>conf</filename> directory of the
  162. <filename>openembedded-core</filename> layer
  163. (i.e. <filename>meta/conf/toasterconf.json</filename>).
  164. This version contains the default OpenEmbedded
  165. configuration for Toaster.
  166. </para></listitem>
  167. </itemizedlist>
  168. </para>
  169. </section>
  170. <section id='edit-the-configuration-file'>
  171. <title>Edit the Configuration File</title>
  172. <para>
  173. Edit the version of the
  174. <filename>toasterconf.json</filename> file you
  175. used to set up your Toaster instance.
  176. In the file, you will find a section for layer sources
  177. such as the following:
  178. <literallayout class='monospaced'>
  179. "layersources": [
  180. {
  181. "name": "Local Yocto Project",
  182. "sourcetype": "local",
  183. "apiurl": "../../",
  184. "branches": ["HEAD" ],
  185. "layers": [
  186. {
  187. "name": "openembedded-core",
  188. "local_path": "meta",
  189. "vcs_url": "remote:origin",
  190. "dirpath": "meta"
  191. },
  192. {
  193. "name": "meta-poky",
  194. "local_path": "meta-poky",
  195. "vcs_url": "remote:origin",
  196. "dirpath": "meta-poky"
  197. },
  198. {
  199. "name": "meta-yocto-bsp",
  200. "local_path": "meta-yocto-bsp",
  201. "vcs_url": "remote:origin",
  202. "dirpath": "meta-yocto-bsp"
  203. }
  204. ]
  205. },
  206. {
  207. "name": "OpenEmbedded",
  208. "sourcetype": "layerindex",
  209. "apiurl": "http://layers.openembedded.org/layerindex/api/",
  210. "branches": ["master", "jethro" ,"fido"]
  211. },
  212. {
  213. "name": "Imported layers",
  214. "sourcetype": "imported",
  215. "apiurl": "",
  216. "branches": ["master", "jethro","fido", "HEAD"]
  217. }
  218. ],
  219. </literallayout>
  220. You should add your own layer source to this section by
  221. following the same format used for the "OpenEmbedded"
  222. layer source shown above.
  223. </para>
  224. <para>
  225. Give your layer source a name, provide the URL of your
  226. layer source API, use the source type "layerindex", and
  227. indicate which branches from your layer source you want
  228. to make available through Toaster.
  229. For example, the OpenEmbedded layer source makes
  230. available only its "master", "fido", and "jethro"
  231. branches.
  232. </para>
  233. <para>
  234. The branches must match the branch you
  235. set when configuring your releases.
  236. For example, if you configure one release in Toaster
  237. by setting its branch to "branch-one" and you configure
  238. another release in Toaster by setting its branch to
  239. "branch-two", the branches in your layer source should
  240. be "branch-one" and "branch-two" as well.
  241. Doing so creates a connection between the releases
  242. and the layer information from your layer source.
  243. Thus, when users create a project with a given
  244. release, they will see the appropriate layers from
  245. your layer source.
  246. This connection ensures that only layers that are
  247. compatible with the selected project release can be
  248. selected for building.
  249. </para>
  250. <para>
  251. Once you have added this information to the
  252. <filename>toasterconf.json</filename> file, save your
  253. changes.
  254. </para>
  255. <para>
  256. In a terminal window, navigate to the directory that
  257. contains the Toaster database, which by default is the
  258. root of the Yocto Project
  259. <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
  260. Once you are located in that directory, run the
  261. "<filename>loadconf</filename>" command, which takes as
  262. an argument the full path to the
  263. <filename>toasterconf.json</filename> file you just edited.
  264. For example, if you cloned the
  265. <filename>poky</filename> repository and you edited the
  266. <filename>meta-poky/conf/toasterconf.json</filename> file,
  267. you would type something like the following:
  268. <literallayout class='monospaced'>
  269. $ bitbake/lib/toaster/manage.py loadconf /home/scottrif/poky/meta-poky/conf/toasterconf.json
  270. </literallayout>
  271. After entering this command, you need to update the
  272. Toaster database with the information coming from your
  273. new layer source.
  274. To do that, you should run the
  275. "<filename>lsupdates</filename>" command from the directory
  276. that contains the Toaster database.
  277. Here is an example:
  278. <literallayout class='monospaced'>
  279. $ bitbake/lib/toaster/manage.py lsupdates
  280. </literallayout>
  281. If Toaster can reach the API URL, you should see a message
  282. telling you that Toaster is updating the layer source
  283. information.
  284. </para>
  285. <para>
  286. Once the information has been updated, verify the new layer
  287. information is available by using the Toaster web interface.
  288. To do that, visit the "All compatible layers" page inside a
  289. Toaster project.
  290. The layers from your layer source should be listed there.
  291. </para>
  292. </section>
  293. </section>
  294. </section>
  295. </section>
  296. <section id='toaster-releases'>
  297. <title>Releases</title>
  298. <para>
  299. When you create a Toaster project using the web interface,
  300. you are asked to choose a "Release."
  301. In the context of Toaster, the term "Release" refers to a set of
  302. layers and a BitBake version the OpenEmbedded build system uses
  303. to build something.
  304. As shipped, Toaster is pre-configured with releases that
  305. correspond to Yocto Project release branches.
  306. However, you can modify, delete, and create new releases
  307. according to your needs.
  308. This section provides some background information on releases.
  309. </para>
  310. <section id='toaster-releases-supported'>
  311. <title>Pre-Configured Releases</title>
  312. <para>
  313. As shipped, Toaster is configured to use a specific set of
  314. releases.
  315. Of course, you can always configure Toaster to use any
  316. release.
  317. For example, you might want your project to build against a
  318. specific commit of any of the "out-of-the-box" releases.
  319. Or, you might want your project to build against different
  320. revisions of OpenEmbedded and BitBake.
  321. </para>
  322. <para>
  323. As shipped, Toaster is configured to work with the following
  324. releases:
  325. <itemizedlist>
  326. <listitem><para><emphasis>Yocto Project 2.0 "Jethro" or OpenEmbedded "Jethro":</emphasis>
  327. This release causes your Toaster projects to
  328. build against the head of the jethro branch at
  329. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/log/?h=jethro'></ulink>
  330. or
  331. <ulink url='http://git.openembedded.org/openembedded-core/commit/?h=jethro'></ulink>.
  332. </para></listitem>
  333. <listitem><para><emphasis>Yocto Project 1.8 "Fido" or OpenEmbedded "Fido":</emphasis>
  334. This release causes your Toaster projects to
  335. build against the head of the fido branch at
  336. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/log/?h=fido'></ulink>
  337. or
  338. <ulink url='http://git.openembedded.org/openembedded-core/commit/?h=fido'></ulink>.
  339. </para></listitem>
  340. <listitem><para><emphasis>Yocto Project "Master" or OpenEmbedded "Master":</emphasis>
  341. This release causes your Toaster Projects to
  342. build against the head of the master branch, which is
  343. where active development takes place, at
  344. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/log/'></ulink>
  345. or
  346. <ulink url='http://git.openembedded.org/openembedded-core/log/'></ulink>.
  347. </para></listitem>
  348. <listitem><para><emphasis>Local Yocto Project or Local OpenEmbedded:</emphasis>
  349. This release causes your Toaster Projects to
  350. build against the head of the <filename>poky</filename>
  351. or <filename>openembedded-core</filename> clone you
  352. have local to the machine running Toaster.
  353. </para></listitem>
  354. </itemizedlist>
  355. </para>
  356. </section>
  357. <section id='toaster-releases-comprised-of'>
  358. <title>What Makes Up a Release?</title>
  359. <para>
  360. A release consists of the following:
  361. <itemizedlist>
  362. <listitem><para><emphasis>Name:</emphasis>
  363. The name of the release (<filename>name</filename>).
  364. This release name never appears in the the Toaster
  365. web interface.
  366. Consequently, a user never sees the release name.
  367. </para></listitem>
  368. <listitem><para><emphasis>Description:</emphasis>
  369. The textual description of the release
  370. (<filename>description</filename>).
  371. This description is what users encounter when creating
  372. projects with the Toaster web interface.
  373. When you configure your release, be sure to use
  374. a description that sufficiently describes and is
  375. understandable.
  376. If Toaster has more than one release configured, the
  377. release descriptions appear listed in a drop down menu
  378. when a user creates a new project.
  379. If Toaster has only one release configured, all
  380. projects created using the web interface take that
  381. release and the drop down menu does not display in the
  382. Toaster web interface.
  383. </para></listitem>
  384. <listitem><para><emphasis>BitBake:</emphasis>
  385. The Bitbake version (<filename>bitbake</filename>)
  386. used to build layers set in the current release.
  387. This version is described by a name, a Git URL, a
  388. branch in the Git URL, and a directory path in the
  389. Git repository.
  390. As an example, consider the following snippet from
  391. a Toaster JSON configuration file.
  392. This BitBake version uses the master branch from the
  393. OpenEmbedded repository:
  394. <literallayout class='monospaced'>
  395. "bitbake" : [
  396. {
  397. "name": "master",
  398. "giturl": "git://git.openembedded.org/bitbake",
  399. "branch": "master",
  400. "dirpath": ""
  401. }
  402. ]
  403. </literallayout>
  404. Here is more detail on each of the items that comprise
  405. the BitBake version:
  406. <itemizedlist>
  407. <listitem><para><emphasis>Name:</emphasis>
  408. A string
  409. (<filename>name</filename>) used to refer to
  410. the version of BitBake you are using with
  411. Toaster.
  412. This name is never exposed through Toaster.
  413. </para></listitem>
  414. <listitem><para><emphasis>Git URL:</emphasis>
  415. The URL (<filename>giturl</filename>)
  416. for the BitBake Git repository cloned
  417. for Toaster projects.
  418. </para></listitem>
  419. <listitem><para><emphasis>Branch:</emphasis>
  420. The Git branch, or revision,
  421. (<filename>branch</filename>) of the BitBake
  422. repository used with Toaster.
  423. </para></listitem>
  424. <listitem><para><emphasis>Directory Path:</emphasis>
  425. The sub-directory of the BitBake repository
  426. (<filename>dirpath</filename>).
  427. If the Git URL includes more than one
  428. repository, you need to set this directory.
  429. If the URL does not include more than a single
  430. repository, you can set
  431. <filename>dirpath</filename> to a null string
  432. (i.e. "").
  433. </para></listitem>
  434. </itemizedlist>
  435. </para></listitem>
  436. <listitem><para><emphasis>Branch:</emphasis>
  437. The branch for the layer source
  438. (<filename>branch</filename>) used with the release.
  439. For example, for the OpenEmbedded layer source, the
  440. "master", "fido", and "jethro" branches are available.
  441. </para></listitem>
  442. <listitem><para><emphasis>Default Layers:</emphasis>
  443. The set of default layers
  444. (<filename>defaultlayers</filename>) automatically
  445. added to the project configuration when a project is
  446. created.
  447. </para></listitem>
  448. <listitem><para><emphasis>Layer Source Priorities</emphasis>
  449. A specification of
  450. <link linkend='layer-source'>layer source</link>
  451. priorities (<filename>layersourcepriority</filename>).
  452. In order for Toaster to work as intended, the
  453. "Imported layers" layer source should have the highest
  454. priority, which means that layers manually imported by
  455. users with the "Import layer" functionality will
  456. always be visible and available for selection.
  457. </para></listitem>
  458. <listitem><para><emphasis>Help Text:</emphasis>
  459. Help text (<filename>helptext</filename>) that explains
  460. what the release does when selected.
  461. This help text appears below the release drop-down
  462. menu when you create a Toaster project.
  463. The help text should assist users in making the correct
  464. decision regarding the release to use for a given
  465. project.
  466. </para></listitem>
  467. </itemizedlist>
  468. </para>
  469. <para>
  470. To summarize what comprises a release, consider the following
  471. example from a Toaster JSON file.
  472. The configuration names the release "master" and uses the
  473. "master" branch provided by the layer source of type
  474. "layerindex", which is called "OpenEmbedded", and sets
  475. the <filename>openembedded-core</filename> layer as the one
  476. to be added by default to any projects created in Toaster.
  477. The BitBake version used would be defined as shown earlier
  478. in the previous list:
  479. <literallayout class='monospaced'>
  480. "releases": [
  481. {
  482. "name": "master",
  483. "description": "OpenEmbedded master",
  484. "bitbake": "master",
  485. "branch": "master",
  486. "defaultlayers": [ "openembedded-core" ],
  487. "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" : 0 },
  488. "helptext": "Toaster will run your builds using the tip of the &lt;a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/\"&gt;Yocto Project master branch&lt;/a&gt;, where active development takes place. This is not a stable branch, so your builds might not work as expected."
  489. }
  490. ]
  491. </literallayout>
  492. </para>
  493. </section>
  494. </section>
  495. <section id='toaster-json-files'>
  496. <title>JSON Files</title>
  497. <para>
  498. You must configure Toaster before using it.
  499. Configuration customizes layer source settings and Toaster defaults
  500. for all users and is performed by the person responsible for
  501. Toaster Configuration (i.e the Toaster Administrator).
  502. The Toaster Administrator performs this configuration through the
  503. Django administration interface.
  504. </para>
  505. <para>
  506. To make it easier to initially start Toaster, you can import a
  507. pre-defined configuration file using the
  508. <link linkend='toaster-command-loadconf'><filename>loadconf</filename></link>
  509. command.
  510. <note>
  511. The configuration file is a JSON-formatted text file with
  512. specific fields that Toaster recognizes.
  513. It is not a data dump from the database, so it cannot be
  514. loaded directly in the database.
  515. </note>
  516. </para>
  517. <para>
  518. By convention, the supplied configuration files are named
  519. <filename>toasterconf.json</filename>.
  520. The Toaster Administrator can customize the file prior to loading
  521. it into Toaster.
  522. The <filename>TOASTER_CONF</filename> variable in the
  523. Toaster startup script at <filename>bitbake/bin/toaster</filename>
  524. specifies the location of the <filename>toasterconf.json</filename> file.
  525. </para>
  526. <section id='json-file-choices'>
  527. <title>Configuration File Choices</title>
  528. <para>
  529. Two versions of the configuration file exist:
  530. <itemizedlist>
  531. <listitem><para>
  532. The
  533. <filename>meta-poky/conf/toasterconf.json</filename>
  534. in the <filename>conf</filename> directory of the
  535. Yocto Project's <filename>meta-poky</filename> layer.
  536. This version contains the default Yocto Project
  537. configuration for Toaster.
  538. You are prompted to select this file during the Toaster
  539. set up process if you cloned the
  540. <filename>poky</filename> repository (i.e.
  541. <filename>&YOCTO_GIT_URL;/poky</filename>).
  542. </para></listitem>
  543. <listitem><para>
  544. The <filename>meta/conf/toasterconf.json</filename>
  545. in the <filename>conf</filename> directory of the
  546. OpenEmbedded's <filename>openembedded-core</filename>
  547. layer.
  548. This version contains the default OpenEmbedded
  549. configuration for Toaster.
  550. You are prompted to select this file during the Toaster
  551. set up process if you had cloned the
  552. <filename>openembedded-core</filename> repository (i.e.
  553. <filename>git://git.openembedded.org/openembedded-core</filename>).
  554. </para></listitem>
  555. </itemizedlist>
  556. </para>
  557. </section>
  558. <section id='json-structure'>
  559. <title>File Structure</title>
  560. <para>
  561. The <filename>toasterconf.json</filename> file consists of
  562. easily readable areas: configuration, layer sources, BitBake,
  563. default release, and releases.
  564. </para>
  565. <section id='json-config-area'>
  566. <title>Configuration Area</title>
  567. <para>
  568. This area of the JSON file sets which variables are exposed
  569. to users through the Toaster web interface.
  570. Users can easily edit these variables.
  571. </para>
  572. <para>
  573. The variables you set here are displayed in the
  574. "Configuration variables" page in Toaster.
  575. Minimally, you should set the
  576. <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
  577. variable, which appears to users as part of the project
  578. page in Toaster.
  579. </para>
  580. <para>
  581. Here is the default <filename>config</filename> area:
  582. <literallayout class='monospaced'>
  583. "config": {
  584. "MACHINE" : "qemux86",
  585. "DISTRO" : "poky",
  586. "IMAGE_FSTYPES": "ext3 jffs2 tar.bz2",
  587. "IMAGE_INSTALL_append": "",
  588. "PACKAGE_CLASSES": "package_rpm",
  589. },
  590. </literallayout>
  591. </para>
  592. </section>
  593. <section id='json-layersources-area'>
  594. <title>Layer Sources Area</title>
  595. <para>
  596. This area of the JSON file defines the
  597. <link linkend='layer-source'>layer sources</link>
  598. Toaster uses.
  599. Toaster reads layer information from layer sources.
  600. Three types of layer sources exist that Toaster
  601. recognizes: Local, LayerIndex, and Imported.
  602. </para>
  603. <para>
  604. The Local layer source reads layers from Git clones
  605. available on your local drive.
  606. Using a local layer source enables you to easily test
  607. Toaster.
  608. <note>
  609. If you are setting up a hosted version of Toaster,
  610. it does not make sense to have a local layer source.
  611. </note>
  612. </para>
  613. <para>
  614. The LayerIndex layer source uses a REST API exposed by
  615. instances of the Layer Index application (e.g the public
  616. <ulink url='http://layers.openembedded.org/'></ulink>)
  617. to read layer data.
  618. </para>
  619. <para>
  620. The Imported layer source is reserved for layer data
  621. manually introduced by the user or Toaster Administrator
  622. through the GUI.
  623. This layer source lets users import their own layers
  624. and build them with Toaster.
  625. You should not remove the imported layer source.
  626. </para>
  627. <para>
  628. Here is the default <filename>layersources</filename> area:
  629. <literallayout class='monospaced'>
  630. "layersources": [
  631. {
  632. "name": "Local Yocto Project",
  633. "sourcetype": "local",
  634. "apiurl": "../../",
  635. "branches": ["HEAD" ],
  636. "layers": [
  637. {
  638. "name": "openembedded-core",
  639. "local_path": "meta",
  640. "vcs_url": "remote:origin",
  641. "dirpath": "meta"
  642. },
  643. {
  644. "name": "meta-poky",
  645. "local_path": "meta-poky",
  646. "vcs_url": "remote:origin",
  647. "dirpath": "meta-poky"
  648. },
  649. {
  650. "name": "meta-yocto-bsp",
  651. "local_path": "meta-yocto-bsp",
  652. "vcs_url": "remote:origin",
  653. "dirpath": "meta-yocto-bsp"
  654. }
  655. ]
  656. },
  657. {
  658. "name": "OpenEmbedded",
  659. "sourcetype": "layerindex",
  660. "apiurl": "http://layers.openembedded.org/layerindex/api/",
  661. "branches": ["master", "jethro" ,"fido"]
  662. },
  663. {
  664. "name": "Imported layers",
  665. "sourcetype": "imported",
  666. "apiurl": "",
  667. "branches": ["master", "jethro","fido", "HEAD"]
  668. }
  669. ],
  670. </literallayout>
  671. </para>
  672. </section>
  673. <section id='json-bitbake-area'>
  674. <title>BitBake Area</title>
  675. <para>
  676. This area of the JSON file defines the version of
  677. BitBake Toaster uses.
  678. As shipped, Toaster is configured to recognize four
  679. versions of BitBake: master, fido, jethro, and HEAD.
  680. <note>
  681. HEAD is a special option that builds whatever is
  682. available on disk, without checking out any remote
  683. Git repositories.
  684. </note>
  685. </para>
  686. <para>
  687. Here is the default <filename>bitbake</filename> area:
  688. <literallayout class='monospaced'>
  689. "bitbake" : [
  690. {
  691. "name": "master",
  692. "giturl": "remote:origin",
  693. "branch": "master",
  694. "dirpath": "bitbake"
  695. },
  696. {
  697. "name": "jethro",
  698. "giturl": "remote:origin",
  699. "branch": "jethro",
  700. "dirpath": "bitbake"
  701. },
  702. {
  703. "name": "fido",
  704. "giturl": "remote:origin",
  705. "branch": "fido",
  706. "dirpath": "bitbake"
  707. },
  708. {
  709. "name": "HEAD",
  710. "giturl": "remote:origin",
  711. "branch": "HEAD",
  712. "dirpath": "bitbake"
  713. }
  714. ],
  715. </literallayout>
  716. </para>
  717. </section>
  718. <section id='json-default-area'>
  719. <title>Default Area</title>
  720. <para>
  721. This area of the JSON file establishes a default
  722. release used by Toaster.
  723. As shipped, Toaster uses the "master" release.
  724. </para>
  725. <para>
  726. Here is the statement in the JSON file that establishes
  727. the default release:
  728. <literallayout class='monospaced'>
  729. "defaultrelease": "master",
  730. </literallayout>
  731. </para>
  732. </section>
  733. <section id='json-releases-area'>
  734. <title>Releases Area</title>
  735. <para>
  736. This area of the JSON file defines the versions of the
  737. OpenEmbedded build system Toaster recognizes.
  738. As shipped, Toaster is configured to work with the four
  739. releases described in the
  740. "<link linkend='toaster-releases-supported'>Pre-Configured Releases</link>"
  741. section.
  742. </para>
  743. <para>
  744. Here is the default <filename>releases</filename> area:
  745. <literallayout class='monospaced'>
  746. "releases": [
  747. {
  748. "name": "master",
  749. "description": "Yocto Project master",
  750. "bitbake": "master",
  751. "branch": "master",
  752. "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
  753. "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
  754. "helptext": "Toaster will run your builds using the tip of the &lt;a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/\"&gt;Yocto Project master branch&lt;/a&gt;, where active development takes place. This is not a stable branch, so your builds might not work as expected."
  755. },
  756. {
  757. "name": "jethro",
  758. "description": "Yocto Project 2.0 Jethro",
  759. "bitbake": "jethro",
  760. "branch": "jethro",
  761. "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
  762. "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
  763. "helptext": "Toaster will run your builds with the tip of the &lt;a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=jethro\"&gt;Yocto Project 2.0 \"Jethro\"&lt;/a&gt; branch."
  764. },
  765. {
  766. "name": "fido",
  767. "description": "Yocto Project 1.8 Fido",
  768. "bitbake": "fido",
  769. "branch": "fido",
  770. "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
  771. "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
  772. "helptext": "Toaster will run your builds with the tip of the &lt;a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=fido\"&gt;Yocto Project 1.8 \"Fido\"&lt;/a&gt; branch."
  773. },
  774. {
  775. "name": "local",
  776. "description": "Local Yocto Project",
  777. "bitbake": "HEAD",
  778. "branch": "HEAD",
  779. "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
  780. "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
  781. "helptext": "Toaster will run your builds with the version of the Yocto Project you have cloned or downloaded to your computer."
  782. }
  783. ]
  784. </literallayout>
  785. </para>
  786. </section>
  787. </section>
  788. </section>
  789. <section id='toaster-useful-commands'>
  790. <title>Useful Commands</title>
  791. <para>
  792. In addition to the web user interface and the scripts that start
  793. and stop Toaster, command-line commands exist through the
  794. <filename>manage.py</filename> management script.
  795. You can find general documentation on
  796. <filename>manage.py</filename> at the
  797. <ulink url='https://docs.djangoproject.com/en/1.7/topics/settings/'>Django</ulink>
  798. site.
  799. However, several <filename>manage.py</filename> commands have been
  800. created that are specific to Toaster and are used to control
  801. configuration and back-end tasks.
  802. You can locate these commands in the
  803. <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
  804. (e.g. <filename>poky</filename>) at
  805. <filename>bitbake/lib/manage.py</filename>.
  806. This section documents those commands.
  807. <note>
  808. <para>
  809. When using <filename>manage.py</filename> commands given
  810. a default configuration, you must be sure that your
  811. working directory is set to the
  812. <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
  813. Using <filename>manage.py</filename> commands from the
  814. Build Directory allows Toaster to find the
  815. <filename>toaster.sqlite</filename> file, which is located
  816. in the Build Directory.
  817. </para>
  818. <para>
  819. For non-default database configurations, it is possible
  820. that you can use <filename>manage.py</filename> commands
  821. from a directory other than the Build directory.
  822. To do so, the
  823. <filename>toastermain/settings.py</filename> file must be
  824. configured to point to the correct database backend.
  825. </para>
  826. </note>
  827. </para>
  828. <section id='toaster-command-buildslist'>
  829. <title><filename>buildslist</filename></title>
  830. <para>
  831. The <filename>buildslist</filename> command lists all builds
  832. that Toaster has recorded.
  833. Access the command as follows:
  834. <literallayout class='monospaced'>
  835. $ bitbake/lib/toaster/manage.py buildslist
  836. </literallayout>
  837. The command returns a list, which includes numeric
  838. identifications, of the builds that Toaster has recorded in the
  839. current database.
  840. </para>
  841. <para>
  842. You need to run the <filename>buildslist</filename> command
  843. first to identify existing builds in the database before
  844. using the
  845. <link linkend='toaster-command-builddelete'><filename>builddelete</filename></link>
  846. command.
  847. Here is an example that assumes default repository and build
  848. directory names:
  849. <literallayout class='monospaced'>
  850. $ cd ~/poky/build
  851. $ python ../bitbake/lib/toaster/manage.py buildslist
  852. </literallayout>
  853. If your Toaster database had only one build, the above
  854. <filename>buildslist</filename> command would return something
  855. like the following:
  856. <literallayout class='monospaced'>
  857. 1: qemux86 poky core-image-minimal
  858. </literallayout>
  859. </para>
  860. </section>
  861. <section id='toaster-command-builddelete'>
  862. <title><filename>builddelete</filename></title>
  863. <para>
  864. The <filename>builddelete</filename> command deletes data
  865. associated with a build.
  866. Access the command as follows:
  867. <literallayout class='monospaced'>
  868. $ bitbake/lib/toaster/manage.py builddelete <replaceable>build_id</replaceable>
  869. </literallayout>
  870. The command deletes all the build data for the specified
  871. <replaceable>build_id</replaceable>.
  872. This command is useful for removing old and unused data from
  873. the database.
  874. </para>
  875. <para>
  876. Prior to running the <filename>builddelete</filename>
  877. command, you need to get the ID associated with builds
  878. by using the
  879. <link linkend='toaster-command-buildslist'><filename>buildslist</filename></link>
  880. command.
  881. </para>
  882. </section>
  883. <section id='toaster-command-perf'>
  884. <title><filename>perf</filename></title>
  885. <para>
  886. The <filename>perf</filename> command measures Toaster
  887. performance.
  888. Access the command as follows:
  889. <literallayout class='monospaced'>
  890. $ bitbake/lib/toaster/manage.py perf
  891. </literallayout>
  892. The command is a sanity check that returns page loading
  893. times in order to identify performance problems.
  894. </para>
  895. </section>
  896. <section id='toaster-command-checksettings'>
  897. <title><filename>checksettings</filename></title>
  898. <para>
  899. The <filename>checksettings</filename> command verifies
  900. existing Toaster settings.
  901. Access the command as follows:
  902. <literallayout class='monospaced'>
  903. $ bitbake/lib/toaster/manage.py checksettings
  904. </literallayout>
  905. Toaster uses settings that are based on the
  906. database to configure the building tasks.
  907. The <filename>checksettings</filename> command verifies that
  908. the database settings are valid in the sense that they have
  909. the minimal information needed to start a build.
  910. </para>
  911. <para>
  912. In order for the <filename>checksettings</filename> command
  913. to work, the database must be correctly set up and not have
  914. existing data.
  915. To be sure the database is ready, you can run the following:
  916. <literallayout class='monospaced'>
  917. $ bitbake/lib/toaster/mana​ge.py syncdb
  918. $ bitbake/lib/toaster/mana​ge.py migrate orm
  919. $ bitbake/lib/toaster/mana​ge.py migrate bldcontrol
  920. </literallayout>
  921. After running these commands, you can run the
  922. <filename>checksettings</filename> command.
  923. </para>
  924. </section>
  925. <section id='toaster-command-loadconf'>
  926. <title><filename>loadconf</filename></title>
  927. <para>
  928. The <filename>loadconf</filename> command loads an
  929. existing Toaster configuration file (JSON file).
  930. You must run this on a new database that does not have any
  931. data.
  932. Running this command on an existing database that has data
  933. results in errors.
  934. Access the command as follows:
  935. <literallayout class='monospaced'>
  936. $ bitbake/lib/toaster/manage.py loadconf <replaceable>filepath</replaceable>
  937. </literallayout>
  938. The <filename>loadconf</filename> command configures a database
  939. based on the supplied existing
  940. <filename>toasterconf.json</filename> file.
  941. For information on the <filename>toasterconf.json</filename>,
  942. see the
  943. "<link linkend='toaster-json-files'>JSON Files</link>"
  944. section.
  945. </para>
  946. </section>
  947. <section id='toaster-command-runbuilds'>
  948. <title><filename>runbuilds</filename></title>
  949. <para>
  950. The <filename>runbuilds</filename> command launches
  951. scheduled builds.
  952. Access the command as follows:
  953. <literallayout class='monospaced'>
  954. $ bitbake/lib/toaster/manage.py runbuilds
  955. </literallayout>
  956. The <filename>runbuilds</filename> command checks if
  957. scheduled builds exist in the database and then launches them
  958. per schedule.
  959. The command returns after the builds start but before they
  960. complete.
  961. The Toaster Logging Interface records and updates the database
  962. when the builds complete.
  963. </para>
  964. </section>
  965. </section>
  966. </chapter>