bsp.xml 109 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269
  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='bsp'>
  5. <title>Board Support Packages (BSP) - Developer's Guide</title>
  6. <para>
  7. A Board Support Package (BSP) is a collection of information that
  8. defines how to support a particular hardware device, set of devices, or
  9. hardware platform.
  10. The BSP includes information about the hardware features
  11. present on the device and kernel configuration information along with any
  12. additional hardware drivers required.
  13. The BSP also lists any additional software
  14. components required in addition to a generic Linux software stack for both
  15. essential and optional platform features.
  16. </para>
  17. <para>
  18. This guide presents information about BSP Layers, defines a structure for components
  19. so that BSPs follow a commonly understood layout, discusses how to customize
  20. a recipe for a BSP, addresses BSP licensing, and provides information that
  21. shows you how to create a
  22. <link linkend='bsp-layers'>BSP Layer</link> using the
  23. <link linkend='creating-a-new-bsp-layer-using-the-bitbake-layers-script'><filename>bitbake-layers</filename></link>
  24. tool.
  25. </para>
  26. <section id='bsp-layers'>
  27. <title>BSP Layers</title>
  28. <para>
  29. A BSP consists of a file structure inside a base directory.
  30. Collectively, you can think of the base directory, its file structure,
  31. and the contents as a BSP Layer.
  32. Although not a strict requirement, BSP layers in the Yocto Project
  33. use the following well-established naming convention:
  34. <literallayout class='monospaced'>
  35. meta-<replaceable>bsp_root_name</replaceable>
  36. </literallayout>
  37. The string "meta-" is prepended to the machine or platform name, which is
  38. <replaceable>bsp_root_name</replaceable> in the above form.
  39. <note><title>Tip</title>
  40. Because the BSP layer naming convention is well-established,
  41. it is advisable to follow it when creating layers.
  42. Technically speaking, a BSP layer name does not need to
  43. start with <filename>meta-</filename>.
  44. However, various scripts and tools in the Yocto Project
  45. development environment assume this convention.
  46. </note>
  47. </para>
  48. <para>
  49. To help understand the BSP layer concept, consider the BSPs that the
  50. Yocto Project supports and provides with each release.
  51. You can see the layers in the
  52. <ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>
  53. through a web interface at
  54. <ulink url='&YOCTO_GIT_URL;'></ulink>.
  55. If you go to that interface, you will find a list of repositories
  56. under "Yocto Metadata Layers".
  57. <note>
  58. Layers that are no longer actively supported as part of the
  59. Yocto Project appear under the heading "Yocto Metadata Layer
  60. Archive."
  61. </note>
  62. Each repository is a BSP layer supported by the Yocto Project
  63. (e.g. <filename>meta-raspberrypi</filename> and
  64. <filename>meta-intel</filename>).
  65. Each of these layers is a repository unto itself and clicking on a
  66. layer reveals information that includes two links from which you can choose
  67. to set up a clone of the layer's repository on your local host system.
  68. Here is an example that clones the Raspberry Pi BSP layer:
  69. <literallayout class='monospaced'>
  70. $ git clone git://git.yoctoproject.org/meta-raspberrypi
  71. </literallayout>
  72. </para>
  73. <para>
  74. In addition to BSP layers, the
  75. <filename>meta-yocto-bsp</filename> layer is part of the
  76. shipped <filename>poky</filename> repository.
  77. The <filename>meta-yocto-bsp</filename> layer maintains several
  78. BSPs such as the Beaglebone, EdgeRouter, and generic versions of
  79. both 32-bit and 64-bit IA machines.
  80. </para>
  81. <para>
  82. For information on the BSP development workflow, see the
  83. "<link linkend='developing-a-board-support-package-bsp'>Developing a Board Support Package (BSP)</link>"
  84. section.
  85. For more information on how to set up a local copy of source files
  86. from a Git repository, see the
  87. "<ulink url='&YOCTO_DOCS_DEV_URL;#locating-yocto-project-source-files'>Locating Yocto Project Source Files</ulink>"
  88. section in the Yocto Project Development Tasks Manual.
  89. </para>
  90. <para>
  91. The layer's base directory
  92. (<filename>meta-<replaceable>bsp_root_name</replaceable></filename>)
  93. is the root directory of the BSP Layer.
  94. This directory is what you add to the
  95. <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
  96. variable in the <filename>conf/bblayers.conf</filename> file found in the
  97. <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
  98. which is established after you run the OpenEmbedded build environment
  99. setup script (i.e.
  100. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>).
  101. Adding the root directory allows the
  102. <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
  103. to recognize the BSP layer and from it build an image.
  104. Here is an example:
  105. <literallayout class='monospaced'>
  106. BBLAYERS ?= " \
  107. /usr/local/src/yocto/meta \
  108. /usr/local/src/yocto/meta-poky \
  109. /usr/local/src/yocto/meta-yocto-bsp \
  110. /usr/local/src/yocto/meta-mylayer \
  111. "
  112. </literallayout>
  113. <note><title>Tip</title>
  114. Ordering and
  115. <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PRIORITY'><filename>BBFILE_PRIORITY</filename></ulink>
  116. for the layers listed in <filename>BBLAYERS</filename>
  117. matter.
  118. For example, if multiple layers define a machine
  119. configuration, the OpenEmbedded build system uses
  120. the last layer searched given similar layer
  121. priorities.
  122. The build system works from the top-down through
  123. the layers listed in <filename>BBLAYERS</filename>.
  124. </note>
  125. </para>
  126. <para>
  127. Some BSPs require or depend on additional layers
  128. beyond the BSP's root layer in order to be functional.
  129. In this case, you need to specify these layers in the
  130. <filename>README</filename> "Dependencies" section of the
  131. BSP's root layer.
  132. Additionally, if any build instructions exist for the
  133. BSP, you must add them to the "Dependencies" section.
  134. </para>
  135. <para>
  136. Some layers function as a layer to hold other BSP layers.
  137. These layers are knows as
  138. "<ulink url='&YOCTO_DOCS_REF_URL;#term-container-layer'>container layers</ulink>".
  139. An example of this type of layer is the
  140. <filename>meta-intel</filename> layer.
  141. This layer contains BSP layers for the Intel-core2-32
  142. <trademark class='registered'>Intel</trademark> Common Core
  143. (Intel-core2-32) and the Intel-corei7-64
  144. <trademark class='registered'>Intel</trademark> Common Core
  145. (Intel-corei7-64).
  146. the <filename>meta-intel</filename> layer also contains
  147. the <filename>common/</filename> directory, which contains
  148. common content across those layers.
  149. </para>
  150. <para>
  151. For more information on layers, see the
  152. "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
  153. section of the Yocto Project Development Tasks Manual.
  154. </para>
  155. </section>
  156. <section id='preparing-your-build-host-to-work-with-bsp-layers'>
  157. <title>Preparing Your Build Host to Work With BSP Layers</title>
  158. <para>
  159. This section describes how to get your build host ready
  160. to work with BSP layers.
  161. Once you have the host set up, you can create the layer
  162. as described in the
  163. "<link linkend='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>Creating a new BSP Layer Using the <filename>bitbake-layers</filename> Script</link>"
  164. section.
  165. <note>
  166. For structural information on BSPs, see the
  167. <link linkend='bsp-filelayout'>Example Filesystem Layout</link>
  168. section.
  169. </note>
  170. <orderedlist>
  171. <listitem><para>
  172. <emphasis>Set Up the Build Environment:</emphasis>
  173. Be sure you are set up to use BitBake in a shell.
  174. See the
  175. "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-preparing-the-build-host'>Preparing the Build Host</ulink>"
  176. section in the Yocto Project Development Tasks Manual for information
  177. on how to get a build host ready that is either a native
  178. Linux machine or a machine that uses CROPS.
  179. </para></listitem>
  180. <listitem><para>
  181. <emphasis>Clone the <filename>poky</filename> Repository:</emphasis>
  182. You need to have a local copy of the Yocto Project
  183. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
  184. (i.e. a local <filename>poky</filename> repository).
  185. See the
  186. "<ulink url='&YOCTO_DOCS_DEV_URL;#cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</ulink>"
  187. and possibly the
  188. "<ulink url='&YOCTO_DOCS_DEV_URL;#checking-out-by-branch-in-poky'>Checking Out by Branch in Poky</ulink>"
  189. or
  190. "<ulink url='&YOCTO_DOCS_DEV_URL;#checkout-out-by-tag-in-poky'>Checking Out by Tag in Poky</ulink>"
  191. sections all in the Yocto Project Development Tasks Manual for
  192. information on how to clone the <filename>poky</filename>
  193. repository and check out the appropriate branch for your work.
  194. </para></listitem>
  195. <listitem><para>
  196. <emphasis>Determine the BSP Layer You Want:</emphasis>
  197. The Yocto Project supports many BSPs, which are maintained in
  198. their own layers or in layers designed to contain several
  199. BSPs.
  200. To get an idea of machine support through BSP layers, you can
  201. look at the
  202. <ulink url='&YOCTO_RELEASE_DL_URL;/machines'>index of machines</ulink>
  203. for the release.
  204. </para></listitem>
  205. <listitem><para>
  206. <emphasis>Optionally Clone the
  207. <filename>meta-intel</filename> BSP Layer:</emphasis>
  208. If your hardware is based on current Intel CPUs and devices,
  209. you can leverage this BSP layer.
  210. For details on the <filename>meta-intel</filename> BSP layer,
  211. see the layer's
  212. <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/tree/README'><filename>README</filename></ulink>
  213. file.
  214. <orderedlist>
  215. <listitem><para>
  216. <emphasis>Navigate to Your Source Directory:</emphasis>
  217. Typically, you set up the
  218. <filename>meta-intel</filename> Git repository
  219. inside the
  220. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
  221. (e.g. <filename>poky</filename>).
  222. <literallayout class='monospaced'>
  223. $ cd /home/<replaceable>you</replaceable>/poky
  224. </literallayout>
  225. </para></listitem>
  226. <listitem><para>
  227. <emphasis>Clone the Layer:</emphasis>
  228. <literallayout class='monospaced'>
  229. $ git clone git://git.yoctoproject.org/meta-intel.git
  230. Cloning into 'meta-intel'...
  231. remote: Counting objects: 15585, done.
  232. remote: Compressing objects: 100% (5056/5056), done.
  233. remote: Total 15585 (delta 9123), reused 15329 (delta 8867)
  234. Receiving objects: 100% (15585/15585), 4.51 MiB | 3.19 MiB/s, done.
  235. Resolving deltas: 100% (9123/9123), done.
  236. Checking connectivity... done.
  237. </literallayout>
  238. </para></listitem>
  239. <listitem><para>
  240. <emphasis>Check Out the Proper Branch:</emphasis>
  241. The branch you check out for
  242. <filename>meta-intel</filename> must match the same
  243. branch you are using for the Yocto Project release
  244. (e.g. &DISTRO_NAME_NO_CAP;):
  245. <literallayout class='monospaced'>
  246. $ cd meta-intel
  247. $ git checkout -b &DISTRO_NAME_NO_CAP; remotes/origin/&DISTRO_NAME_NO_CAP;
  248. Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
  249. Switched to a new branch '&DISTRO_NAME_NO_CAP;'
  250. </literallayout>
  251. <note>
  252. To see the available branch names in a cloned repository,
  253. use the <filename>git branch -al</filename> command.
  254. See the
  255. "<ulink url='&YOCTO_DOCS_DEV_URL;#checking-out-by-branch-in-poky'>Checking Out By Branch in Poky</ulink>"
  256. section in the Yocto Project Development Tasks
  257. Manual for more information.
  258. </note>
  259. </para></listitem>
  260. </orderedlist>
  261. </para></listitem>
  262. <listitem><para>
  263. <emphasis>Optionally Set Up an Alternative BSP Layer:</emphasis>
  264. If your hardware can be more closely leveraged to an
  265. existing BSP not within the <filename>meta-intel</filename>
  266. BSP layer, you can clone that BSP layer.</para>
  267. <para>The process is identical to the process used for the
  268. <filename>meta-intel</filename> layer except for the layer's
  269. name.
  270. For example, if you determine that your hardware most
  271. closely matches the <filename>meta-raspberrypi</filename>,
  272. clone that layer:
  273. <literallayout class='monospaced'>
  274. $ git clone git://git.yoctoproject.org/meta-raspberrypi
  275. Cloning into 'meta-raspberrypi'...
  276. remote: Counting objects: 4743, done.
  277. remote: Compressing objects: 100% (2185/2185), done.
  278. remote: Total 4743 (delta 2447), reused 4496 (delta 2258)
  279. Receiving objects: 100% (4743/4743), 1.18 MiB | 0 bytes/s, done.
  280. Resolving deltas: 100% (2447/2447), done.
  281. Checking connectivity... done.
  282. </literallayout>
  283. </para></listitem>
  284. <listitem><para>
  285. <emphasis>Initialize the Build Environment:</emphasis>
  286. While in the root directory of the Source Directory (i.e.
  287. <filename>poky</filename>), run the
  288. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
  289. environment setup script to define the OpenEmbedded
  290. build environment on your build host.
  291. <literallayout class='monospaced'>
  292. $ source &OE_INIT_FILE;
  293. </literallayout>
  294. Among other things, the script creates the
  295. <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
  296. which is <filename>build</filename> in this case
  297. and is located in the
  298. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
  299. After the script runs, your current working directory
  300. is set to the <filename>build</filename> directory.
  301. </para></listitem>
  302. </orderedlist>
  303. </para>
  304. </section>
  305. <section id="bsp-filelayout">
  306. <title>Example Filesystem Layout</title>
  307. <para>
  308. Defining a common BSP directory structure allows
  309. end-users to understand and become familiar with
  310. that standard.
  311. A common format also encourages standardization
  312. of software support for hardware.
  313. </para>
  314. <para>
  315. The proposed form described in this section does
  316. have elements that are specific to the OpenEmbedded
  317. build system.
  318. It is intended that developers can use this structure
  319. with other build systems besides the OpenEmbedded build
  320. system.
  321. It is also intended that it will be be simple to extract
  322. information and convert it to other formats if required.
  323. The OpenEmbedded build system, through its standard
  324. <ulink url='&YOCTO_DOCS_OM_URL;#the-yocto-project-layer-model'>layers mechanism</ulink>,
  325. can directly accept the format described as a layer.
  326. The BSP layer captures all the hardware-specific details
  327. in one place using a standard format, which is useful
  328. for any person wishing to use the hardware platform
  329. regardless of the build system they are using.
  330. </para>
  331. <para>
  332. The BSP specification does not include a build system
  333. or other tools - the specification is concerned with
  334. the hardware-specific components only.
  335. At the end-distribution point, you can ship the BSP
  336. layer combined with a build system and other tools.
  337. Realize that it is important to maintain the distinction
  338. that the BSP layer, a build system, and tools are
  339. separate components that could to be combined in
  340. certain end products.
  341. </para>
  342. <para>
  343. Before looking at the common form for the file structure
  344. inside a BSP Layer, you should be aware that some
  345. requirements do exist in order for a BSP layer to
  346. be considered compliant with the Yocto Project.
  347. For that list of requirements, see the
  348. "<link linkend='released-bsp-requirements'>Released BSP Requirements</link>"
  349. section.
  350. </para>
  351. <para>
  352. Below is the common form for the file structure
  353. inside a BSP Layer.
  354. While this basic form represents the standard,
  355. realize that the actual file structures for specific
  356. BSPs could differ.
  357. <literallayout class='monospaced'>
  358. meta-<replaceable>bsp_root_name</replaceable>/
  359. meta-<replaceable>bsp_root_name</replaceable>/<replaceable>bsp_license_file</replaceable>
  360. meta-<replaceable>bsp_root_name</replaceable>/README
  361. meta-<replaceable>bsp_root_name</replaceable>/README.sources
  362. meta-<replaceable>bsp_root_name</replaceable>/binary/<replaceable>bootable_images</replaceable>
  363. meta-<replaceable>bsp_root_name</replaceable>/conf/layer.conf
  364. meta-<replaceable>bsp_root_name</replaceable>/conf/machine/*.conf
  365. meta-<replaceable>bsp_root_name</replaceable>/recipes-bsp/*
  366. meta-<replaceable>bsp_root_name</replaceable>/recipes-core/*
  367. meta-<replaceable>bsp_root_name</replaceable>/recipes-graphics/*
  368. meta-<replaceable>bsp_root_name</replaceable>/recipes-kernel/linux/linux-yocto_<replaceable>kernel_rev</replaceable>.bbappend
  369. </literallayout>
  370. </para>
  371. <para>
  372. Below is an example of the Raspberry Pi BSP
  373. layer that is available from the
  374. <ulink url='&YOCTO_GIT_URL;'>Source Respositories</ulink>:
  375. <literallayout class='monospaced'>
  376. meta-raspberrypi/COPYING.MIT
  377. meta-raspberrypi/README.md
  378. meta-raspberrypi/classes
  379. meta-raspberrypi/classes/sdcard_image-rpi.bbclass
  380. meta-raspberrypi/conf/
  381. meta-raspberrypi/conf/layer.conf
  382. meta-raspberrypi/conf/machine/
  383. meta-raspberrypi/conf/machine/raspberrypi-cm.conf
  384. meta-raspberrypi/conf/machine/raspberrypi-cm3.conf
  385. meta-raspberrypi/conf/machine/raspberrypi.conf
  386. meta-raspberrypi/conf/machine/raspberrypi0-wifi.conf
  387. meta-raspberrypi/conf/machine/raspberrypi0.conf
  388. meta-raspberrypi/conf/machine/raspberrypi2.conf
  389. meta-raspberrypi/conf/machine/raspberrypi3-64.conf
  390. meta-raspberrypi/conf/machine/raspberrypi3.conf
  391. meta-raspberrypi/conf/machine/include
  392. meta-raspberrypi/conf/machine/include/rpi-base.inc
  393. meta-raspberrypi/conf/machine/include/rpi-default-providers.inc
  394. meta-raspberrypi/conf/machine/include/rpi-default-settings.inc
  395. meta-raspberrypi/conf/machine/include/rpi-default-versions.inc
  396. meta-raspberrypi/conf/machine/include/tune-arm1176jzf-s.inc
  397. meta-raspberrypi/docs
  398. meta-raspberrypi/docs/Makefile
  399. meta-raspberrypi/docs/conf.py
  400. meta-raspberrypi/docs/contributing.md
  401. meta-raspberrypi/docs/extra-apps.md
  402. meta-raspberrypi/docs/extra-build-config.md
  403. meta-raspberrypi/docs/index.rst
  404. meta-raspberrypi/docs/layer-contents.md
  405. meta-raspberrypi/docs/readme.md
  406. meta-raspberrypi/files
  407. meta-raspberrypi/files/custom-licenses
  408. meta-raspberrypi/files/custom-licenses/Broadcom
  409. meta-raspberrypi/recipes-bsp
  410. meta-raspberrypi/recipes-bsp/bootfiles
  411. meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bb
  412. meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb
  413. meta-raspberrypi/recipes-bsp/common
  414. meta-raspberrypi/recipes-bsp/common/firmware.inc
  415. meta-raspberrypi/recipes-bsp/formfactor
  416. meta-raspberrypi/recipes-bsp/formfactor/formfactor
  417. meta-raspberrypi/recipes-bsp/formfactor/formfactor/raspberrypi
  418. meta-raspberrypi/recipes-bsp/formfactor/formfactor/raspberrypi/machconfig
  419. meta-raspberrypi/recipes-bsp/formfactor/formfactor_0.0.bbappend
  420. meta-raspberrypi/recipes-bsp/rpi-u-boot-src
  421. meta-raspberrypi/recipes-bsp/rpi-u-boot-src/files
  422. meta-raspberrypi/recipes-bsp/rpi-u-boot-src/files/boot.cmd.in
  423. meta-raspberrypi/recipes-bsp/rpi-u-boot-src/rpi-u-boot-scr.bb
  424. meta-raspberrypi/recipes-bsp/u-boot
  425. meta-raspberrypi/recipes-bsp/u-boot/u-boot
  426. meta-raspberrypi/recipes-bsp/u-boot/u-boot/*.patch
  427. meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
  428. meta-raspberrypi/recipes-connectivity
  429. meta-raspberrypi/recipes-connectivity/bluez5
  430. meta-raspberrypi/recipes-connectivity/bluez5/bluez5
  431. meta-raspberrypi/recipes-connectivity/bluez5/bluez5/*.patch
  432. meta-raspberrypi/recipes-connectivity/bluez5/bluez5/BCM43430A1.hcd
  433. meta-raspberrypi/recipes-connectivity/bluez5/bluez5brcm43438.service
  434. meta-raspberrypi/recipes-connectivity/bluez5/bluez5_%.bbappend
  435. meta-raspberrypi/recipes-core
  436. meta-raspberrypi/recipes-core/images
  437. meta-raspberrypi/recipes-core/images/rpi-basic-image.bb
  438. meta-raspberrypi/recipes-core/images/rpi-hwup-image.bb
  439. meta-raspberrypi/recipes-core/images/rpi-test-image.bb
  440. meta-raspberrypi/recipes-core/packagegroups
  441. meta-raspberrypi/recipes-core/packagegroups/packagegroup-rpi-test.bb
  442. meta-raspberrypi/recipes-core/psplash
  443. meta-raspberrypi/recipes-core/psplash/files
  444. meta-raspberrypi/recipes-core/psplash/files/psplash-raspberrypi-img.h
  445. meta-raspberrypi/recipes-core/psplash/psplash_git.bbappend
  446. meta-raspberrypi/recipes-core/udev
  447. meta-raspberrypi/recipes-core/udev/udev-rules-rpi
  448. meta-raspberrypi/recipes-core/udev/udev-rules-rpi/99-com.rules
  449. meta-raspberrypi/recipes-core/udev/udev-rules-rpi.bb
  450. meta-raspberrypi/recipes-devtools
  451. meta-raspberrypi/recipes-devtools/bcm2835
  452. meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.52.bb
  453. meta-raspberrypi/recipes-devtools/pi-blaster
  454. meta-raspberrypi/recipes-devtools/pi-blaster/files
  455. meta-raspberrypi/recipes-devtools/pi-blaster/files/*.patch
  456. meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster_git.bb
  457. meta-raspberrypi/recipes-devtools/python
  458. meta-raspberrypi/recipes-devtools/python/python-rtimu
  459. meta-raspberrypi/recipes-devtools/python/python-rtimu/*.patch
  460. meta-raspberrypi/recipes-devtools/python/python-rtimu_git.bb
  461. meta-raspberrypi/recipes-devtools/python/python-sense-hat_2.2.0.bb
  462. meta-raspberrypi/recipes-devtools/python/rpi-gpio
  463. meta-raspberrypi/recipes-devtools/python/rpi-gpio/*.patch
  464. meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.3.bb
  465. meta-raspberrypi/recipes-devtools/python/rpio
  466. meta-raspberrypi/recipes-devtools/python/rpio/*.patch
  467. meta-raspberrypi/recipes-devtools/python/rpio_0.10.0.bb
  468. meta-raspberrypi/recipes-devtools/wiringPi
  469. meta-raspberrypi/recipes-devtools/wiringPi/files
  470. meta-raspberrypi/recipes-devtools/wiringPi/files/*.patch
  471. meta-raspberrypi/recipes-devtools/wiringPi/wiringpi_git.bb
  472. meta-raspberrypi/recipes-graphics
  473. meta-raspberrypi/recipes-graphics/eglinfo
  474. meta-raspberrypi/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
  475. meta-raspberrypi/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend
  476. meta-raspberrypi/recipes-graphics/mesa
  477. meta-raspberrypi/recipes-graphics/mesa/mesa-gl_%.bbappend
  478. meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend
  479. meta-raspberrypi/recipes-graphics/userland
  480. meta-raspberrypi/recipes-graphics/userland/userland
  481. meta-raspberrypi/recipes-graphics/userland/userland/*.patch
  482. meta-raspberrypi/recipes-graphics/userland/userland_git.bb
  483. meta-raspberrypi/recipes-graphics/vc-graphics
  484. meta-raspberrypi/recipes-graphics/vc-graphics/files
  485. meta-raspberrypi/recipes-graphics/vc-graphics/files/egl.pc
  486. meta-raspberrypi/recipes-graphics/vc-graphics/files/vchiq.sh
  487. meta-raspberrypi/recipes-graphics/vc-graphics/vc-graphics-hardfp.bb
  488. meta-raspberrypi/recipes-graphics/vc-graphics/vc-graphics.bb
  489. meta-raspberrypi/recipes-graphics/vc-graphics/vc-graphics.inc
  490. meta-raspberrypi/recipes-graphics/wayland
  491. meta-raspberrypi/recipes-graphics/wayland/weston_%.bbappend
  492. meta-raspberrypi/recipes-graphics/xorg-xserver
  493. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config
  494. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi
  495. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf
  496. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d
  497. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/10-evdev.conf
  498. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/98-pitft.conf
  499. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-calibration.conf
  500. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
  501. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
  502. meta-raspberrypi/recipes-kernel
  503. meta-raspberrypi/recipes-kernel/linux-firmware
  504. meta-raspberrypi/recipes-kernel/linux-firmware/files
  505. meta-raspberrypi/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.bin
  506. meta-raspberrypi/recipes-kernel/linux-firmware/files/brcfmac43430-sdio.txt
  507. meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend
  508. meta-raspberrypi/recipes-kernel/linux
  509. meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb
  510. meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
  511. meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14.bb
  512. meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb
  513. meta-raspberrypi/recipes-multimedia
  514. meta-raspberrypi/recipes-multimedia/gstreamer
  515. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx
  516. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/*.patch
  517. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend
  518. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
  519. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12
  520. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/*.patch
  521. meta-raspberrypi/recipes-multimedia/omxplayer
  522. meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer
  523. meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/*.patch
  524. meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer_git.bb
  525. meta-raspberrypi/recipes-multimedia/x264
  526. meta-raspberrypi/recipes-multimedia/x264/x264_git.bbappend
  527. meta-raspberrypi/wic
  528. meta-raspberrypi/wic/sdimage-raspberrypi.wks
  529. </literallayout>
  530. </para>
  531. <para>
  532. The following sections describe each part of the proposed
  533. BSP format.
  534. </para>
  535. <section id="bsp-filelayout-license">
  536. <title>License Files</title>
  537. <para>
  538. You can find these files in the BSP Layer at:
  539. <literallayout class='monospaced'>
  540. meta-<replaceable>bsp_root_name</replaceable>/<replaceable>bsp_license_file</replaceable>
  541. </literallayout>
  542. </para>
  543. <para>
  544. These optional files satisfy licensing requirements
  545. for the BSP.
  546. The type or types of files here can vary depending
  547. on the licensing requirements.
  548. For example, in the Raspberry Pi BSP all licensing
  549. requirements are handled with the
  550. <filename>COPYING.MIT</filename> file.
  551. </para>
  552. <para>
  553. Licensing files can be MIT, BSD, GPLv*, and so forth.
  554. These files are recommended for the BSP but are
  555. optional and totally up to the BSP developer.
  556. For information on how to maintain license
  557. compliance, see the
  558. "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>"
  559. section in the Yocto Project Development Tasks
  560. Manual.
  561. </para>
  562. </section>
  563. <section id="bsp-filelayout-readme">
  564. <title>README File</title>
  565. <para>
  566. You can find this file in the BSP Layer at:
  567. <literallayout class='monospaced'>
  568. meta-<replaceable>bsp_root_name</replaceable>/README
  569. </literallayout>
  570. </para>
  571. <para>
  572. This file provides information on how to boot the live
  573. images that are optionally included in the
  574. <filename>binary/</filename> directory.
  575. The <filename>README</filename> file also provides
  576. information needed for building the image.
  577. </para>
  578. <para>
  579. At a minimum, the <filename>README</filename> file must
  580. contain a list of dependencies, such as the names of
  581. any other layers on which the BSP depends and the name of
  582. the BSP maintainer with his or her contact information.
  583. </para>
  584. </section>
  585. <section id="bsp-filelayout-readme-sources">
  586. <title>README.sources File</title>
  587. <para>
  588. You can find this file in the BSP Layer at:
  589. <literallayout class='monospaced'>
  590. meta-<replaceable>bsp_root_name</replaceable>/README.sources
  591. </literallayout>
  592. </para>
  593. <para>
  594. This file provides information on where to locate the BSP
  595. source files used to build the images (if any) that
  596. reside in
  597. <filename>meta-<replaceable>bsp_root_name</replaceable>/binary</filename>.
  598. Images in the <filename>binary</filename> would be images
  599. released with the BSP.
  600. The information in the <filename>README.sources</filename>
  601. file also helps you find the
  602. <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
  603. used to generate the images that ship with the BSP.
  604. <note>
  605. If the BSP's <filename>binary</filename> directory is
  606. missing or the directory has no images, an existing
  607. <filename>README.sources</filename> file is
  608. meaningless and usually does not exist.
  609. </note>
  610. </para>
  611. </section>
  612. <section id="bsp-filelayout-binary">
  613. <title>Pre-built User Binaries</title>
  614. <para>
  615. You can find these files in the BSP Layer at:
  616. <literallayout class='monospaced'>
  617. meta-<replaceable>bsp_root_name</replaceable>/binary/<replaceable>bootable_images</replaceable>
  618. </literallayout>
  619. </para>
  620. <para>
  621. This optional area contains useful pre-built kernels
  622. and user-space filesystem images released with the
  623. BSP that are appropriate to the target system.
  624. This directory typically contains graphical (e.g. Sato)
  625. and minimal live images when the BSP tarball has been
  626. created and made available in the
  627. <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink>
  628. website.
  629. You can use these kernels and images to get a system
  630. running and quickly get started on development tasks.
  631. </para>
  632. <para>
  633. The exact types of binaries present are highly
  634. hardware-dependent.
  635. The
  636. <link linkend='bsp-filelayout-readme'><filename>README</filename></link>
  637. file should be present in the BSP Layer and it
  638. explains how to use the images with the target hardware.
  639. Additionally, the
  640. <link linkend='bsp-filelayout-readme-sources'><filename>README.sources</filename></link>
  641. file should be present to locate the sources used to
  642. build the images and provide information on the
  643. Metadata.
  644. </para>
  645. </section>
  646. <section id='bsp-filelayout-layer'>
  647. <title>Layer Configuration File</title>
  648. <para>
  649. You can find this file in the BSP Layer at:
  650. <literallayout class='monospaced'>
  651. meta-<replaceable>bsp_root_name</replaceable>/conf/layer.conf
  652. </literallayout>
  653. </para>
  654. <para>
  655. The <filename>conf/layer.conf</filename> file
  656. identifies the file structure as a layer,
  657. identifies the contents of the layer, and
  658. contains information about how the build system should
  659. use it.
  660. Generally, a standard boilerplate file such as the
  661. following works.
  662. In the following example, you would replace
  663. <replaceable>bsp</replaceable> with the actual
  664. name of the BSP (i.e.
  665. <replaceable>bsp_root_name</replaceable> from the example
  666. template).
  667. </para>
  668. <para>
  669. <literallayout class='monospaced'>
  670. # We have a conf and classes directory, add to BBPATH
  671. BBPATH .= ":${LAYERDIR}"
  672. # We have a recipes directory, add to BBFILES
  673. BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
  674. ${LAYERDIR}/recipes-*/*/*.bbappend"
  675. BBFILE_COLLECTIONS += "<replaceable>bsp</replaceable>"
  676. BBFILE_PATTERN_<replaceable>bsp</replaceable> = "^${LAYERDIR}/"
  677. BBFILE_PRIORITY_<replaceable>bsp</replaceable> = "6"
  678. LAYERDEPENDS_<replaceable>bsp</replaceable> = "intel"
  679. </literallayout>
  680. </para>
  681. <para>
  682. To illustrate the string substitutions, here are
  683. the corresponding statements from the Raspberry
  684. Pi <filename>conf/layer.conf</filename> file:
  685. <literallayout class='monospaced'>
  686. # We have a conf and classes directory, append to BBPATH
  687. BBPATH .= ":${LAYERDIR}"
  688. # We have a recipes directory containing .bb and .bbappend files, add to BBFILES
  689. BBFILES += "${LAYERDIR}/recipes*/*/*.bb \
  690. ${LAYERDIR}/recipes*/*/*.bbappend"
  691. BBFILE_COLLECTIONS += "raspberrypi"
  692. BBFILE_PATTERN_raspberrypi := "^${LAYERDIR}/"
  693. BBFILE_PRIORITY_raspberrypi = "9"
  694. # Additional license directories.
  695. LICENSE_PATH += "${LAYERDIR}/files/custom-licenses"
  696. .
  697. .
  698. .
  699. </literallayout>
  700. </para>
  701. <para>
  702. This file simply makes
  703. <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
  704. aware of the recipes and configuration directories.
  705. The file must exist so that the OpenEmbedded build system
  706. can recognize the BSP.
  707. </para>
  708. </section>
  709. <section id="bsp-filelayout-machine">
  710. <title>Hardware Configuration Options</title>
  711. <para>
  712. You can find these files in the BSP Layer at:
  713. <literallayout class='monospaced'>
  714. meta-<replaceable>bsp_root_name</replaceable>/conf/machine/*.conf
  715. </literallayout>
  716. </para>
  717. <para>
  718. The machine files bind together all the information
  719. contained elsewhere in the BSP into a format that
  720. the build system can understand.
  721. Each BSP Layer requires at least one machine file.
  722. If the BSP supports multiple machines, multiple
  723. machine configuration files can exist.
  724. These filenames correspond to the values to which
  725. users have set the
  726. <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> variable.
  727. </para>
  728. <para>
  729. These files define things such as the kernel package
  730. to use
  731. (<ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></ulink>
  732. of
  733. <ulink url='&YOCTO_DOCS_DEV_URL;#metadata-virtual-providers'>virtual/kernel</ulink>),
  734. the hardware drivers to include in different types
  735. of images, any special software components that are
  736. needed, any bootloader information, and also any
  737. special image format requirements.
  738. </para>
  739. <para>
  740. This configuration file could also include a hardware
  741. "tuning" file that is commonly used to define the
  742. package architecture and specify optimization flags,
  743. which are carefully chosen to give best performance
  744. on a given processor.
  745. </para>
  746. <para>
  747. Tuning files are found in the
  748. <filename>meta/conf/machine/include</filename>
  749. directory within the
  750. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
  751. For example, many <filename>tune-*</filename> files
  752. (e.g. <filename>tune-arm1136jf-s.inc</filename>,
  753. <filename>tun-1586-nlp.inc</filename>, and so forth)
  754. reside in the
  755. <filename>poky/meta/conf/machine/include</filename>
  756. directory.
  757. </para>
  758. <para>
  759. To use an include file, you simply include them in the
  760. machine configuration file.
  761. For example, the Raspberry Pi BSP
  762. <filename>raspberrypi3.conf</filename> contains the
  763. following statement:
  764. <literallayout class='monospaced'>
  765. include conf/machine/include/rpi-base.inc
  766. </literallayout>
  767. </para>
  768. </section>
  769. <section id='bsp-filelayout-misc-recipes'>
  770. <title>Miscellaneous BSP-Specific Recipe Files</title>
  771. <para>
  772. You can find these files in the BSP Layer at:
  773. <literallayout class='monospaced'>
  774. meta-<replaceable>bsp_root_name</replaceable>/recipes-bsp/*
  775. </literallayout>
  776. </para>
  777. <para>
  778. This optional directory contains miscellaneous recipe
  779. files for the BSP.
  780. Most notably would be the formfactor files.
  781. For example, in the Raspberry Pi BSP there is the
  782. <filename>formfactor_0.0.bbappend</filename> file,
  783. which is an append file used to augment the recipe
  784. that starts the build.
  785. Furthermore, there are machine-specific settings used
  786. during the build that are defined by the
  787. <filename>machconfig</filename> file further down in
  788. the directory.
  789. Here is the <filename>machconfig</filename> file for
  790. the Raspberry Pi BSP:
  791. <literallayout class='monospaced'>
  792. HAVE_TOUCHSCREEN=0
  793. HAVE_KEYBOARD=1
  794. DISPLAY_CAN_ROTATE=0
  795. DISPLAY_ORIENTATION=0
  796. DISPLAY_DPI=133
  797. </literallayout>
  798. </para>
  799. <note><para>
  800. If a BSP does not have a formfactor entry, defaults
  801. are established according to the formfactor
  802. configuration file that is installed by the main
  803. formfactor recipe
  804. <filename>meta/recipes-bsp/formfactor/formfactor_0.0.bb</filename>,
  805. which is found in the
  806. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
  807. </para></note>
  808. </section>
  809. <section id='bsp-filelayout-recipes-graphics'>
  810. <title>Display Support Files</title>
  811. <para>
  812. You can find these files in the BSP Layer at:
  813. <literallayout class='monospaced'>
  814. meta-<replaceable>bsp_root_name</replaceable>/recipes-graphics/*
  815. </literallayout>
  816. </para>
  817. <para>
  818. This optional directory contains recipes for the
  819. BSP if it has special requirements for graphics
  820. support.
  821. All files that are needed for the BSP to support
  822. a display are kept here.
  823. </para>
  824. </section>
  825. <section id='bsp-filelayout-kernel'>
  826. <title>Linux Kernel Configuration</title>
  827. <para>
  828. You can find these files in the BSP Layer at:
  829. <literallayout class='monospaced'>
  830. meta-<replaceable>bsp_root_name</replaceable>/recipes-kernel/linux/linux*.bbappend
  831. meta-<replaceable>bsp_root_name</replaceable>/recipes-kernel/linux/*.bb
  832. </literallayout>
  833. </para>
  834. <para>
  835. Append files (<filename>*.bbappend</filename>) modify
  836. the main kernel recipe being used to build the image.
  837. The <filename>*.bb</filename> files would be a
  838. developer-supplied kernel recipe.
  839. This area of the BSP hierarchy can contain both these
  840. types of files, although in practice, it is likely that
  841. you would have one or the other.
  842. </para>
  843. <para>
  844. For your BSP, you typically want to use an existing Yocto
  845. Project kernel recipe found in the
  846. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
  847. at <filename>meta/recipes-kernel/linux</filename>.
  848. You can append machine-specific changes to the
  849. kernel recipe by using a similarly named append
  850. file, which is located in the BSP Layer for your
  851. target device (e.g. the
  852. <filename>meta-<replaceable>bsp_root_name</replaceable>/recipes-kernel/linux</filename> directory).
  853. </para>
  854. <para>
  855. Suppose you are using the
  856. <filename>linux-yocto_4.4.bb</filename> recipe to
  857. build the kernel.
  858. In other words, you have selected the kernel in your
  859. <replaceable>bsp_root_name</replaceable><filename>.conf</filename>
  860. file by adding
  861. <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></ulink>
  862. and
  863. <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></ulink>
  864. statements as follows:
  865. <literallayout class='monospaced'>
  866. PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
  867. PREFERRED_VERSION_linux-yocto ?= "4.4%"
  868. </literallayout>
  869. <note>
  870. When the preferred provider is assumed by
  871. default, the
  872. <filename>PREFERRED_PROVIDER</filename>
  873. statement does not appear in the
  874. <replaceable>bsp_root_name</replaceable><filename>.conf</filename> file.
  875. </note>
  876. You would use the
  877. <filename>linux-yocto_4.4.bbappend</filename>
  878. file to append specific BSP settings to the kernel,
  879. thus configuring the kernel for your particular BSP.
  880. </para>
  881. <para>
  882. You can find more information on what your append file
  883. should contain in the
  884. "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#creating-the-append-file'>Creating the Append File</ulink>"
  885. section in the Yocto Project Linux Kernel Development
  886. Manual.
  887. </para>
  888. <para>
  889. An alternate scenario is when you create your own
  890. kernel recipe for the BSP.
  891. A good example of this is the Raspberry Pi BSP.
  892. If you examine the
  893. <filename>recipes-kernel/linux</filename> directory
  894. you see the following:
  895. <literallayout class='monospaced'>
  896. linux-raspberrypi-dev.bb
  897. linux-raspberrypi.inc
  898. linux-raspberrypi_4.14.bb
  899. linux-raspberrypi_4.9.bb
  900. </literallayout>
  901. The directory contains three kernel recipes and a
  902. common include file.
  903. </para>
  904. </section>
  905. </section>
  906. <section id='developing-a-board-support-package-bsp'>
  907. <title>Developing a Board Support Package (BSP)</title>
  908. <para>
  909. This section contains the high-level procedure you can
  910. follow to create a BSP.
  911. Although not required for BSP creation, the
  912. <filename>meta-intel</filename> repository, which
  913. contains many BSPs supported by the Yocto Project,
  914. is part of the example.
  915. </para>
  916. <para>
  917. For an example that shows how to create a new
  918. layer using the tools, see the
  919. "<link linkend='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>Creating a New BSP Layer Using the <filename>bitbake-layers</filename> Script</link>"
  920. section.
  921. </para>
  922. <para>
  923. The following illustration and list summarize the BSP
  924. creation general workflow.
  925. </para>
  926. <para>
  927. <imagedata fileref="figures/bsp-dev-flow.png" width="7in" depth="5in" align="center" scalefit="1" />
  928. </para>
  929. <para>
  930. <orderedlist>
  931. <listitem><para>
  932. <emphasis>Set up Your Host Development System
  933. to Support Development Using the Yocto
  934. Project</emphasis>:
  935. See the
  936. "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-preparing-the-build-host'>Preparing the Build Host</ulink>"
  937. section in the Yocto Project Development Tasks
  938. Manual for options on how to get a system ready
  939. to use the Yocto Project.
  940. </para></listitem>
  941. <listitem><para>
  942. <emphasis>Establish the
  943. <filename>meta-intel</filename>
  944. Repository on Your System:</emphasis>
  945. Having local copies of these supported BSP layers
  946. on your system gives you access to layers you
  947. might be able to leverage when creating your BSP.
  948. For information on how to get these files, see the
  949. "<link linkend='preparing-your-build-host-to-work-with-bsp-layers'>Preparing Your Build Host to Work with BSP Layers</link>"
  950. section.
  951. </para></listitem>
  952. <listitem><para>
  953. <emphasis>Create Your Own BSP Layer Using the
  954. <filename>bitbake-layers</filename>
  955. Script:</emphasis>
  956. Layers are ideal for isolating and storing work
  957. for a given piece of hardware.
  958. A layer is really just a location or area in which you
  959. place the recipes and configurations for your BSP.
  960. In fact, a BSP is, in itself, a special type of layer.
  961. The simplest way to create a new BSP layer that is
  962. compliant with the Yocto Project is to use the
  963. <filename>bitbake-layers</filename> script.
  964. For information about that script, see the
  965. "<link linkend='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>Creating a New BSP Layer Using the <filename>bitbake-layers</filename> Script</link>"
  966. section.</para>
  967. <para>Another example that illustrates a layer
  968. is an application.
  969. Suppose you are creating an application that has
  970. library or other dependencies in order for it to
  971. compile and run.
  972. The layer, in this case, would be where all the
  973. recipes that define those dependencies are kept.
  974. The key point for a layer is that it is an
  975. isolated area that contains all the relevant
  976. information for the project that the
  977. OpenEmbedded build system knows about.
  978. For more information on layers, see the
  979. "<ulink url='&YOCTO_DOCS_OM_URL;#the-yocto-project-layer-model'>The Yocto Project Layer Model</ulink>"
  980. section in the Yocto Project Overview and Concepts
  981. Manual.
  982. You can also reference the
  983. "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
  984. section in the Yocto Project Development Tasks
  985. Manual.
  986. For more information on BSP layers, see the
  987. "<link linkend='bsp-layers'>BSP Layers</link>"
  988. section.
  989. <note><title>Notes</title>
  990. <itemizedlist>
  991. <listitem><para>
  992. Five hardware reference BSPs exist
  993. that are part of the Yocto Project release
  994. and are located in the
  995. <filename>poky/meta-yocto-bsp</filename> BSP
  996. layer:
  997. <itemizedlist>
  998. <listitem><para>
  999. Texas Instruments Beaglebone
  1000. (<filename>beaglebone-yocto</filename>)
  1001. </para></listitem>
  1002. <listitem><para>
  1003. Freescale MPC8315E-RDB
  1004. (<filename>mpc8315e-rdb</filename>)
  1005. </para></listitem>
  1006. <listitem><para>
  1007. Ubiquiti Networks EdgeRouter Lite
  1008. (<filename>edgerouter</filename>)
  1009. </para></listitem>
  1010. <listitem><para>
  1011. Two general IA platforms
  1012. (<filename>genericx86</filename> and
  1013. <filename>genericx86-64</filename>)
  1014. </para></listitem>
  1015. </itemizedlist>
  1016. </para></listitem>
  1017. <listitem><para>
  1018. Three core Intel BSPs exist as part of
  1019. the Yocto Project release in the
  1020. <filename>meta-intel</filename> layer:
  1021. <itemizedlist>
  1022. <listitem><para>
  1023. <filename>intel-core2-32</filename>,
  1024. which is a BSP optimized for the Core2
  1025. family of CPUs as well as all CPUs
  1026. prior to the Silvermont core.
  1027. </para></listitem>
  1028. <listitem><para>
  1029. <filename>intel-corei7-64</filename>,
  1030. which is a BSP optimized for Nehalem
  1031. and later Core and Xeon CPUs as well
  1032. as Silvermont and later Atom CPUs,
  1033. such as the Baytrail SoCs.
  1034. </para></listitem>
  1035. <listitem><para>
  1036. <filename>intel-quark</filename>,
  1037. which is a BSP optimized for the
  1038. Intel Galileo gen1 &amp; gen2
  1039. development boards.
  1040. </para></listitem>
  1041. </itemizedlist>
  1042. </para></listitem>
  1043. </itemizedlist>
  1044. </note></para>
  1045. <para>When you set up a layer for a new BSP,
  1046. you should follow a standard layout.
  1047. This layout is described in the
  1048. "<link linkend='bsp-filelayout'>Example Filesystem Layout</link>"
  1049. section.
  1050. In the standard layout, notice the suggested
  1051. structure for recipes and configuration
  1052. information.
  1053. You can see the standard layout for a BSP
  1054. by examining any supported BSP found in the
  1055. <filename>meta-intel</filename> layer inside
  1056. the Source Directory.
  1057. </para></listitem>
  1058. <listitem><para>
  1059. <emphasis>Make Configuration Changes to Your New
  1060. BSP Layer:</emphasis>
  1061. The standard BSP layer structure organizes the
  1062. files you need to edit in
  1063. <filename>conf</filename> and several
  1064. <filename>recipes-*</filename> directories
  1065. within the BSP layer.
  1066. Configuration changes identify where your new
  1067. layer is on the local system and identifies the
  1068. kernel you are going to use.
  1069. When you run the
  1070. <filename>bitbake-layers</filename> script,
  1071. you are able to interactively configure many
  1072. things for the BSP (e.g. keyboard, touchscreen,
  1073. and so forth).
  1074. </para></listitem>
  1075. <listitem><para>
  1076. <emphasis>Make Recipe Changes to Your New BSP
  1077. Layer:</emphasis>
  1078. Recipe changes include altering recipes
  1079. (<filename>*.bb</filename> files), removing
  1080. recipes you do not use, and adding new recipes
  1081. or append files (<filename>.bbappend</filename>)
  1082. that support your hardware.
  1083. </para></listitem>
  1084. <listitem><para>
  1085. <emphasis>Prepare for the Build:</emphasis>
  1086. Once you have made all the changes to your BSP
  1087. layer, there remains a few things you need to
  1088. do for the OpenEmbedded build system in order
  1089. for it to create your image.
  1090. You need to get the build environment ready by
  1091. sourcing an environment setup script
  1092. (i.e. <filename>oe-init-build-env</filename>)
  1093. and you need to be sure two key configuration
  1094. files are configured appropriately: the
  1095. <filename>conf/local.conf</filename> and the
  1096. <filename>conf/bblayers.conf</filename> file.
  1097. You must make the OpenEmbedded build system aware
  1098. of your new layer.
  1099. See the
  1100. "<ulink url='&YOCTO_DOCS_DEV_URL;#enabling-your-layer'>Enabling Your Layer</ulink>"
  1101. section in the Yocto Project Development Tasks Manual
  1102. for information on how to let the build system
  1103. know about your new layer.
  1104. </para></listitem>
  1105. <listitem><para>
  1106. <emphasis>Build the Image:</emphasis>
  1107. The OpenEmbedded build system uses the BitBake tool
  1108. to build images based on the type of image you want to
  1109. create.
  1110. You can find more information about BitBake in the
  1111. <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
  1112. </para>
  1113. <para>The build process supports several types of
  1114. images to satisfy different needs.
  1115. See the
  1116. "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
  1117. chapter in the Yocto Project Reference Manual for
  1118. information on supported images.
  1119. </para></listitem>
  1120. </orderedlist>
  1121. </para>
  1122. </section>
  1123. <section id='requirements-and-recommendations-for-released-bsps'>
  1124. <title>Requirements and Recommendations for Released BSPs</title>
  1125. <para>
  1126. Certain requirements exist for a released BSP to be
  1127. considered compliant with the Yocto Project.
  1128. Additionally, recommendations also exist.
  1129. This section describes the requirements and
  1130. recommendations for released BSPs.
  1131. </para>
  1132. <section id='released-bsp-requirements'>
  1133. <title>Released BSP Requirements</title>
  1134. <para>
  1135. Before looking at BSP requirements, you should consider
  1136. the following:
  1137. <itemizedlist>
  1138. <listitem><para>
  1139. The requirements here assume the BSP layer
  1140. is a well-formed, "legal" layer that can be
  1141. added to the Yocto Project.
  1142. For guidelines on creating a layer that meets
  1143. these base requirements, see the
  1144. "<link linkend='bsp-layers'>BSP Layers</link>"
  1145. section in this manual and the
  1146. "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers"</ulink>"
  1147. section in the Yocto Project Development Tasks
  1148. Manual.
  1149. </para></listitem>
  1150. <listitem><para>
  1151. The requirements in this section apply
  1152. regardless of how you package a BSP.
  1153. You should consult the packaging and distribution
  1154. guidelines for your specific release process.
  1155. For an example of packaging and distribution
  1156. requirements, see the
  1157. "<ulink url='https://wiki.yoctoproject.org/wiki/Third_Party_BSP_Release_Process'>Third Party BSP Release Process</ulink>"
  1158. wiki page.
  1159. </para></listitem>
  1160. <listitem><para>
  1161. The requirements for the BSP as it is made
  1162. available to a developer are completely
  1163. independent of the released form of the BSP.
  1164. For example, the BSP Metadata can be contained
  1165. within a Git repository and could have a directory
  1166. structure completely different from what appears
  1167. in the officially released BSP layer.
  1168. </para></listitem>
  1169. <listitem><para>
  1170. It is not required that specific packages or
  1171. package modifications exist in the BSP layer,
  1172. beyond the requirements for general
  1173. compliance with the Yocto Project.
  1174. For example, no requirement exists dictating
  1175. that a specific kernel or kernel version be
  1176. used in a given BSP.
  1177. </para></listitem>
  1178. </itemizedlist>
  1179. </para>
  1180. <para>
  1181. Following are the requirements for a released BSP
  1182. that conform to the Yocto Project:
  1183. <itemizedlist>
  1184. <listitem><para>
  1185. <emphasis>Layer Name:</emphasis>
  1186. The BSP must have a layer name that follows
  1187. the Yocto Project standards.
  1188. For information on BSP layer names, see the
  1189. "<link linkend='bsp-layers'>BSP Layers</link>" section.
  1190. </para></listitem>
  1191. <listitem><para>
  1192. <emphasis>File System Layout:</emphasis>
  1193. When possible, use the same directory names
  1194. in your BSP layer as listed in the
  1195. <filename>recipes.txt</filename> file, which
  1196. is found in <filename>poky/meta</filename>
  1197. directory of the
  1198. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
  1199. or in the OpenEmbedded-Core Layer
  1200. (<filename>openembedded-core</filename>) at
  1201. <ulink url='http://git.openembedded.org/openembedded-core/tree/meta'></ulink>.
  1202. </para>
  1203. <para>You should place recipes
  1204. (<filename>*.bb</filename> files) and recipe
  1205. modifications (<filename>*.bbappend</filename>
  1206. files) into <filename>recipes-*</filename>
  1207. subdirectories by functional area as outlined
  1208. in <filename>recipes.txt</filename>.
  1209. If you cannot find a category in
  1210. <filename>recipes.txt</filename> to fit a
  1211. particular recipe, you can make up your own
  1212. <filename>recipes-*</filename> subdirectory.
  1213. </para>
  1214. <para>Within any particular
  1215. <filename>recipes-*</filename> category, the
  1216. layout should match what is found in the
  1217. OpenEmbedded-Core Git repository
  1218. (<filename>openembedded-core</filename>)
  1219. or the Source Directory (<filename>poky</filename>).
  1220. In other words, make sure you place related
  1221. files in appropriately related
  1222. <filename>recipes-*</filename> subdirectories
  1223. specific to the recipe's function, or within
  1224. a subdirectory containing a set of closely-related
  1225. recipes.
  1226. The recipes themselves should follow the general
  1227. guidelines for recipes used in the Yocto Project
  1228. found in the
  1229. "<ulink url='http://openembedded.org/wiki/Styleguide'>OpenEmbedded Style Guide</ulink>".
  1230. </para></listitem>
  1231. <listitem><para>
  1232. <emphasis>License File:</emphasis>
  1233. You must include a license file in the
  1234. <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
  1235. directory.
  1236. This license covers the BSP Metadata as a whole.
  1237. You must specify which license to use since no
  1238. default license exists when one not specified.
  1239. See the
  1240. <ulink url='&YOCTO_GIT_URL;/cgit.cgi/meta-raspberrypi/tree/COPYING.MIT'><filename>COPYING.MIT</filename></ulink>
  1241. file for the Raspberry Pi BSP in the
  1242. <filename>meta-raspberrypi</filename> BSP layer
  1243. as an example.
  1244. </para></listitem>
  1245. <listitem><para>
  1246. <emphasis>README File:</emphasis>
  1247. You must include a <filename>README</filename>
  1248. file in the
  1249. <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
  1250. directory.
  1251. See the
  1252. <ulink url='&YOCTO_GIT_URL;/cgit.cgi/meta-raspberrypi/tree/README.md'><filename>README.md</filename></ulink>
  1253. file for the Raspberry Pi BSP in the
  1254. <filename>meta-raspberrypi</filename> BSP layer
  1255. as an example.</para>
  1256. <para>At a minimum, the <filename>README</filename>
  1257. file should contain the following:
  1258. <itemizedlist>
  1259. <listitem><para>
  1260. A brief description about the hardware the BSP
  1261. targets.
  1262. </para></listitem>
  1263. <listitem><para>
  1264. A list of all the dependencies
  1265. on which a BSP layer depends.
  1266. These dependencies are typically a list
  1267. of required layers needed to build the
  1268. BSP.
  1269. However, the dependencies should also
  1270. contain information regarding any other
  1271. dependencies the BSP might have.
  1272. </para></listitem>
  1273. <listitem><para>
  1274. Any required special licensing information.
  1275. For example, this information includes
  1276. information on special variables needed
  1277. to satisfy a EULA, or instructions on
  1278. information needed to build or distribute
  1279. binaries built from the BSP Metadata.
  1280. </para></listitem>
  1281. <listitem><para>
  1282. The name and contact information for the
  1283. BSP layer maintainer.
  1284. This is the person to whom patches and
  1285. questions should be sent.
  1286. For information on how to find the right
  1287. person, see the
  1288. "<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>Submitting a Change to the Yocto Project</ulink>"
  1289. section in the Yocto Project Development
  1290. Tasks Manual.
  1291. </para></listitem>
  1292. <listitem><para>
  1293. Instructions on how to build the BSP using
  1294. the BSP layer.
  1295. </para></listitem>
  1296. <listitem><para>
  1297. Instructions on how to boot the BSP build
  1298. from the BSP layer.
  1299. </para></listitem>
  1300. <listitem><para>
  1301. Instructions on how to boot the binary
  1302. images contained in the
  1303. <filename>binary</filename> directory,
  1304. if present.
  1305. </para></listitem>
  1306. <listitem><para>
  1307. Information on any known bugs or issues
  1308. that users should know about when either
  1309. building or booting the BSP binaries.
  1310. </para></listitem>
  1311. </itemizedlist>
  1312. </para></listitem>
  1313. <listitem><para>
  1314. <emphasis>README.sources File:</emphasis>
  1315. If you BSP contains binary images in the
  1316. <filename>binary</filename> directory, you must
  1317. include a <filename>README.sources</filename>
  1318. file in the
  1319. <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
  1320. directory.
  1321. This file specifies exactly where you can find
  1322. the sources used to generate the binary images.
  1323. </para></listitem>
  1324. <listitem><para>
  1325. <emphasis>Layer Configuration File:</emphasis>
  1326. You must include a
  1327. <filename>conf/layer.conf</filename> file in
  1328. the
  1329. <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
  1330. directory.
  1331. This file identifies the
  1332. <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
  1333. BSP layer as a layer to the build system.
  1334. </para></listitem>
  1335. <listitem><para>
  1336. <emphasis>Machine Configuration File:</emphasis>
  1337. You must include one or more
  1338. <filename>conf/machine/</filename><replaceable>bsp_root_name</replaceable><filename>.conf</filename>
  1339. files in the
  1340. <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
  1341. directory.
  1342. These configuration files define machine targets
  1343. that can be built using the BSP layer.
  1344. Multiple machine configuration files define
  1345. variations of machine configurations that the
  1346. BSP supports.
  1347. If a BSP supports multiple machine variations,
  1348. you need to adequately describe each variation
  1349. in the BSP <filename>README</filename> file.
  1350. Do not use multiple machine configuration files
  1351. to describe disparate hardware.
  1352. If you do have very different targets, you should
  1353. create separate BSP layers for each target.
  1354. <note>
  1355. It is completely possible for a developer to
  1356. structure the working repository as a
  1357. conglomeration of unrelated BSP files, and to
  1358. possibly generate BSPs targeted for release
  1359. from that directory using scripts or some
  1360. other mechanism
  1361. (e.g. <filename>meta-yocto-bsp</filename> layer).
  1362. Such considerations are outside the scope of
  1363. this document.
  1364. </note>
  1365. </para></listitem>
  1366. </itemizedlist>
  1367. </para>
  1368. </section>
  1369. <section id='released-bsp-recommendations'>
  1370. <title>Released BSP Recommendations</title>
  1371. <para>
  1372. Following are recommendations for released BSPs that
  1373. conform to the Yocto Project:
  1374. <itemizedlist>
  1375. <listitem><para>
  1376. <emphasis>Bootable Images:</emphasis>
  1377. Released BSPs can contain one or more bootable
  1378. images.
  1379. Including bootable images allows users to easily
  1380. try out the BSP using their own hardware.</para>
  1381. <para>In some cases, it might not be convenient
  1382. to include a bootable image.
  1383. If so, you might want to make two versions of the
  1384. BSP available: one that contains binary images, and
  1385. one that does not.
  1386. The version that does not contain bootable images
  1387. avoids unnecessary download times for users not
  1388. interested in the images.</para>
  1389. <para>If you need to distribute a BSP and include
  1390. bootable images or build kernel and filesystems
  1391. meant to allow users to boot the BSP for evaluation
  1392. purposes, you should put the images and artifacts
  1393. within a
  1394. <filename>binary/</filename> subdirectory located
  1395. in the
  1396. <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
  1397. directory.
  1398. <note>
  1399. If you do include a bootable image as part
  1400. of the BSP and the image was built by software
  1401. covered by the GPL or other open source licenses,
  1402. it is your responsibility to understand
  1403. and meet all licensing requirements, which could
  1404. include distribution of source files.
  1405. </note>
  1406. </para></listitem>
  1407. <listitem><para>
  1408. <emphasis>Use a Yocto Linux Kernel:</emphasis>
  1409. Kernel recipes in the BSP should be based on a
  1410. Yocto Linux kernel.
  1411. Basing your recipes on these kernels reduces
  1412. the costs for maintaining the BSP and increases
  1413. its scalability.
  1414. See the <filename>Yocto Linux Kernel</filename>
  1415. category in the
  1416. <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>
  1417. for these kernels.
  1418. </para></listitem>
  1419. </itemizedlist>
  1420. </para>
  1421. </section>
  1422. </section>
  1423. <section id='customizing-a-recipe-for-a-bsp'>
  1424. <title>Customizing a Recipe for a BSP</title>
  1425. <para>
  1426. If you plan on customizing a recipe for a particular BSP,
  1427. you need to do the following:
  1428. <itemizedlist>
  1429. <listitem><para>
  1430. Create a <filename>*.bbappend</filename> file for
  1431. the modified recipe.
  1432. For information on using append files, see the
  1433. "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>"
  1434. section in the Yocto Project Development Tasks
  1435. Manual.
  1436. </para></listitem>
  1437. <listitem><para>
  1438. Ensure your directory structure in the BSP layer
  1439. that supports your machine is such that the
  1440. OpenEmbedded build system can find it.
  1441. See the example later in this section for more
  1442. information.
  1443. </para></listitem>
  1444. <listitem><para>
  1445. Put the append file in a directory whose name matches
  1446. the machine's name and is located in an appropriate
  1447. sub-directory inside the BSP layer (i.e.
  1448. <filename>recipes-bsp</filename>,
  1449. <filename>recipes-graphics</filename>,
  1450. <filename>recipes-core</filename>, and so forth).
  1451. </para></listitem>
  1452. <listitem><para>
  1453. Place the BSP-specific files in the proper
  1454. directory inside the BSP layer.
  1455. How expansive the layer is affects where you must
  1456. place these files.
  1457. For example, if your layer supports several
  1458. different machine types, you need to be sure your
  1459. layer's directory structure includes hierarchy
  1460. that separates the files according to machine.
  1461. If your layer does not support multiple machines,
  1462. the layer would not have that additional hierarchy
  1463. and the files would obviously not be able to reside
  1464. in a machine-specific directory.
  1465. </para></listitem>
  1466. </itemizedlist>
  1467. </para>
  1468. <para>
  1469. Following is a specific example to help you better understand
  1470. the process.
  1471. This example customizes customizes a recipe by adding a
  1472. BSP-specific configuration file named
  1473. <filename>interfaces</filename> to the
  1474. <filename>init-ifupdown_1.0.bb</filename> recipe for machine
  1475. "xyz" where the BSP layer also supports several other
  1476. machines:
  1477. <orderedlist>
  1478. <listitem><para>
  1479. Edit the
  1480. <filename>init-ifupdown_1.0.bbappend</filename> file
  1481. so that it contains the following:
  1482. <literallayout class='monospaced'>
  1483. FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
  1484. </literallayout>
  1485. The append file needs to be in the
  1486. <filename>meta-xyz/recipes-core/init-ifupdown</filename>
  1487. directory.
  1488. </para></listitem>
  1489. <listitem><para>
  1490. Create and place the new
  1491. <filename>interfaces</filename> configuration file in
  1492. the BSP's layer here:
  1493. <literallayout class='monospaced'>
  1494. meta-xyz/recipes-core/init-ifupdown/files/xyz-machine-one/interfaces
  1495. </literallayout>
  1496. <note>
  1497. If the <filename>meta-xyz</filename> layer did
  1498. not support multiple machines, you would place
  1499. the <filename>interfaces</filename> configuration
  1500. file in the layer here:
  1501. <literallayout class='monospaced'>
  1502. meta-xyz/recipes-core/init-ifupdown/files/interfaces
  1503. </literallayout>
  1504. </note>
  1505. The
  1506. <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
  1507. variable in the append files extends the search path
  1508. the build system uses to find files during the build.
  1509. Consequently, for this example you need to have the
  1510. <filename>files</filename> directory in the same
  1511. location as your append file.
  1512. </para></listitem>
  1513. </orderedlist>
  1514. </para>
  1515. </section>
  1516. <section id='bsp-licensing-considerations'>
  1517. <title>BSP Licensing Considerations</title>
  1518. <para>
  1519. In some cases, a BSP contains separately licensed
  1520. Intellectual Property (IP) for a component or components.
  1521. For these cases, you are required to accept the terms
  1522. of a commercial or other type of license that requires
  1523. some kind of explicit End User License Agreement (EULA).
  1524. Once you accept the license, the OpenEmbedded build system
  1525. can then build and include the corresponding component
  1526. in the final BSP image.
  1527. If the BSP is available as a pre-built image, you can
  1528. download the image after agreeing to the license or EULA.
  1529. </para>
  1530. <para>
  1531. You could find that some separately licensed components
  1532. that are essential for normal operation of the system might
  1533. not have an unencumbered (or free) substitute.
  1534. Without these essential components, the system would be
  1535. non-functional.
  1536. Then again, you might find that other licensed components
  1537. that are simply 'good-to-have' or purely elective do have
  1538. an unencumbered, free replacement component that you can
  1539. use rather than agreeing to the separately licensed
  1540. component.
  1541. Even for components essential to the system, you might
  1542. find an unencumbered component that is not identical but
  1543. will work as a less-capable version of the licensed version
  1544. in the BSP recipe.
  1545. </para>
  1546. <para>
  1547. For cases where you can substitute a free component and
  1548. still maintain the system's functionality, the "DOWNLOADS"
  1549. selection from the "SOFTWARE" tab on the
  1550. <ulink url='&YOCTO_HOME_URL;'>Yocto Project website</ulink>
  1551. makes available de-featured BSPs that are completely free
  1552. of any IP encumbrances.
  1553. For these cases, you can use the substitution directly and
  1554. without any further licensing requirements.
  1555. If present, these fully de-featured BSPs are named
  1556. appropriately different as compared to the names of their
  1557. respective encumbered BSPs.
  1558. If available, these substitutions are your simplest and
  1559. most preferred options.
  1560. Obviously, use of these substitutions assumes the resulting
  1561. functionality meets system requirements.
  1562. <note>
  1563. If however, a non-encumbered version is unavailable or
  1564. it provides unsuitable functionality or quality, you can
  1565. use an encumbered version.
  1566. </note>
  1567. </para>
  1568. <para>
  1569. A couple different methods exist within the OpenEmbedded
  1570. build system to satisfy the licensing requirements for an
  1571. encumbered BSP.
  1572. The following list describes them in order of preference:
  1573. <orderedlist>
  1574. <listitem><para>
  1575. <emphasis>Use the
  1576. <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE_FLAGS'><filename>LICENSE_FLAGS</filename></ulink>
  1577. Variable to Define the Recipes that Have Commercial
  1578. or Other Types of Specially-Licensed Packages:</emphasis>
  1579. For each of those recipes, you can specify a
  1580. matching license string in a
  1581. <filename>local.conf</filename> variable named
  1582. <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE_FLAGS_WHITELIST'><filename>LICENSE_FLAGS_WHITELIST</filename></ulink>.
  1583. Specifying the matching license string signifies
  1584. that you agree to the license.
  1585. Thus, the build system can build the corresponding
  1586. recipe and include the component in the image.
  1587. See the
  1588. "<ulink url='&YOCTO_DOCS_DEV_URL;#enabling-commercially-licensed-recipes'>Enabling Commercially Licensed Recipes</ulink>"
  1589. section in the Yocto Project Development Tasks
  1590. Manual for details on how to use these variables.
  1591. </para>
  1592. <para>If you build as you normally would, without
  1593. specifying any recipes in the
  1594. <filename>LICENSE_FLAGS_WHITELIST</filename>, the
  1595. build stops and provides you with the list of recipes
  1596. that you have tried to include in the image that
  1597. need entries in the
  1598. <filename>LICENSE_FLAGS_WHITELIST</filename>.
  1599. Once you enter the appropriate license flags into
  1600. the whitelist, restart the build to continue where
  1601. it left off.
  1602. During the build, the prompt will not appear again
  1603. since you have satisfied the requirement.</para>
  1604. <para>Once the appropriate license flags are on the
  1605. white list in the
  1606. <filename>LICENSE_FLAGS_WHITELIST</filename> variable,
  1607. you can build the encumbered image with no change
  1608. at all to the normal build process.
  1609. </para></listitem>
  1610. <listitem><para>
  1611. <emphasis>Get a Pre-Built Version of the BSP:</emphasis>
  1612. You can get this type of BSP by selecting the
  1613. "DOWNLOADS" item from the "SOFTWARE" tab on the
  1614. <ulink url='&YOCTO_HOME_URL;'>Yocto Project website</ulink>.
  1615. You can download BSP tarballs that contain
  1616. proprietary components after agreeing to the
  1617. licensing requirements of each of the individually
  1618. encumbered packages as part of the download process.
  1619. Obtaining the BSP this way allows you to access an
  1620. encumbered image immediately after agreeing to the
  1621. click-through license agreements presented by the
  1622. website.
  1623. If you want to build the image yourself using
  1624. the recipes contained within the BSP tarball,
  1625. you will still need to create an appropriate
  1626. <filename>LICENSE_FLAGS_WHITELIST</filename>
  1627. to match the encumbered recipes in the BSP.
  1628. </para></listitem>
  1629. </orderedlist>
  1630. <note>
  1631. Pre-compiled images are bundled with a time-limited
  1632. kernel that runs for a predetermined amount of time
  1633. (10 days) before it forces the system to reboot.
  1634. This limitation is meant to discourage direct
  1635. redistribution of the image.
  1636. You must eventually rebuild the image if you want
  1637. to remove this restriction.
  1638. </note>
  1639. </para>
  1640. </section>
  1641. <section id='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>
  1642. <title>Creating a new BSP Layer Using the <filename>bitbake-layers</filename> Script</title>
  1643. <para>
  1644. The <filename>bitbake-layers create-layer</filename> script
  1645. automates creating a BSP layer.
  1646. What makes a layer a "BSP layer", is the presence of a machine
  1647. configuration file.
  1648. Additionally, a BSP layer usually has a kernel recipe
  1649. or an append file that leverages off an existing kernel recipe.
  1650. The primary requirement, however, is the machine configuration.
  1651. </para>
  1652. <para>
  1653. Use these steps to create a BSP layer:
  1654. <itemizedlist>
  1655. <listitem><para>
  1656. <emphasis>Create a General Layer:</emphasis>
  1657. Use the <filename>bitbake-layers</filename> script with the
  1658. <filename>create-layer</filename> subcommand to create a
  1659. new general layer.
  1660. For instructions on how to create a general layer using the
  1661. <filename>bitbake-layers</filename> script, see the
  1662. "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
  1663. section in the Yocto Project Development Tasks Manual.
  1664. </para></listitem>
  1665. <listitem><para>
  1666. <emphasis>Create a Layer Configuration File:</emphasis>
  1667. Every layer needs a layer configuration file.
  1668. This configuration file establishes locations for the
  1669. layer's recipes, priorities for the layer, and so forth.
  1670. You can find examples of <filename>layer.conf</filename>
  1671. files in the Yocto Project
  1672. <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>.
  1673. To get examples of what you need in your configuration
  1674. file, locate a layer (e.g. "meta-ti") and examine the
  1675. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/meta-ti/tree/conf/layer.conf'></ulink>
  1676. file.
  1677. </para></listitem>
  1678. <listitem><para>
  1679. <emphasis>Create a Machine Configuration File:</emphasis>
  1680. Create a <filename>conf/machine/</filename><replaceable>bsp_root_name</replaceable><filename>.conf</filename>
  1681. file.
  1682. See
  1683. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-yocto-bsp/conf/machine'><filename>meta-yocto-bsp/conf/machine</filename></ulink>
  1684. for sample
  1685. <replaceable>bsp_root_name</replaceable><filename>.conf</filename>
  1686. files.
  1687. Other samples such as
  1688. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/meta-ti/tree/conf/machine'><filename>meta-ti</filename></ulink>
  1689. and
  1690. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/meta-freescale/tree/conf/machine'><filename>meta-freescale</filename></ulink>
  1691. exist from other vendors that have more specific machine
  1692. and tuning examples.
  1693. </para></listitem>
  1694. <listitem><para>
  1695. <emphasis>Create a Kernel Recipe:</emphasis>
  1696. Create a kernel recipe in <filename>recipes-kernel/linux</filename>
  1697. by either using a kernel append file or a new custom kernel
  1698. recipe file (e.g. <filename>yocto-linux_4.12.bb</filename>).
  1699. The BSP layers mentioned in the previous step also contain different
  1700. kernel examples.
  1701. See the
  1702. "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#modifying-an-existing-recipe'>Modifying an Existing Recipe</ulink>"
  1703. section in the Yocto Project Linux Kernel Development Manual
  1704. for information on how to create a custom kernel.
  1705. </para></listitem>
  1706. </itemizedlist>
  1707. </para>
  1708. <para>
  1709. The remainder of this section provides a description of
  1710. the Yocto Project reference BSP for Beaglebone, which
  1711. resides in the
  1712. <ulink url='&YOCTO_DOCS_REF_URL;#term-container-layer'>Container Layer</ulink>
  1713. (i.e.
  1714. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-yocto-bsp'><filename>meta-yocto-bsp</filename></ulink>).
  1715. </para>
  1716. <section id='bsp-layer-configuration-example'>
  1717. <title>BSP Layer Configuration Example</title>
  1718. <para>
  1719. The layer's <filename>conf</filename> directory
  1720. contains the <filename>layer.conf</filename>
  1721. configuration file.
  1722. In this example, the
  1723. <filename>conf/layer.conf</filename> is the
  1724. following:
  1725. <literallayout class='monospaced'>
  1726. # We have a conf and classes directory, add to BBPATH
  1727. BBPATH .= ":${LAYERDIR}"
  1728. # We have recipes-* directories, add to BBFILES
  1729. BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
  1730. ${LAYERDIR}/recipes-*/*/*.bbappend"
  1731. BBFILE_COLLECTIONS += "yoctobsp"
  1732. BBFILE_PATTERN_yoctobsp = "^${LAYERDIR}/"
  1733. BBFILE_PRIORITY_yoctobsp = "5"
  1734. LAYERVERSION_yoctobsp = "4"
  1735. LAYERSERIES_COMPAT_yoctobsp = "&DISTRO_NAME_NO_CAP;"
  1736. </literallayout>
  1737. The variables used in this file configure the
  1738. layer.
  1739. A good way to learn about layer configuration
  1740. files is to examine various files for BSP from
  1741. the
  1742. <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>.
  1743. </para>
  1744. <para>
  1745. For a detailed description of this particular
  1746. layer configuration file, see
  1747. "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-layer-config-file-description'>step 3</ulink>
  1748. in the discussion that describes how to create
  1749. layers in the Yocto Project Development Tasks Manual.
  1750. </para>
  1751. </section>
  1752. <section id='bsp-machine-configuration-example'>
  1753. <title>BSP Machine Configuration Example</title>
  1754. <para>
  1755. As mentioned earlier in this section, the existence
  1756. of a machine configuration file is what makes a
  1757. layer a BSP layer as compared to a general or
  1758. kernel layer.
  1759. </para>
  1760. <para>
  1761. Machine configuration files exist in the
  1762. <replaceable>bsp_layer</replaceable><filename>/conf/machine/</filename>
  1763. directory of the layer:
  1764. <literallayout class='monospaced'>
  1765. <replaceable>bsp_layer</replaceable><filename>/conf/machine/</filename><replaceable>machine</replaceable><filename>.conf</filename>
  1766. </literallayout>
  1767. For example, the machine configuration file for the
  1768. <ulink url='http://beagleboard.org/bone'>BeagleBone and BeagleBone Black development boards</ulink>
  1769. is located in the container layer
  1770. <filename>poky/meta-yocto-bsp/conf/machine</filename>
  1771. and is named <filename>beaglebone-yocto.conf</filename>:
  1772. <literallayout class='monospaced'>
  1773. #@TYPE: Machine
  1774. #@NAME: Beaglebone-yocto machine
  1775. #@DESCRIPTION: Reference machine configuration for http://beagleboard.org/bone and http://beagleboard.org/black boards
  1776. PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
  1777. XSERVER ?= "xserver-xorg \
  1778. xf86-video-modesetting \
  1779. "
  1780. MACHINE_EXTRA_RRECOMMENDS = "kernel-modules kernel-devicetree"
  1781. EXTRA_IMAGEDEPENDS += "u-boot"
  1782. DEFAULTTUNE ?= "cortexa8hf-neon"
  1783. include conf/machine/include/tune-cortexa8.inc
  1784. IMAGE_FSTYPES += "tar.bz2 jffs2 wic wic.bmap"
  1785. EXTRA_IMAGECMD_jffs2 = "-lnp "
  1786. WKS_FILE ?= "beaglebone-yocto.wks"
  1787. IMAGE_INSTALL_append = " kernel-devicetree kernel-image-zimage"
  1788. do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
  1789. SERIAL_CONSOLES = "115200;ttyO0"
  1790. PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
  1791. PREFERRED_VERSION_linux-yocto ?= "4.12%"
  1792. KERNEL_IMAGETYPE = "zImage"
  1793. KERNEL_DEVICETREE = "am335x-bone.dtb am335x-boneblack.dtb am335x-bonegreen.dtb"
  1794. KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
  1795. SPL_BINARY = "MLO"
  1796. UBOOT_SUFFIX = "img"
  1797. UBOOT_MACHINE = "am335x_boneblack_config"
  1798. UBOOT_ENTRYPOINT = "0x80008000"
  1799. UBOOT_LOADADDRESS = "0x80008000"
  1800. MACHINE_FEATURES = "usbgadget usbhost vfat alsa"
  1801. IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO"
  1802. </literallayout>
  1803. The variables used to configure the machine define
  1804. machine-specific properties.
  1805. For example, machine-dependent packages, machine
  1806. tunings, the type of kernel to build, and
  1807. U-Boot configurations.
  1808. </para>
  1809. <para>
  1810. The following list provides some explanation
  1811. for the statements found in the example reference
  1812. machine configuration file for the BeagleBone
  1813. development boards.
  1814. Realize that much more can be defined as part of
  1815. a machines configuration file.
  1816. In general, you can learn about related variables
  1817. that this example does not have by locating the
  1818. variables in the
  1819. "<ulink url='&YOCTO_DOCS_REF_URL;#ref-variables-glos'>Yocto Project Variables Glossary</ulink>"
  1820. in the Yocto Project Reference Manual.
  1821. <itemizedlist>
  1822. <listitem><para>
  1823. <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER_virtual/xserver</filename></ulink>:
  1824. The recipe that provides "virtual/xserver" when
  1825. more than one provider is found.
  1826. In this case, the recipe that provides
  1827. "virtual/xserver" is "xserver-xorg", which
  1828. exists in
  1829. <filename>poky/meta/recipes-graphics/xserver-xorg</filename>.
  1830. </para></listitem>
  1831. <listitem><para>
  1832. <ulink url='&YOCTO_DOCS_REF_URL;#var-XSERVER'><filename>XSERVER</filename></ulink>:
  1833. The packages that should be installed to provide
  1834. an X server and drivers for the machine.
  1835. In this example, the "xserver-xorg" and
  1836. "xf86-video-modesetting" are installed.
  1837. </para></listitem>
  1838. <listitem><para>
  1839. <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RRECOMMENDS'><filename>MACHINE_EXTRA_RRECOMMENDS</filename></ulink>:
  1840. A list of machine-dependent packages
  1841. not essential for booting the image.
  1842. Thus, the build does not fail if the packages
  1843. do not exist.
  1844. However, the packages are required for a
  1845. fully-featured image.
  1846. <note><title>Tip</title>
  1847. Many <filename>MACHINE*</filename> variables
  1848. exist that help you configure a particular
  1849. piece of hardware.
  1850. </note>
  1851. </para></listitem>
  1852. <listitem><para>
  1853. <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGEDEPENDS'><filename>EXTRA_IMAGEDEPENDS</filename></ulink>:
  1854. Recipes to build that do not provide packages
  1855. for installing into the root filesystem
  1856. but building the image depends on the
  1857. recipes.
  1858. Sometimes a recipe is required to build
  1859. the final image but is not needed in the
  1860. root filesystem.
  1861. In this case, the U-Boot recipe must be
  1862. built for the image.
  1863. </para></listitem>
  1864. <listitem><para>
  1865. <ulink url='&YOCTO_DOCS_REF_URL;#var-DEFAULTTUNE'><filename>DEFAULTTUNE</filename></ulink>:
  1866. Machines use tunings to optimize machine,
  1867. CPU, and application performance.
  1868. These features, which are collectively known
  1869. as "tuning features", exist in the
  1870. <ulink url='&YOCTO_DOCS_REF_URL;#oe-core'>OpenEmbedded-Core (OE-Core)</ulink>
  1871. layer (e.g.
  1872. <filename>poky/meta/conf/machine/include</filename>).
  1873. In this example, the default tunning file is
  1874. "cortexa8hf-neon".
  1875. <note>
  1876. The <filename>include</filename> statement
  1877. that pulls in the
  1878. <filename>conf/machine/include/tune-cortexa8.inc</filename>
  1879. file provides many tuning possibilities.
  1880. </note>
  1881. </para></listitem>
  1882. <listitem><para>
  1883. <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></ulink>:
  1884. The formats the OpenEmbedded build system
  1885. uses during the build when creating the
  1886. root filesystem.
  1887. In this example, four types of images are
  1888. supported.
  1889. </para></listitem>
  1890. <listitem><para>
  1891. <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGECMD'><filename>EXTRA_IMAGECMD</filename></ulink>:
  1892. Specifies additional options for image
  1893. creation commands.
  1894. In this example, the "-lnp " option is used
  1895. when creating the
  1896. <ulink url='https://en.wikipedia.org/wiki/JFFS2'>JFFS2</ulink>
  1897. image.
  1898. </para></listitem>
  1899. <listitem><para>
  1900. <ulink url='&YOCTO_DOCS_REF_URL;#var-WKS_FILE'><filename>WKS_FILE</filename></ulink>:
  1901. The location of the
  1902. <ulink url='&YOCTO_DOCS_REF_URL;#ref-kickstart'>Wic kickstart</ulink>
  1903. file used by the OpenEmbedded build system to
  1904. create a partitioned image (image.wic).
  1905. </para></listitem>
  1906. <listitem><para>
  1907. <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>:
  1908. Specifies packages to install into an image
  1909. through the
  1910. <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-image'><filename>image</filename></ulink>
  1911. class.
  1912. Recipes use the <filename>IMAGE_INSTALL</filename>
  1913. variable.
  1914. </para></listitem>
  1915. <listitem><para>
  1916. <filename>do_image_wic[depends]</filename>:
  1917. A task that is constructed during the build.
  1918. In this example, the task depends on specific tools
  1919. in order to create the sysroot when buiding a Wic
  1920. image.
  1921. </para></listitem>
  1922. <listitem><para>
  1923. <ulink url='&YOCTO_DOCS_REF_URL;#var-SERIAL_CONSOLES'><filename>SERIAL_CONSOLES</filename></ulink>:
  1924. Defines a serial console (TTY) to enable using
  1925. getty.
  1926. In this case, the baud rate is "115200" and the
  1927. device name is "ttyO0".
  1928. </para></listitem>
  1929. <listitem><para>
  1930. <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER_virtual/kernel</filename></ulink>:
  1931. Specifies the recipe that provides
  1932. "virtual/kernel" when more than one provider
  1933. is found.
  1934. In this case, the recipe that provides
  1935. "virtual/kernel" is "linux-yocto", which
  1936. exists in the layer's
  1937. <filename>recipes-kernel/linux</filename> directory.
  1938. </para></listitem>
  1939. <listitem><para>
  1940. <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_VERSION'><filename>PREFERRED_VERSION_linux-yocto</filename></ulink>:
  1941. Defines the version of the recipe used
  1942. to build the kernel, which is "4.12" in this
  1943. case.
  1944. </para></listitem>
  1945. <listitem><para>
  1946. <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_IMAGETYPE'><filename>KERNEL_IMAGETYPE</filename></ulink>:
  1947. The type of kernel to build for the device.
  1948. In this case, the OpenEmbedded build system
  1949. creates a "zImage" image type.
  1950. </para></listitem>
  1951. <listitem><para>
  1952. <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_DEVICETREE'><filename>KERNEL_DEVICETREE</filename></ulink>:
  1953. The name of the generated Linux kernel device
  1954. tree (i.e. the <filename>.dtb</filename>) file.
  1955. All the device trees for the various BeagleBone
  1956. devices are included.
  1957. <!--
  1958. You have to include some *.inc files according to the definition of KERNEL_DEVICETREE.
  1959. I don't see where these are being provided.
  1960. -->
  1961. </para></listitem>
  1962. <listitem><para>
  1963. <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_EXTRA_ARGS'><filename>KERNEL_EXTRA_ARGS</filename></ulink>:
  1964. Additional <filename>make</filename>
  1965. command-line arguments the OpenEmbedded build
  1966. system passes on when compiling the kernel.
  1967. In this example, "LOADADDR=${UBOOT_ENTRYPOINT}"
  1968. is passed as a command-line argument.
  1969. </para></listitem>
  1970. <listitem><para>
  1971. <ulink url='&YOCTO_DOCS_REF_URL;#var-SPL_BINARY'><filename>SPL_BINARY</filename></ulink>:
  1972. Defines the Secondary Program Loader (SPL) binary
  1973. type.
  1974. In this case, the SPL binary is set to
  1975. "MLO", which stands for Multimedia card LOader.
  1976. </para>
  1977. <para>The BeagleBone development board requires an
  1978. SPL to boot and that SPL file type must be MLO.
  1979. Consequently, the machine configuration needs to
  1980. define <filename>SPL_BINARY</filename> as "MLO".
  1981. <note>
  1982. For more information on how the SPL variables
  1983. are used, see the
  1984. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/recipes-bsp/u-boot/u-boot.inc'><filename>u-boot.inc</filename></ulink>
  1985. include file.
  1986. </note>
  1987. </para></listitem>
  1988. <listitem><para>
  1989. <ulink url='&YOCTO_DOCS_REF_URL;#var-UBOOT_ENTRYPOINT'><filename>UBOOT_*</filename></ulink>:
  1990. Defines various U-Boot configurations needed
  1991. to build a U-Boot image.
  1992. In this example, a U-Boot image is required
  1993. to boot the BeagleBone device.
  1994. See the following variables for more information:
  1995. <itemizedlist>
  1996. <listitem><para>
  1997. <ulink url='&YOCTO_DOCS_REF_URL;#var-UBOOT_SUFFIX'><filename>UBOOT_SUFFIX</filename></ulink>:
  1998. Points to the generated U-Boot extension.
  1999. </para></listitem>
  2000. <listitem><para>
  2001. <ulink url='&YOCTO_DOCS_REF_URL;#var-UBOOT_MACHINE'><filename>UBOOT_MACHINE</filename></ulink>:
  2002. Specifies the value passed on the make command line when building a U-Boot image.
  2003. </para></listitem>
  2004. <listitem><para>
  2005. <ulink url='&YOCTO_DOCS_REF_URL;#var-UBOOT_ENTRYPOINT'><filename>UBOOT_ENTRYPOINT</filename></ulink>:
  2006. Specifies the entry point for the U-Boot image.
  2007. </para></listitem>
  2008. <listitem><para>
  2009. <ulink url='&YOCTO_DOCS_REF_URL;#var-UBOOT_LOADADDRESS'><filename>UBOOT_LOADADDRESS</filename></ulink>:
  2010. Specifies the load address for the U-Boot image.
  2011. </para></listitem>
  2012. </itemizedlist>
  2013. </para></listitem>
  2014. <listitem><para>
  2015. <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></ulink>:
  2016. Specifies the list of hardware features the
  2017. BeagleBone device is capable of supporting.
  2018. In this case, the device supports
  2019. "usbgadget usbhost vfat alsa".
  2020. </para></listitem>
  2021. <listitem><para>
  2022. <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_BOOT_FILES'><filename>IMAGE_BOOT_FILES</filename></ulink>:
  2023. Files installed into the device's boot partition
  2024. when preparing the image using the Wic tool
  2025. with the <filename>bootimg-partition</filename>
  2026. source plugin.
  2027. In this case, the "u-boot.${UBOOT_SUFFIX}" and
  2028. "MLO" files are installed.
  2029. </para></listitem>
  2030. </itemizedlist>
  2031. </para>
  2032. </section>
  2033. <section id='bsp-kernel-recipe-example'>
  2034. <title>BSP Kernel Recipe Example</title>
  2035. <para>
  2036. The kernel recipe used to build the kernel image
  2037. for the BeagleBone device was established in the
  2038. machine configuration:
  2039. <literallayout class='monospaced'>
  2040. PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
  2041. PREFERRED_VERSION_linux-yocto ?= "4.12%"
  2042. </literallayout>
  2043. The <filename>meta-yocto-bsp/recipes-kernel/linux</filename>
  2044. directory in the layer contains metadata used
  2045. to build the kernel.
  2046. In this case, a kernel append file is used to
  2047. override an established kernel recipe, which is
  2048. located in
  2049. <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/linux'></ulink>
  2050. and named
  2051. <filename>linux-yocto_4.12.bb</filename>.
  2052. </para>
  2053. <para>
  2054. Following is the contents of the append file:
  2055. <literallayout class='monospaced'>
  2056. KBRANCH_genericx86 = "standard/base"
  2057. KBRANCH_genericx86-64 = "standard/base"
  2058. KMACHINE_genericx86 ?= "common-pc"
  2059. KMACHINE_genericx86-64 ?= "common-pc-64"
  2060. KBRANCH_edgerouter = "standard/edgerouter"
  2061. KBRANCH_beaglebone-yocto = "standard/beaglebone"
  2062. KMACHINE_beaglebone-yocto = "beaglebone"
  2063. KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
  2064. SRCREV_machine_genericx86 ?= "1c4ad569af3e23a77994235435040e322908687f"
  2065. SRCREV_machine_genericx86-64 ?= "1c4ad569af3e23a77994235435040e322908687f"
  2066. SRCREV_machine_edgerouter ?= "257f843ea367744620f1d92910afd2f454e31483"
  2067. SRCREV_machine_beaglebone-yocto ?= "257f843ea367744620f1d92910afd2f454e31483"
  2068. SRCREV_machine_mpc8315e-rdb ?= "014560874f9eb2a86138c9cc35046ff1720485e1"
  2069. COMPATIBLE_MACHINE_genericx86 = "genericx86"
  2070. COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
  2071. COMPATIBLE_MACHINE_edgerouter = "edgerouter"
  2072. COMPATIBLE_MACHINE_beaglebone-yocto = "beaglebone-yocto"
  2073. COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
  2074. LINUX_VERSION_genericx86 = "4.12.20"
  2075. LINUX_VERSION_genericx86-64 = "4.12.20"
  2076. LINUX_VERSION_edgerouter = "4.12.19"
  2077. LINUX_VERSION_beaglebone-yocto = "4.12.19"
  2078. LINUX_VERSION_mpc8315e-rdb = "4.12.19"
  2079. </literallayout>
  2080. This particular append file works for all the
  2081. machines that are part of the
  2082. <filename>meta-yocto-bsp</filename> container
  2083. layer.
  2084. The relevant statements are appended with
  2085. the "beaglebone-yocto" string.
  2086. The OpenEmbedded build system uses these
  2087. statements to override similar statements
  2088. in the kernel recipe:
  2089. <itemizedlist>
  2090. <listitem><para>
  2091. <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink>:
  2092. Identifies the kernel branch that is validated,
  2093. patched, and configured during the build.
  2094. </para></listitem>
  2095. <listitem><para>
  2096. <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>:
  2097. Identifies the machine name as known by the
  2098. kernel, which is sometimes a different name
  2099. than what is known by the OpenEmbedded build
  2100. system.
  2101. </para></listitem>
  2102. <listitem><para>
  2103. <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>:
  2104. Identifies the revision of the source code used
  2105. to build the image.
  2106. <!--
  2107. You find out about that point in the kernel source tree by
  2108. doing the following command:
  2109. git log &dash;&dash;decorate 257f843ea367744620f1d92910afd2f454e31483
  2110. Returns information about the commit, which is usually
  2111. that it is a merge point for a stable kernel release.
  2112. -->
  2113. </para></listitem>
  2114. <listitem><para>
  2115. <ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></ulink>:
  2116. A regular expression that resolves to one or
  2117. more target machines with which the recipe
  2118. is compatible.
  2119. </para></listitem>
  2120. <listitem><para>
  2121. <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION'><filename>LINUX_VERSION</filename></ulink>:
  2122. The Linux version from kernel.org used by
  2123. the OpenEmbedded build system to build the
  2124. kernel image.
  2125. </para></listitem>
  2126. </itemizedlist>
  2127. </para>
  2128. </section>
  2129. </section>
  2130. </chapter>