bsp.rst 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. ************************************************
  3. Board Support Packages (BSP) - Developer's Guide
  4. ************************************************
  5. A Board Support Package (BSP) is a collection of information that
  6. defines how to support a particular hardware device, set of devices, or
  7. hardware platform. The BSP includes information about the hardware
  8. features present on the device and kernel configuration information
  9. along with any additional hardware drivers required. The BSP also lists
  10. any additional software components required in addition to a generic
  11. Linux software stack for both essential and optional platform features.
  12. This guide presents information about BSP layers, defines a structure
  13. for components so that BSPs follow a commonly understood layout,
  14. discusses how to customize a recipe for a BSP, addresses BSP licensing,
  15. and provides information that shows you how to create a BSP
  16. Layer using the :ref:`bitbake-layers <bsp-guide/bsp:Creating a new BSP Layer Using the \`\`bitbake-layers\`\` Script>`
  17. tool.
  18. BSP Layers
  19. ==========
  20. A BSP consists of a file structure inside a base directory.
  21. Collectively, you can think of the base directory, its file structure,
  22. and the contents as a BSP layer. Although not a strict requirement, BSP
  23. layers in the Yocto Project use the following well-established naming
  24. convention: ::
  25. meta-bsp_root_name
  26. The string "meta-" is prepended to the
  27. machine or platform name, which is bsp_root_name in the above form.
  28. .. note::
  29. Because the BSP layer naming convention is well-established, it is
  30. advisable to follow it when creating layers. Technically speaking, a
  31. BSP layer name does not need to start with
  32. meta-. However, various scripts and tools in the Yocto Project development
  33. environment assume this convention.
  34. To help understand the BSP layer concept, consider the BSPs that the
  35. Yocto Project supports and provides with each release. You can see the
  36. layers in the
  37. :ref:`overview-manual/overview-manual-development-environment:yocto project source repositories`
  38. through
  39. a web interface at :yocto_git:`/`. If you go to that interface,
  40. you will find a list of repositories under "Yocto Metadata Layers".
  41. .. note::
  42. Layers that are no longer actively supported as part of the Yocto
  43. Project appear under the heading "Yocto Metadata Layer Archive."
  44. Each repository is a BSP layer supported by the Yocto Project (e.g.
  45. ``meta-raspberrypi`` and ``meta-intel``). Each of these layers is a
  46. repository unto itself and clicking on the layer name displays two URLs
  47. from which you can clone the layer's repository to your local system.
  48. Here is an example that clones the Raspberry Pi BSP layer: ::
  49. $ git clone git://git.yoctoproject.org/meta-raspberrypi
  50. In addition to BSP layers, the ``meta-yocto-bsp`` layer is part of the
  51. shipped ``poky`` repository. The ``meta-yocto-bsp`` layer maintains
  52. several "reference" BSPs including the ARM-based Beaglebone, MIPS-based
  53. EdgeRouter, and generic versions of both 32-bit and 64-bit IA machines.
  54. For information on typical BSP development workflow, see the
  55. :ref:`bsp-guide/bsp:developing a board support package (bsp)`
  56. section. For more
  57. information on how to set up a local copy of source files from a Git
  58. repository, see the
  59. :ref:`dev-manual/dev-manual-start:locating yocto project source files`
  60. section in the Yocto Project Development Tasks Manual.
  61. The BSP layer's base directory (``meta-bsp_root_name``) is the root
  62. directory of that Layer. This directory is what you add to the
  63. :term:`BBLAYERS` variable in the
  64. ``conf/bblayers.conf`` file found in your
  65. :term:`Build Directory`, which is
  66. established after you run the OpenEmbedded build environment setup
  67. script (i.e. :ref:`ref-manual/ref-structure:\`\`oe-init-build-env\`\`` ).
  68. Adding the root directory allows the :term:`OpenEmbedded Build System`
  69. to recognize the BSP
  70. layer and from it build an image. Here is an example: ::
  71. BBLAYERS ?= " \
  72. /usr/local/src/yocto/meta \
  73. /usr/local/src/yocto/meta-poky \
  74. /usr/local/src/yocto/meta-yocto-bsp \
  75. /usr/local/src/yocto/meta-mylayer \
  76. "
  77. .. note::
  78. Ordering and ``BBFILE_PRIORITY`` for the layers listed in BBLAYERS matter. For
  79. example, if multiple layers define a machine configuration, the OpenEmbedded
  80. build system uses the last layer searched given similar layer priorities. The
  81. build system works from the top-down through the layers listed in ``BBLAYERS``.
  82. Some BSPs require or depend on additional layers beyond the BSP's root
  83. layer in order to be functional. In this case, you need to specify these
  84. layers in the ``README`` "Dependencies" section of the BSP's root layer.
  85. Additionally, if any build instructions exist for the BSP, you must add
  86. them to the "Dependencies" section.
  87. Some layers function as a layer to hold other BSP layers. These layers
  88. are knows as ":term:`container layers <Container Layer>`". An example of
  89. this type of layer is OpenEmbedded's
  90. `meta-openembedded <https://github.com/openembedded/meta-openembedded>`__
  91. layer. The ``meta-openembedded`` layer contains many ``meta-*`` layers.
  92. In cases like this, you need to include the names of the actual layers
  93. you want to work with, such as: ::
  94. BBLAYERS ?= " \
  95. /usr/local/src/yocto/meta \
  96. /usr/local/src/yocto/meta-poky \
  97. /usr/local/src/yocto/meta-yocto-bsp \
  98. /usr/local/src/yocto/meta-mylayer \
  99. .../meta-openembedded/meta-oe \
  100. .../meta-openembedded/meta-perl \
  101. .../meta-openembedded/meta-networking \
  102. "
  103. and so on.
  104. For more information on layers, see the
  105. ":ref:`dev-manual/dev-manual-common-tasks:understanding and creating layers`"
  106. section of the Yocto Project Development Tasks Manual.
  107. Preparing Your Build Host to Work With BSP Layers
  108. =================================================
  109. This section describes how to get your build host ready to work with BSP
  110. layers. Once you have the host set up, you can create the layer as
  111. described in the
  112. ":ref:`bsp-guide/bsp:creating a new bsp layer using the \`\`bitbake-layers\`\` script`"
  113. section.
  114. .. note::
  115. For structural information on BSPs, see the Example Filesystem Layout
  116. section.
  117. #. *Set Up the Build Environment:* Be sure you are set up to use BitBake
  118. in a shell. See the ":ref:`dev-manual/dev-manual-start:preparing the build host`"
  119. section in the Yocto Project Development Tasks Manual for information on how
  120. to get a build host ready that is either a native Linux machine or a machine
  121. that uses CROPS.
  122. #. *Clone the ``poky`` Repository:* You need to have a local copy of the
  123. Yocto Project :term:`Source Directory` (i.e. a local
  124. ``poky`` repository). See the
  125. "ref:`dev-manual/dev-manual-start:cloning the ``poky`` repository`" and
  126. possibly the
  127. ":ref:`dev-manual/dev-manual-start:checking out by branch in poky`" or
  128. ":ref:`dev-manual/dev-manual-start:checking out by tag in poky`"
  129. sections
  130. all in the Yocto Project Development Tasks Manual for information on
  131. how to clone the ``poky`` repository and check out the appropriate
  132. branch for your work.
  133. #. *Determine the BSP Layer You Want:* The Yocto Project supports many
  134. BSPs, which are maintained in their own layers or in layers designed
  135. to contain several BSPs. To get an idea of machine support through
  136. BSP layers, you can look at the `index of
  137. machines <&YOCTO_RELEASE_DL_URL;/machines>`__ for the release.
  138. #. *Optionally Clone the ``meta-intel`` BSP Layer:* If your hardware is
  139. based on current Intel CPUs and devices, you can leverage this BSP
  140. layer. For details on the ``meta-intel`` BSP layer, see the layer's
  141. `README <http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/tree/README>`__
  142. file.
  143. #. *Navigate to Your Source Directory:* Typically, you set up the
  144. ``meta-intel`` Git repository inside the :term:`Source Directory` (e.g.
  145. ``poky``). ::
  146. $ cd /home/you/poky
  147. #. *Clone the Layer:* ::
  148. $ git clone git://git.yoctoproject.org/meta-intel.git
  149. Cloning into 'meta-intel'...
  150. remote: Counting objects: 15585, done.
  151. remote: Compressing objects: 100% (5056/5056), done.
  152. remote: Total 15585 (delta 9123), reused 15329 (delta 8867)
  153. Receiving objects: 100% (15585/15585), 4.51 MiB | 3.19 MiB/s, done.
  154. Resolving deltas: 100% (9123/9123), done.
  155. Checking connectivity... done.
  156. #. *Check Out the Proper Branch:* The branch you check out for
  157. ``meta-intel`` must match the same branch you are using for the
  158. Yocto Project release (e.g. &DISTRO_NAME_NO_CAP;): ::
  159. $ cd meta-intel
  160. $ git checkout -b &DISTRO_NAME_NO_CAP; remotes/origin/&DISTRO_NAME_NO_CAP;
  161. Branch &DISTRO_NAME_NO_CAP; set up to track remote branch
  162. &DISTRO_NAME_NO_CAP; from origin.
  163. Switched to a new branch '&DISTRO_NAME_NO_CAP;'
  164. .. note::
  165. To see the available branch names in a cloned repository, use the ``git
  166. branch -al`` command. See the
  167. ":ref:`dev-manual/dev-manual-start:checking out by branch in poky`"
  168. section in the Yocto Project Development Tasks Manual for more
  169. information.
  170. #. *Optionally Set Up an Alternative BSP Layer:* If your hardware can be
  171. more closely leveraged to an existing BSP not within the
  172. ``meta-intel`` BSP layer, you can clone that BSP layer.
  173. The process is identical to the process used for the ``meta-intel``
  174. layer except for the layer's name. For example, if you determine that
  175. your hardware most closely matches the ``meta-raspberrypi``, clone
  176. that layer: ::
  177. $ git clone git://git.yoctoproject.org/meta-raspberrypi
  178. Cloning into 'meta-raspberrypi'...
  179. remote: Counting objects: 4743, done.
  180. remote: Compressing objects: 100% (2185/2185), done.
  181. remote: Total 4743 (delta 2447), reused 4496 (delta 2258)
  182. Receiving objects: 100% (4743/4743), 1.18 MiB | 0 bytes/s, done.
  183. Resolving deltas: 100% (2447/2447), done.
  184. Checking connectivity... done.
  185. #. *Initialize the Build Environment:* While in the root directory of
  186. the Source Directory (i.e. ``poky``), run the
  187. :ref:`ref-manual/ref-structure:\`\`oe-init-build-env\`\`` environment
  188. setup script to define the OpenEmbedded build environment on your
  189. build host. ::
  190. $ source &OE_INIT_FILE;
  191. Among other things, the script creates the :term:`Build Directory`, which is
  192. ``build`` in this case and is located in the :term:`Source Directory`. After
  193. the script runs, your current working directory is set to the ``build``
  194. directory.
  195. .. _bsp-filelayout:
  196. Example Filesystem Layout
  197. =========================
  198. Defining a common BSP directory structure allows end-users to understand
  199. and become familiar with that standard. A common format also encourages
  200. standardization of software support for hardware.
  201. The proposed form described in this section does have elements that are
  202. specific to the OpenEmbedded build system. It is intended that
  203. developers can use this structure with other build systems besides the
  204. OpenEmbedded build system. It is also intended that it will be be simple
  205. to extract information and convert it to other formats if required. The
  206. OpenEmbedded build system, through its standard :ref:`layers mechanism
  207. <overview-manual/overview-manual-yp-intro:the yocto project layer model>`, can
  208. directly accept the format described as a layer. The BSP layer captures
  209. all the hardware-specific details in one place using a standard format,
  210. which is useful for any person wishing to use the hardware platform
  211. regardless of the build system they are using.
  212. The BSP specification does not include a build system or other tools -
  213. the specification is concerned with the hardware-specific components
  214. only. At the end-distribution point, you can ship the BSP layer combined
  215. with a build system and other tools. Realize that it is important to
  216. maintain the distinction that the BSP layer, a build system, and tools
  217. are separate components that could be combined in certain end products.
  218. Before looking at the recommended form for the directory structure
  219. inside a BSP layer, you should be aware that some requirements do exist
  220. in order for a BSP layer to be considered compliant with the Yocto
  221. Project. For that list of requirements, see the
  222. ":ref:`bsp-guide/bsp:released bsp requirements`" section.
  223. Below is the typical directory structure for a BSP layer. While this
  224. basic form represents the standard, realize that the actual layout for
  225. individual BSPs could differ. ::
  226. meta-bsp_root_name/
  227. meta-bsp_root_name/bsp_license_file
  228. meta-bsp_root_name/README
  229. meta-bsp_root_name/README.sources
  230. meta-bsp_root_name/binary/bootable_images
  231. meta-bsp_root_name/conf/layer.conf
  232. meta-bsp_root_name/conf/machine/*.conf
  233. meta-bsp_root_name/recipes-bsp/*
  234. meta-bsp_root_name/recipes-core/*
  235. meta-bsp_root_name/recipes-graphics/*
  236. meta-bsp_root_name/recipes-kernel/linux/linux-yocto_kernel_rev.bbappend
  237. Below is an example of the Raspberry Pi BSP layer that is available from
  238. the :yocto_git:`Source Respositories <>`: ::
  239. meta-raspberrypi/COPYING.MIT
  240. meta-raspberrypi/README.md
  241. meta-raspberrypi/classes
  242. meta-raspberrypi/classes/sdcard_image-rpi.bbclass
  243. meta-raspberrypi/conf/
  244. meta-raspberrypi/conf/layer.conf
  245. meta-raspberrypi/conf/machine/
  246. meta-raspberrypi/conf/machine/raspberrypi-cm.conf
  247. meta-raspberrypi/conf/machine/raspberrypi-cm3.conf
  248. meta-raspberrypi/conf/machine/raspberrypi.conf
  249. meta-raspberrypi/conf/machine/raspberrypi0-wifi.conf
  250. meta-raspberrypi/conf/machine/raspberrypi0.conf
  251. meta-raspberrypi/conf/machine/raspberrypi2.conf
  252. meta-raspberrypi/conf/machine/raspberrypi3-64.conf
  253. meta-raspberrypi/conf/machine/raspberrypi3.conf
  254. meta-raspberrypi/conf/machine/include
  255. meta-raspberrypi/conf/machine/include/rpi-base.inc
  256. meta-raspberrypi/conf/machine/include/rpi-default-providers.inc
  257. meta-raspberrypi/conf/machine/include/rpi-default-settings.inc
  258. meta-raspberrypi/conf/machine/include/rpi-default-versions.inc
  259. meta-raspberrypi/conf/machine/include/tune-arm1176jzf-s.inc
  260. meta-raspberrypi/docs
  261. meta-raspberrypi/docs/Makefile
  262. meta-raspberrypi/docs/conf.py
  263. meta-raspberrypi/docs/contributing.md
  264. meta-raspberrypi/docs/extra-apps.md
  265. meta-raspberrypi/docs/extra-build-config.md
  266. meta-raspberrypi/docs/index.rst
  267. meta-raspberrypi/docs/layer-contents.md
  268. meta-raspberrypi/docs/readme.md
  269. meta-raspberrypi/files
  270. meta-raspberrypi/files/custom-licenses
  271. meta-raspberrypi/files/custom-licenses/Broadcom
  272. meta-raspberrypi/recipes-bsp
  273. meta-raspberrypi/recipes-bsp/bootfiles
  274. meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bb
  275. meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb
  276. meta-raspberrypi/recipes-bsp/common
  277. meta-raspberrypi/recipes-bsp/common/firmware.inc
  278. meta-raspberrypi/recipes-bsp/formfactor
  279. meta-raspberrypi/recipes-bsp/formfactor/formfactor
  280. meta-raspberrypi/recipes-bsp/formfactor/formfactor/raspberrypi
  281. meta-raspberrypi/recipes-bsp/formfactor/formfactor/raspberrypi/machconfig
  282. meta-raspberrypi/recipes-bsp/formfactor/formfactor_0.0.bbappend
  283. meta-raspberrypi/recipes-bsp/rpi-u-boot-src
  284. meta-raspberrypi/recipes-bsp/rpi-u-boot-src/files
  285. meta-raspberrypi/recipes-bsp/rpi-u-boot-src/files/boot.cmd.in
  286. meta-raspberrypi/recipes-bsp/rpi-u-boot-src/rpi-u-boot-scr.bb
  287. meta-raspberrypi/recipes-bsp/u-boot
  288. meta-raspberrypi/recipes-bsp/u-boot/u-boot
  289. meta-raspberrypi/recipes-bsp/u-boot/u-boot/*.patch
  290. meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
  291. meta-raspberrypi/recipes-connectivity
  292. meta-raspberrypi/recipes-connectivity/bluez5
  293. meta-raspberrypi/recipes-connectivity/bluez5/bluez5
  294. meta-raspberrypi/recipes-connectivity/bluez5/bluez5/*.patch
  295. meta-raspberrypi/recipes-connectivity/bluez5/bluez5/BCM43430A1.hcd
  296. meta-raspberrypi/recipes-connectivity/bluez5/bluez5brcm43438.service
  297. meta-raspberrypi/recipes-connectivity/bluez5/bluez5_%.bbappend
  298. meta-raspberrypi/recipes-core
  299. meta-raspberrypi/recipes-core/images
  300. meta-raspberrypi/recipes-core/images/rpi-basic-image.bb
  301. meta-raspberrypi/recipes-core/images/rpi-hwup-image.bb
  302. meta-raspberrypi/recipes-core/images/rpi-test-image.bb
  303. meta-raspberrypi/recipes-core/packagegroups
  304. meta-raspberrypi/recipes-core/packagegroups/packagegroup-rpi-test.bb
  305. meta-raspberrypi/recipes-core/psplash
  306. meta-raspberrypi/recipes-core/psplash/files
  307. meta-raspberrypi/recipes-core/psplash/files/psplash-raspberrypi-img.h
  308. meta-raspberrypi/recipes-core/psplash/psplash_git.bbappend
  309. meta-raspberrypi/recipes-core/udev
  310. meta-raspberrypi/recipes-core/udev/udev-rules-rpi
  311. meta-raspberrypi/recipes-core/udev/udev-rules-rpi/99-com.rules
  312. meta-raspberrypi/recipes-core/udev/udev-rules-rpi.bb
  313. meta-raspberrypi/recipes-devtools
  314. meta-raspberrypi/recipes-devtools/bcm2835
  315. meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.52.bb
  316. meta-raspberrypi/recipes-devtools/pi-blaster
  317. meta-raspberrypi/recipes-devtools/pi-blaster/files
  318. meta-raspberrypi/recipes-devtools/pi-blaster/files/*.patch
  319. meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster_git.bb
  320. meta-raspberrypi/recipes-devtools/python
  321. meta-raspberrypi/recipes-devtools/python/python-rtimu
  322. meta-raspberrypi/recipes-devtools/python/python-rtimu/*.patch
  323. meta-raspberrypi/recipes-devtools/python/python-rtimu_git.bb
  324. meta-raspberrypi/recipes-devtools/python/python-sense-hat_2.2.0.bb
  325. meta-raspberrypi/recipes-devtools/python/rpi-gpio
  326. meta-raspberrypi/recipes-devtools/python/rpi-gpio/*.patch
  327. meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.3.bb
  328. meta-raspberrypi/recipes-devtools/python/rpio
  329. meta-raspberrypi/recipes-devtools/python/rpio/*.patch
  330. meta-raspberrypi/recipes-devtools/python/rpio_0.10.0.bb
  331. meta-raspberrypi/recipes-devtools/wiringPi
  332. meta-raspberrypi/recipes-devtools/wiringPi/files
  333. meta-raspberrypi/recipes-devtools/wiringPi/files/*.patch
  334. meta-raspberrypi/recipes-devtools/wiringPi/wiringpi_git.bb
  335. meta-raspberrypi/recipes-graphics
  336. meta-raspberrypi/recipes-graphics/eglinfo
  337. meta-raspberrypi/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
  338. meta-raspberrypi/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend
  339. meta-raspberrypi/recipes-graphics/mesa
  340. meta-raspberrypi/recipes-graphics/mesa/mesa-gl_%.bbappend
  341. meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend
  342. meta-raspberrypi/recipes-graphics/userland
  343. meta-raspberrypi/recipes-graphics/userland/userland
  344. meta-raspberrypi/recipes-graphics/userland/userland/*.patch
  345. meta-raspberrypi/recipes-graphics/userland/userland_git.bb
  346. meta-raspberrypi/recipes-graphics/vc-graphics
  347. meta-raspberrypi/recipes-graphics/vc-graphics/files
  348. meta-raspberrypi/recipes-graphics/vc-graphics/files/egl.pc
  349. meta-raspberrypi/recipes-graphics/vc-graphics/files/vchiq.sh
  350. meta-raspberrypi/recipes-graphics/vc-graphics/vc-graphics-hardfp.bb
  351. meta-raspberrypi/recipes-graphics/vc-graphics/vc-graphics.bb
  352. meta-raspberrypi/recipes-graphics/vc-graphics/vc-graphics.inc
  353. meta-raspberrypi/recipes-graphics/wayland
  354. meta-raspberrypi/recipes-graphics/wayland/weston_%.bbappend
  355. meta-raspberrypi/recipes-graphics/xorg-xserver
  356. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config
  357. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi
  358. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf
  359. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d
  360. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/10-evdev.conf
  361. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/98-pitft.conf
  362. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-calibration.conf
  363. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
  364. meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
  365. meta-raspberrypi/recipes-kernel
  366. meta-raspberrypi/recipes-kernel/linux-firmware
  367. meta-raspberrypi/recipes-kernel/linux-firmware/files
  368. meta-raspberrypi/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.bin
  369. meta-raspberrypi/recipes-kernel/linux-firmware/files/brcfmac43430-sdio.txt
  370. meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend
  371. meta-raspberrypi/recipes-kernel/linux
  372. meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb
  373. meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
  374. meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14.bb
  375. meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb
  376. meta-raspberrypi/recipes-multimedia
  377. meta-raspberrypi/recipes-multimedia/gstreamer
  378. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx
  379. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/*.patch
  380. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend
  381. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
  382. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12
  383. meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/*.patch
  384. meta-raspberrypi/recipes-multimedia/omxplayer
  385. meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer
  386. meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/*.patch
  387. meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer_git.bb
  388. meta-raspberrypi/recipes-multimedia/x264
  389. meta-raspberrypi/recipes-multimedia/x264/x264_git.bbappend
  390. meta-raspberrypi/wic meta-raspberrypi/wic/sdimage-raspberrypi.wks
  391. The following sections describe each part of the proposed BSP format.
  392. .. _bsp-filelayout-license:
  393. License Files
  394. -------------
  395. You can find these files in the BSP Layer at: ::
  396. meta-bsp_root_name/bsp_license_file
  397. These optional files satisfy licensing requirements for the BSP. The
  398. type or types of files here can vary depending on the licensing
  399. requirements. For example, in the Raspberry Pi BSP, all licensing
  400. requirements are handled with the ``COPYING.MIT`` file.
  401. Licensing files can be MIT, BSD, GPLv*, and so forth. These files are
  402. recommended for the BSP but are optional and totally up to the BSP
  403. developer. For information on how to maintain license compliance, see
  404. the ":ref:`dev-manual/dev-manual-common-tasks:maintaining open source license compliance during your product's lifecycle`"
  405. section in the Yocto Project Development Tasks Manual.
  406. .. _bsp-filelayout-readme:
  407. README File
  408. -----------
  409. You can find this file in the BSP Layer at: ::
  410. meta-bsp_root_name/README
  411. This file provides information on how to boot the live images that are
  412. optionally included in the ``binary/`` directory. The ``README`` file
  413. also provides information needed for building the image.
  414. At a minimum, the ``README`` file must contain a list of dependencies,
  415. such as the names of any other layers on which the BSP depends and the
  416. name of the BSP maintainer with his or her contact information.
  417. .. _bsp-filelayout-readme-sources:
  418. README.sources File
  419. -------------------
  420. You can find this file in the BSP Layer at: ::
  421. meta-bsp_root_name/README.sources
  422. This file provides information on where to locate the BSP source files
  423. used to build the images (if any) that reside in
  424. ``meta-bsp_root_name/binary``. Images in the ``binary`` would be images
  425. released with the BSP. The information in the ``README.sources`` file
  426. also helps you find the :term:`Metadata`
  427. used to generate the images that ship with the BSP.
  428. .. note::
  429. If the BSP's ``binary`` directory is missing or the directory has no images, an
  430. existing ``README.sources`` file is meaningless and usually does not exist.
  431. .. _bsp-filelayout-binary:
  432. Pre-built User Binaries
  433. -----------------------
  434. You can find these files in the BSP Layer at: ::
  435. meta-bsp_root_name/binary/bootable_images
  436. This optional area contains useful pre-built kernels and user-space
  437. filesystem images released with the BSP that are appropriate to the
  438. target system. This directory typically contains graphical (e.g. Sato)
  439. and minimal live images when the BSP tarball has been created and made
  440. available in the :yocto_home:`Yocto Project <>` website. You can
  441. use these kernels and images to get a system running and quickly get
  442. started on development tasks.
  443. The exact types of binaries present are highly hardware-dependent. The
  444. :ref:`README <bsp-guide/bsp:readme file>` file should be present in the
  445. BSP Layer and it explains how to use the images with the target
  446. hardware. Additionally, the
  447. :ref:`README.sources <bsp-guide/bsp:readme.sources file>` file should be
  448. present to locate the sources used to build the images and provide
  449. information on the Metadata.
  450. .. _bsp-filelayout-layer:
  451. Layer Configuration File
  452. ------------------------
  453. You can find this file in the BSP Layer at: ::
  454. meta-bsp_root_name/conf/layer.conf
  455. The ``conf/layer.conf`` file identifies the file structure as a layer,
  456. identifies the contents of the layer, and contains information about how
  457. the build system should use it. Generally, a standard boilerplate file
  458. such as the following works. In the following example, you would replace
  459. bsp with the actual name of the BSP (i.e. bsp_root_name from the example
  460. template). ::
  461. # We have a conf and classes directory, add to BBPATH
  462. BBPATH .= ":${LAYERDIR}"
  463. # We have a recipes directory, add to BBFILES
  464. BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
  465. ${LAYERDIR}/recipes-*/*/*.bbappend"
  466. BBFILE_COLLECTIONS += "bsp"
  467. BBFILE_PATTERN_bsp = "^${LAYERDIR}/"
  468. BBFILE_PRIORITY_bsp = "6"
  469. LAYERDEPENDS_bsp = "intel"
  470. To illustrate the string substitutions, here are the corresponding
  471. statements from the Raspberry Pi ``conf/layer.conf`` file: ::
  472. # We have a conf and classes directory, append to BBPATH
  473. BBPATH .= ":${LAYERDIR}"
  474. # We have a recipes directory containing .bb and .bbappend files, add to BBFILES
  475. BBFILES += "${LAYERDIR}/recipes*/*/*.bb \
  476. ${LAYERDIR}/recipes*/*/*.bbappend"
  477. BBFILE_COLLECTIONS += "raspberrypi"
  478. BBFILE_PATTERN_raspberrypi := "^${LAYERDIR}/"
  479. BBFILE_PRIORITY_raspberrypi = "9"
  480. # Additional license directories.
  481. LICENSE_PATH += "${LAYERDIR}/files/custom-licenses"
  482. .
  483. .
  484. .
  485. This file simply makes :term:`BitBake` aware of the recipes and configuration
  486. directories. The file must exist so that the OpenEmbedded build system can
  487. recognize the BSP.
  488. .. _bsp-filelayout-machine:
  489. Hardware Configuration Options
  490. ------------------------------
  491. You can find these files in the BSP Layer at: ::
  492. meta-bsp_root_name/conf/machine/*.conf
  493. The machine files bind together all the information contained elsewhere
  494. in the BSP into a format that the build system can understand. Each BSP
  495. Layer requires at least one machine file. If the BSP supports multiple
  496. machines, multiple machine configuration files can exist. These
  497. filenames correspond to the values to which users have set the
  498. :term:`MACHINE` variable.
  499. These files define things such as the kernel package to use
  500. (:term:`PREFERRED_PROVIDER` of
  501. :ref:`virtual/kernel <dev-manual/dev-manual-common-tasks:using virtual providers>`),
  502. the hardware drivers to include in different types of images, any
  503. special software components that are needed, any bootloader information,
  504. and also any special image format requirements.
  505. This configuration file could also include a hardware "tuning" file that
  506. is commonly used to define the package architecture and specify
  507. optimization flags, which are carefully chosen to give best performance
  508. on a given processor.
  509. Tuning files are found in the ``meta/conf/machine/include`` directory
  510. within the :term:`Source Directory`.
  511. For example, many ``tune-*`` files (e.g. ``tune-arm1136jf-s.inc``,
  512. ``tune-1586-nlp.inc``, and so forth) reside in the
  513. ``poky/meta/conf/machine/include`` directory.
  514. To use an include file, you simply include them in the machine
  515. configuration file. For example, the Raspberry Pi BSP
  516. ``raspberrypi3.conf`` contains the following statement: ::
  517. include conf/machine/include/rpi-base.inc
  518. .. _bsp-filelayout-misc-recipes:
  519. Miscellaneous BSP-Specific Recipe Files
  520. ---------------------------------------
  521. You can find these files in the BSP Layer at: ::
  522. meta-bsp_root_name/recipes-bsp/*
  523. This optional directory contains miscellaneous recipe files for the BSP.
  524. Most notably would be the formfactor files. For example, in the
  525. Raspberry Pi BSP, there is the ``formfactor_0.0.bbappend`` file, which
  526. is an append file used to augment the recipe that starts the build.
  527. Furthermore, there are machine-specific settings used during the build
  528. that are defined by the ``machconfig`` file further down in the
  529. directory. Here is the ``machconfig`` file for the Raspberry Pi BSP: ::
  530. HAVE_TOUCHSCREEN=0
  531. HAVE_KEYBOARD=1
  532. DISPLAY_CAN_ROTATE=0
  533. DISPLAY_ORIENTATION=0
  534. DISPLAY_DPI=133
  535. .. note::
  536. If a BSP does not have a formfactor entry, defaults are established
  537. according to the formfactor configuration file that is installed by
  538. the main formfactor recipe
  539. ``meta/recipes-bsp/formfactor/formfactor_0.0.bb``, which is found in
  540. the :term:`Source Directory`.
  541. .. _bsp-filelayout-recipes-graphics:
  542. Display Support Files
  543. ---------------------
  544. You can find these files in the BSP Layer at: ::
  545. meta-bsp_root_name/recipes-graphics/*
  546. This optional directory contains recipes for the BSP if it has special
  547. requirements for graphics support. All files that are needed for the BSP
  548. to support a display are kept here.
  549. .. _bsp-filelayout-kernel:
  550. Linux Kernel Configuration
  551. --------------------------
  552. You can find these files in the BSP Layer at: ::
  553. meta-bsp_root_name/recipes-kernel/linux/linux*.bbappend
  554. meta-bsp_root_name/recipes-kernel/linux/*.bb
  555. Append files (``*.bbappend``) modify the main kernel recipe being used
  556. to build the image. The ``*.bb`` files would be a developer-supplied
  557. kernel recipe. This area of the BSP hierarchy can contain both these
  558. types of files although, in practice, it is likely that you would have
  559. one or the other.
  560. For your BSP, you typically want to use an existing Yocto Project kernel
  561. recipe found in the :term:`Source Directory`
  562. at
  563. ``meta/recipes-kernel/linux``. You can append machine-specific changes
  564. to the kernel recipe by using a similarly named append file, which is
  565. located in the BSP Layer for your target device (e.g. the
  566. ``meta-bsp_root_name/recipes-kernel/linux`` directory).
  567. Suppose you are using the ``linux-yocto_4.4.bb`` recipe to build the
  568. kernel. In other words, you have selected the kernel in your
  569. bsp_root_name\ ``.conf`` file by adding
  570. :term:`PREFERRED_PROVIDER` and :term:`PREFERRED_VERSION`
  571. statements as follows: ::
  572. PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
  573. PREFERRED_VERSION_linux-yocto ?= "4.4%"
  574. .. note::
  575. When the preferred provider is assumed by default, the ``PREFERRED_PROVIDER``
  576. statement does not appear in the ``bsp_root_name`` .conf file.
  577. You would use the ``linux-yocto_4.4.bbappend`` file to append specific
  578. BSP settings to the kernel, thus configuring the kernel for your
  579. particular BSP.
  580. You can find more information on what your append file should contain in
  581. the ":ref:`kernel-dev/kernel-dev-common:creating the append file`" section
  582. in the Yocto Project Linux Kernel Development Manual.
  583. An alternate scenario is when you create your own kernel recipe for the
  584. BSP. A good example of this is the Raspberry Pi BSP. If you examine the
  585. ``recipes-kernel/linux`` directory you see the following: ::
  586. linux-raspberrypi-dev.bb
  587. linux-raspberrypi.inc
  588. linux-raspberrypi_4.14.bb
  589. linux-raspberrypi_4.9.bb
  590. The directory contains three kernel recipes and a common include file.
  591. Developing a Board Support Package (BSP)
  592. ========================================
  593. This section describes the high-level procedure you can follow to create
  594. a BSP. Although not required for BSP creation, the ``meta-intel``
  595. repository, which contains many BSPs supported by the Yocto Project, is
  596. part of the example.
  597. For an example that shows how to create a new layer using the tools, see
  598. the ":ref:`bsp-guide/bsp:creating a new bsp layer using the \`\`bitbake-layers\`\` script`"
  599. section.
  600. The following illustration and list summarize the BSP creation general
  601. workflow.
  602. .. image:: figures/bsp-dev-flow.png
  603. :align: center
  604. #. *Set up Your Host Development System to Support Development Using the
  605. Yocto Project*: See the ":ref:`dev-manual/dev-manual-start:preparing the build host`"
  606. section in the Yocto Project Development Tasks Manual for options on how to
  607. get a system ready to use the Yocto Project.
  608. #. *Establish the meta-intel Repository on Your System:* Having
  609. local copies of these supported BSP layers on your system gives you
  610. access to layers you might be able to leverage when creating your
  611. BSP. For information on how to get these files, see the
  612. ":ref:`bsp-guide/bsp:preparing your build host to work with bsp layers`"
  613. section.
  614. #. *Create Your Own BSP Layer Using the bitbake-layers Script:*
  615. Layers are ideal for isolating and storing work for a given piece of
  616. hardware. A layer is really just a location or area in which you
  617. place the recipes and configurations for your BSP. In fact, a BSP is,
  618. in itself, a special type of layer. The simplest way to create a new
  619. BSP layer that is compliant with the Yocto Project is to use the
  620. ``bitbake-layers`` script. For information about that script, see the
  621. ":ref:`bsp-guide/bsp:creating a new bsp layer using the \`\`bitbake-layers\`\` script`"
  622. section.
  623. Another example that illustrates a layer is an application. Suppose
  624. you are creating an application that has library or other
  625. dependencies in order for it to compile and run. The layer, in this
  626. case, would be where all the recipes that define those dependencies
  627. are kept. The key point for a layer is that it is an isolated area
  628. that contains all the relevant information for the project that the
  629. OpenEmbedded build system knows about. For more information on
  630. layers, see the ":ref:`overview-manual/overview-manual-yp-intro:the yocto project layer model`"
  631. section in the Yocto Project Overview and Concepts Manual. You can also
  632. reference the ":ref:`dev-manual/dev-manual-common-tasks:understanding and creating layers`"
  633. section in the Yocto Project Development Tasks Manual. For more
  634. information on BSP layers, see the ":ref:`bsp-guide/bsp:bsp layers`"
  635. section.
  636. .. note::
  637. - Five hardware reference BSPs exist that are part of the Yocto
  638. Project release and are located in the ``poky/meta-yocto-bsp``
  639. BSP layer:
  640. - Texas Instruments Beaglebone (``beaglebone-yocto``)
  641. - Ubiquiti Networks EdgeRouter Lite (``edgerouter``)
  642. - Two general IA platforms (``genericx86`` and ``genericx86-64``)
  643. - Three core Intel BSPs exist as part of the Yocto Project
  644. release in the ``meta-intel`` layer:
  645. - ``intel-core2-32``, which is a BSP optimized for the Core2
  646. family of CPUs as well as all CPUs prior to the Silvermont
  647. core.
  648. - ``intel-corei7-64``, which is a BSP optimized for Nehalem
  649. and later Core and Xeon CPUs as well as Silvermont and later
  650. Atom CPUs, such as the Baytrail SoCs.
  651. - ``intel-quark``, which is a BSP optimized for the Intel
  652. Galileo gen1 & gen2 development boards.
  653. When you set up a layer for a new BSP, you should follow a standard
  654. layout. This layout is described in the ":ref:`bsp-guide/bsp:example filesystem layout`"
  655. section. In the standard layout, notice
  656. the suggested structure for recipes and configuration information.
  657. You can see the standard layout for a BSP by examining any supported
  658. BSP found in the ``meta-intel`` layer inside the Source Directory.
  659. #. *Make Configuration Changes to Your New BSP Layer:* The standard BSP
  660. layer structure organizes the files you need to edit in ``conf`` and
  661. several ``recipes-*`` directories within the BSP layer. Configuration
  662. changes identify where your new layer is on the local system and
  663. identifies the kernel you are going to use. When you run the
  664. ``bitbake-layers`` script, you are able to interactively configure
  665. many things for the BSP (e.g. keyboard, touchscreen, and so forth).
  666. #. *Make Recipe Changes to Your New BSP Layer:* Recipe changes include
  667. altering recipes (``*.bb`` files), removing recipes you do not use,
  668. and adding new recipes or append files (``.bbappend``) that support
  669. your hardware.
  670. #. *Prepare for the Build:* Once you have made all the changes to your
  671. BSP layer, there remains a few things you need to do for the
  672. OpenEmbedded build system in order for it to create your image. You
  673. need to get the build environment ready by sourcing an environment
  674. setup script (i.e. ``oe-init-build-env``) and you need to be sure two
  675. key configuration files are configured appropriately: the
  676. ``conf/local.conf`` and the ``conf/bblayers.conf`` file. You must
  677. make the OpenEmbedded build system aware of your new layer. See the
  678. ":ref:`dev-manual/dev-manual-common-tasks:enabling your layer`"
  679. section in the Yocto Project Development Tasks Manual for information
  680. on how to let the build system know about your new layer.
  681. #. *Build the Image:* The OpenEmbedded build system uses the BitBake
  682. tool to build images based on the type of image you want to create.
  683. You can find more information about BitBake in the
  684. :doc:`BitBake User Manual <bitbake:index>`.
  685. The build process supports several types of images to satisfy
  686. different needs. See the
  687. ":ref:`ref-manual/ref-images:Images`" chapter in the Yocto
  688. Project Reference Manual for information on supported images.
  689. Requirements and Recommendations for Released BSPs
  690. ==================================================
  691. Certain requirements exist for a released BSP to be considered compliant
  692. with the Yocto Project. Additionally, recommendations also exist. This
  693. section describes the requirements and recommendations for released
  694. BSPs.
  695. Released BSP Requirements
  696. -------------------------
  697. Before looking at BSP requirements, you should consider the following:
  698. - The requirements here assume the BSP layer is a well-formed, "legal"
  699. layer that can be added to the Yocto Project. For guidelines on
  700. creating a layer that meets these base requirements, see the
  701. ":ref:`bsp-guide/bsp:bsp layers`" section in this manual and the
  702. ":ref:`dev-manual/dev-manual-common-tasks:understanding and creating layers`"
  703. section in the Yocto Project Development Tasks Manual.
  704. - The requirements in this section apply regardless of how you package
  705. a BSP. You should consult the packaging and distribution guidelines
  706. for your specific release process. For an example of packaging and
  707. distribution requirements, see the "`Third Party BSP Release
  708. Process <https://wiki.yoctoproject.org/wiki/Third_Party_BSP_Release_Process>`__"
  709. wiki page.
  710. - The requirements for the BSP as it is made available to a developer
  711. are completely independent of the released form of the BSP. For
  712. example, the BSP Metadata can be contained within a Git repository
  713. and could have a directory structure completely different from what
  714. appears in the officially released BSP layer.
  715. - It is not required that specific packages or package modifications
  716. exist in the BSP layer, beyond the requirements for general
  717. compliance with the Yocto Project. For example, no requirement exists
  718. dictating that a specific kernel or kernel version be used in a given
  719. BSP.
  720. Following are the requirements for a released BSP that conform to the
  721. Yocto Project:
  722. - *Layer Name:* The BSP must have a layer name that follows the Yocto
  723. Project standards. For information on BSP layer names, see the
  724. ":ref:`bsp-guide/bsp:bsp layers`" section.
  725. - *File System Layout:* When possible, use the same directory names in
  726. your BSP layer as listed in the ``recipes.txt`` file, which is found
  727. in ``poky/meta`` directory of the :term:`Source Directory`
  728. or in the OpenEmbedded-Core Layer (``openembedded-core``) at
  729. http://git.openembedded.org/openembedded-core/tree/meta.
  730. You should place recipes (``*.bb`` files) and recipe modifications
  731. (``*.bbappend`` files) into ``recipes-*`` subdirectories by
  732. functional area as outlined in ``recipes.txt``. If you cannot find a
  733. category in ``recipes.txt`` to fit a particular recipe, you can make
  734. up your own ``recipes-*`` subdirectory.
  735. Within any particular ``recipes-*`` category, the layout should match
  736. what is found in the OpenEmbedded-Core Git repository
  737. (``openembedded-core``) or the Source Directory (``poky``). In other
  738. words, make sure you place related files in appropriately-related
  739. ``recipes-*`` subdirectories specific to the recipe's function, or
  740. within a subdirectory containing a set of closely-related recipes.
  741. The recipes themselves should follow the general guidelines for
  742. recipes used in the Yocto Project found in the "`OpenEmbedded Style
  743. Guide <http://openembedded.org/wiki/Styleguide>`__".
  744. - *License File:* You must include a license file in the
  745. ``meta-bsp_root_name`` directory. This license covers the BSP
  746. Metadata as a whole. You must specify which license to use since no
  747. default license exists when one is not specified. See the
  748. :yocto_git:`COPYING.MIT </cgit.cgi/meta-raspberrypi/tree/COPYING.MIT>`
  749. file for the Raspberry Pi BSP in the ``meta-raspberrypi`` BSP layer
  750. as an example.
  751. - *README File:* You must include a ``README`` file in the
  752. ``meta-bsp_root_name`` directory. See the
  753. :yocto_git:`README.md </cgit.cgi/meta-raspberrypi/tree/README.md>`
  754. file for the Raspberry Pi BSP in the ``meta-raspberrypi`` BSP layer
  755. as an example.
  756. At a minimum, the ``README`` file should contain the following:
  757. - A brief description of the target hardware.
  758. - A list of all the dependencies of the BSP. These dependencies are
  759. typically a list of required layers needed to build the BSP.
  760. However, the dependencies should also contain information
  761. regarding any other dependencies the BSP might have.
  762. - Any required special licensing information. For example, this
  763. information includes information on special variables needed to
  764. satisfy a EULA, or instructions on information needed to build or
  765. distribute binaries built from the BSP Metadata.
  766. - The name and contact information for the BSP layer maintainer.
  767. This is the person to whom patches and questions should be sent.
  768. For information on how to find the right person, see the
  769. ":ref:`dev-manual/dev-manual-common-tasks:submitting a change to the yocto project`"
  770. section in the Yocto Project Development Tasks Manual.
  771. - Instructions on how to build the BSP using the BSP layer.
  772. - Instructions on how to boot the BSP build from the BSP layer.
  773. - Instructions on how to boot the binary images contained in the
  774. ``binary`` directory, if present.
  775. - Information on any known bugs or issues that users should know
  776. about when either building or booting the BSP binaries.
  777. - *README.sources File:* If your BSP contains binary images in the
  778. ``binary`` directory, you must include a ``README.sources`` file in
  779. the ``meta-bsp_root_name`` directory. This file specifies exactly
  780. where you can find the sources used to generate the binary images.
  781. - *Layer Configuration File:* You must include a ``conf/layer.conf``
  782. file in the ``meta-bsp_root_name`` directory. This file identifies
  783. the ``meta-bsp_root_name`` BSP layer as a layer to the build
  784. system.
  785. - *Machine Configuration File:* You must include one or more
  786. ``conf/machine/bsp_root_name.conf`` files in the
  787. ``meta-bsp_root_name`` directory. These configuration files define
  788. machine targets that can be built using the BSP layer. Multiple
  789. machine configuration files define variations of machine
  790. configurations that the BSP supports. If a BSP supports multiple
  791. machine variations, you need to adequately describe each variation in
  792. the BSP ``README`` file. Do not use multiple machine configuration
  793. files to describe disparate hardware. If you do have very different
  794. targets, you should create separate BSP layers for each target.
  795. .. note::
  796. It is completely possible for a developer to structure the working
  797. repository as a conglomeration of unrelated BSP files, and to possibly
  798. generate BSPs targeted for release from that directory using scripts or
  799. some other mechanism (e.g. ``meta-yocto-bsp`` layer). Such considerations
  800. are outside the scope of this document.
  801. Released BSP Recommendations
  802. ----------------------------
  803. Following are recommendations for released BSPs that conform to the
  804. Yocto Project:
  805. - *Bootable Images:* Released BSPs can contain one or more bootable
  806. images. Including bootable images allows users to easily try out the
  807. BSP using their own hardware.
  808. In some cases, it might not be convenient to include a bootable
  809. image. If so, you might want to make two versions of the BSP
  810. available: one that contains binary images, and one that does not.
  811. The version that does not contain bootable images avoids unnecessary
  812. download times for users not interested in the images.
  813. If you need to distribute a BSP and include bootable images or build
  814. kernel and filesystems meant to allow users to boot the BSP for
  815. evaluation purposes, you should put the images and artifacts within a
  816. ``binary/`` subdirectory located in the ``meta-bsp_root_name``
  817. directory.
  818. .. note::
  819. If you do include a bootable image as part of the BSP and the
  820. image was built by software covered by the GPL or other open
  821. source licenses, it is your responsibility to understand and meet
  822. all licensing requirements, which could include distribution of
  823. source files.
  824. - *Use a Yocto Linux Kernel:* Kernel recipes in the BSP should be based
  825. on a Yocto Linux kernel. Basing your recipes on these kernels reduces
  826. the costs for maintaining the BSP and increases its scalability. See
  827. the ``Yocto Linux Kernel`` category in the
  828. :yocto_git:`Source Repositories <>` for these kernels.
  829. Customizing a Recipe for a BSP
  830. ==============================
  831. If you plan on customizing a recipe for a particular BSP, you need to do
  832. the following:
  833. - Create a ``*.bbappend`` file for the modified recipe. For information on using
  834. append files, see the ":ref:`dev-manual/dev-manual-common-tasks:using
  835. .bbappend files in your layer`" section in the Yocto Project Development
  836. Tasks Manual.
  837. - Ensure your directory structure in the BSP layer that supports your
  838. machine is such that the OpenEmbedded build system can find it. See
  839. the example later in this section for more information.
  840. - Put the append file in a directory whose name matches the machine's
  841. name and is located in an appropriate sub-directory inside the BSP
  842. layer (i.e. ``recipes-bsp``, ``recipes-graphics``, ``recipes-core``,
  843. and so forth).
  844. - Place the BSP-specific files in the proper directory inside the BSP
  845. layer. How expansive the layer is affects where you must place these
  846. files. For example, if your layer supports several different machine
  847. types, you need to be sure your layer's directory structure includes
  848. hierarchy that separates the files according to machine. If your
  849. layer does not support multiple machines, the layer would not have
  850. that additional hierarchy and the files would obviously not be able
  851. to reside in a machine-specific directory.
  852. Following is a specific example to help you better understand the
  853. process. This example customizes customizes a recipe by adding a
  854. BSP-specific configuration file named ``interfaces`` to the
  855. ``init-ifupdown_1.0.bb`` recipe for machine "xyz" where the BSP layer
  856. also supports several other machines:
  857. #. Edit the ``init-ifupdown_1.0.bbappend`` file so that it contains the
  858. following: ::
  859. FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
  860. The append file needs to be in the ``meta-xyz/recipes-core/init-ifupdown``
  861. directory.
  862. #. Create and place the new ``interfaces`` configuration file in the
  863. BSP's layer here: ::
  864. meta-xyz/recipes-core/init-ifupdown/files/xyz-machine-one/interfaces
  865. .. note::
  866. If the meta-xyz layer did not support multiple machines, you would place
  867. the interfaces configuration file in the layer here: ::
  868. meta-xyz/recipes-core/init-ifupdown/files/interfaces
  869. The :term:`FILESEXTRAPATHS` variable in the append files extends the search
  870. path the build system uses to find files during the build. Consequently, for
  871. this example you need to have the ``files`` directory in the same location as
  872. your append file.
  873. BSP Licensing Considerations
  874. ============================
  875. In some cases, a BSP contains separately-licensed Intellectual Property
  876. (IP) for a component or components. For these cases, you are required to
  877. accept the terms of a commercial or other type of license that requires
  878. some kind of explicit End User License Agreement (EULA). Once you accept
  879. the license, the OpenEmbedded build system can then build and include
  880. the corresponding component in the final BSP image. If the BSP is
  881. available as a pre-built image, you can download the image after
  882. agreeing to the license or EULA.
  883. You could find that some separately-licensed components that are
  884. essential for normal operation of the system might not have an
  885. unencumbered (or free) substitute. Without these essential components,
  886. the system would be non-functional. Then again, you might find that
  887. other licensed components that are simply 'good-to-have' or purely
  888. elective do have an unencumbered, free replacement component that you
  889. can use rather than agreeing to the separately-licensed component. Even
  890. for components essential to the system, you might find an unencumbered
  891. component that is not identical but will work as a less-capable version
  892. of the licensed version in the BSP recipe.
  893. For cases where you can substitute a free component and still maintain
  894. the system's functionality, the "DOWNLOADS" selection from the
  895. "SOFTWARE" tab on the :yocto_home:`Yocto Project Website <>` makes
  896. available de-featured BSPs that are completely free of any IP
  897. encumbrances. For these cases, you can use the substitution directly and
  898. without any further licensing requirements. If present, these fully
  899. de-featured BSPs are named appropriately different as compared to the
  900. names of their respective encumbered BSPs. If available, these
  901. substitutions are your simplest and most preferred options. Obviously,
  902. use of these substitutions assumes the resulting functionality meets
  903. system requirements.
  904. .. note::
  905. If however, a non-encumbered version is unavailable or it provides
  906. unsuitable functionality or quality, you can use an encumbered
  907. version.
  908. A couple different methods exist within the OpenEmbedded build system to
  909. satisfy the licensing requirements for an encumbered BSP. The following
  910. list describes them in order of preference:
  911. #. *Use the LICENSE_FLAGS Variable to Define the Recipes that Have Commercial or
  912. Other Types of Specially-Licensed Packages:* For each of those recipes, you can
  913. specify a matching license string in a ``local.conf`` variable named
  914. :term:`LICENSE_FLAGS_WHITELIST`.
  915. Specifying the matching license string signifies that you agree to
  916. the license. Thus, the build system can build the corresponding
  917. recipe and include the component in the image. See the
  918. ":ref:`dev-manual/dev-manual-common-tasks:enabling commercially licensed recipes`"
  919. section in the Yocto Project Development Tasks Manual for details on
  920. how to use these variables.
  921. If you build as you normally would, without specifying any recipes in
  922. the ``LICENSE_FLAGS_WHITELIST``, the build stops and provides you
  923. with the list of recipes that you have tried to include in the image
  924. that need entries in the ``LICENSE_FLAGS_WHITELIST``. Once you enter
  925. the appropriate license flags into the whitelist, restart the build
  926. to continue where it left off. During the build, the prompt will not
  927. appear again since you have satisfied the requirement.
  928. Once the appropriate license flags are on the white list in the
  929. ``LICENSE_FLAGS_WHITELIST`` variable, you can build the encumbered
  930. image with no change at all to the normal build process.
  931. #. *Get a Pre-Built Version of the BSP:* You can get this type of BSP by
  932. selecting the "DOWNLOADS" item from the "SOFTWARE" tab on the
  933. :yocto_home:`Yocto Project website <>`. You can download BSP tarballs
  934. that contain proprietary components after agreeing to the licensing
  935. requirements of each of the individually encumbered packages as part
  936. of the download process. Obtaining the BSP this way allows you to
  937. access an encumbered image immediately after agreeing to the
  938. click-through license agreements presented by the website. If you
  939. want to build the image yourself using the recipes contained within
  940. the BSP tarball, you will still need to create an appropriate
  941. ``LICENSE_FLAGS_WHITELIST`` to match the encumbered recipes in the
  942. BSP.
  943. .. note::
  944. Pre-compiled images are bundled with a time-limited kernel that runs
  945. for a predetermined amount of time (10 days) before it forces the
  946. system to reboot. This limitation is meant to discourage direct
  947. redistribution of the image. You must eventually rebuild the image if
  948. you want to remove this restriction.
  949. Creating a new BSP Layer Using the ``bitbake-layers`` Script
  950. ============================================================
  951. The ``bitbake-layers create-layer`` script automates creating a BSP
  952. layer. What makes a layer a "BSP layer" is the presence of at least one
  953. machine configuration file. Additionally, a BSP layer usually has a
  954. kernel recipe or an append file that leverages off an existing kernel
  955. recipe. The primary requirement, however, is the machine configuration.
  956. Use these steps to create a BSP layer:
  957. - *Create a General Layer:* Use the ``bitbake-layers`` script with the
  958. ``create-layer`` subcommand to create a new general layer. For
  959. instructions on how to create a general layer using the
  960. ``bitbake-layers`` script, see the
  961. ":ref:`dev-manual/dev-manual-common-tasks:creating a general layer using the \`\`bitbake-layers\`\` script`"
  962. section in the Yocto Project Development Tasks Manual.
  963. - *Create a Layer Configuration File:* Every layer needs a layer
  964. configuration file. This configuration file establishes locations for
  965. the layer's recipes, priorities for the layer, and so forth. You can
  966. find examples of ``layer.conf`` files in the Yocto Project
  967. :yocto_git:`Source Repositories <>`. To get examples of what you need
  968. in your configuration file, locate a layer (e.g. "meta-ti") and
  969. examine the
  970. :yocto_git:`local.conf </cgit/cgit.cgi/meta-ti/tree/conf/layer.conf>`
  971. file.
  972. - *Create a Machine Configuration File:* Create a
  973. ``conf/machine/bsp_root_name.conf`` file. See
  974. :yocto_git:`meta-yocto-bsp/conf/machine </cgit/cgit.cgi/poky/tree/meta-yocto-bsp/conf/machine>`
  975. for sample ``bsp_root_name.conf`` files. Other samples such as
  976. :yocto_git:`meta-ti </cgit/cgit.cgi/meta-ti/tree/conf/machine>`
  977. and
  978. :yocto_git:`meta-freescale </cgit/cgit.cgi/meta-freescale/tree/conf/machine>`
  979. exist from other vendors that have more specific machine and tuning
  980. examples.
  981. - *Create a Kernel Recipe:* Create a kernel recipe in
  982. ``recipes-kernel/linux`` by either using a kernel append file or a
  983. new custom kernel recipe file (e.g. ``yocto-linux_4.12.bb``). The BSP
  984. layers mentioned in the previous step also contain different kernel
  985. examples. See the ":ref:`kernel-dev/kernel-dev-common:modifying an existing recipe`"
  986. section in the Yocto Project Linux Kernel Development Manual for
  987. information on how to create a custom kernel.
  988. The remainder of this section provides a description of the Yocto
  989. Project reference BSP for Beaglebone, which resides in the
  990. :yocto_git:`meta-yocto-bsp </cgit/cgit.cgi/poky/tree/meta-yocto-bsp>`
  991. layer.
  992. BSP Layer Configuration Example
  993. -------------------------------
  994. The layer's ``conf`` directory contains the ``layer.conf`` configuration
  995. file. In this example, the ``conf/layer.conf`` is the following: ::
  996. # We have a conf and classes directory, add to BBPATH
  997. BBPATH .= ":${LAYERDIR}"
  998. # We have recipes-\* directories, add to BBFILES
  999. BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
  1000. ${LAYERDIR}/recipes-*/*/*.bbappend"
  1001. BBFILE_COLLECTIONS += "yoctobsp"
  1002. BBFILE_PATTERN_yoctobsp = "^${LAYERDIR}/"
  1003. BBFILE_PRIORITY_yoctobsp = "5"
  1004. LAYERVERSION_yoctobsp = "4"
  1005. LAYERSERIES_COMPAT_yoctobsp = "&DISTRO_NAME_NO_CAP;"
  1006. The variables used in this file configure the layer. A good way to learn about layer
  1007. configuration files is to examine various files for BSP from the
  1008. :yocto_git:`Source Repositories <>`.
  1009. For a detailed description of this particular layer configuration file,
  1010. see ":ref:`step 3 <dev-manual/dev-manual-common-tasks:creating your own layer>`"
  1011. in the discussion that describes how to create layers in the Yocto
  1012. Project Development Tasks Manual.
  1013. BSP Machine Configuration Example
  1014. ---------------------------------
  1015. As mentioned earlier in this section, the existence of a machine
  1016. configuration file is what makes a layer a BSP layer as compared to a
  1017. general or kernel layer.
  1018. One or more machine configuration files exist in the
  1019. ``bsp_layer/conf/machine/`` directory of the layer: ::
  1020. bsp_layer/conf/machine/machine1\.conf``
  1021. bsp_layer/conf/machine/machine2\.conf``
  1022. bsp_layer/conf/machine/machine3\.conf``
  1023. ... more ...
  1024. For example, the machine configuration file for the `BeagleBone and
  1025. BeagleBone Black development boards <http://beagleboard.org/bone>`__ is
  1026. located in the layer ``poky/meta-yocto-bsp/conf/machine`` and is named
  1027. ``beaglebone-yocto.conf``: ::
  1028. #@TYPE: Machine
  1029. #@NAME: Beaglebone-yocto machine
  1030. #@DESCRIPTION: Reference machine configuration for http://beagleboard.org/bone and http://beagleboard.org/black boards
  1031. PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
  1032. XSERVER ?= "xserver-xorg \
  1033. xf86-video-modesetting \
  1034. "
  1035. MACHINE_EXTRA_RRECOMMENDS = "kernel-modules kernel-devicetree"
  1036. EXTRA_IMAGEDEPENDS += "u-boot"
  1037. DEFAULTTUNE ?= "cortexa8hf-neon"
  1038. include conf/machine/include/tune-cortexa8.inc
  1039. IMAGE_FSTYPES += "tar.bz2 jffs2 wic wic.bmap"
  1040. EXTRA_IMAGECMD_jffs2 = "-lnp "
  1041. WKS_FILE ?= "beaglebone-yocto.wks"
  1042. IMAGE_INSTALL_append = " kernel-devicetree kernel-image-zimage"
  1043. do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
  1044. SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyO0"
  1045. SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
  1046. PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
  1047. PREFERRED_VERSION_linux-yocto ?= "5.0%"
  1048. KERNEL_IMAGETYPE = "zImage"
  1049. KERNEL_DEVICETREE = "am335x-bone.dtb am335x-boneblack.dtb am335x-bonegreen.dtb"
  1050. KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
  1051. SPL_BINARY = "MLO"
  1052. UBOOT_SUFFIX = "img"
  1053. UBOOT_MACHINE = "am335x_evm_defconfig"
  1054. UBOOT_ENTRYPOINT = "0x80008000"
  1055. UBOOT_LOADADDRESS = "0x80008000"
  1056. MACHINE_FEATURES = "usbgadget usbhost vfat alsa"
  1057. IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO zImage am335x-bone.dtb am335x-boneblack.dtb am335x-bonegreen.dtb"
  1058. The variables used to configure the machine define machine-specific properties; for
  1059. example, machine-dependent packages, machine tunings, the type of kernel
  1060. to build, and U-Boot configurations.
  1061. The following list provides some explanation for the statements found in
  1062. the example reference machine configuration file for the BeagleBone
  1063. development boards. Realize that much more can be defined as part of a
  1064. machine's configuration file. In general, you can learn about related
  1065. variables that this example does not have by locating the variables in
  1066. the ":ref:`ref-manual/ref-variables:variables glossary`" in the Yocto
  1067. Project Reference Manual.
  1068. - :term:`PREFERRED_PROVIDER_virtual/xserver <PREFERRED_PROVIDER>`:
  1069. The recipe that provides "virtual/xserver" when more than one
  1070. provider is found. In this case, the recipe that provides
  1071. "virtual/xserver" is "xserver-xorg", which exists in
  1072. ``poky/meta/recipes-graphics/xorg-xserver``.
  1073. - :term:`XSERVER`: The packages that
  1074. should be installed to provide an X server and drivers for the
  1075. machine. In this example, the "xserver-xorg" and
  1076. "xf86-video-modesetting" are installed.
  1077. - :term:`MACHINE_EXTRA_RRECOMMENDS`:
  1078. A list of machine-dependent packages not essential for booting the
  1079. image. Thus, the build does not fail if the packages do not exist.
  1080. However, the packages are required for a fully-featured image.
  1081. .. tip::
  1082. Many ``MACHINE\*`` variables exist that help you configure a particular piece
  1083. of hardware.
  1084. - :term:`EXTRA_IMAGEDEPENDS`:
  1085. Recipes to build that do not provide packages for installing into the
  1086. root filesystem but building the image depends on the recipes.
  1087. Sometimes a recipe is required to build the final image but is not
  1088. needed in the root filesystem. In this case, the U-Boot recipe must
  1089. be built for the image.
  1090. - :term:`DEFAULTTUNE`: Machines
  1091. use tunings to optimize machine, CPU, and application performance.
  1092. These features, which are collectively known as "tuning features",
  1093. exist in the :term:`OpenEmbedded-Core (OE-Core)` layer (e.g.
  1094. ``poky/meta/conf/machine/include``). In this example, the default
  1095. tunning file is "cortexa8hf-neon".
  1096. .. note::
  1097. The include statement that pulls in the
  1098. conf/machine/include/tune-cortexa8.inc file provides many tuning
  1099. possibilities.
  1100. - :term:`IMAGE_FSTYPES`: The
  1101. formats the OpenEmbedded build system uses during the build when
  1102. creating the root filesystem. In this example, four types of images
  1103. are supported.
  1104. - :term:`EXTRA_IMAGECMD`:
  1105. Specifies additional options for image creation commands. In this
  1106. example, the "-lnp " option is used when creating the
  1107. `JFFS2 <https://en.wikipedia.org/wiki/JFFS2>`__ image.
  1108. - :term:`WKS_FILE`: The location of
  1109. the :ref:`Wic kickstart <ref-manual/ref-kickstart:openembedded kickstart (\`\`.wks\`\`) reference>` file used
  1110. by the OpenEmbedded build system to create a partitioned image
  1111. (image.wic).
  1112. - :term:`IMAGE_INSTALL`:
  1113. Specifies packages to install into an image through the
  1114. :ref:`image <ref-classes-image>` class. Recipes
  1115. use the ``IMAGE_INSTALL`` variable.
  1116. - ``do_image_wic[depends]``: A task that is constructed during the
  1117. build. In this example, the task depends on specific tools in order
  1118. to create the sysroot when buiding a Wic image.
  1119. - :term:`SERIAL_CONSOLES`:
  1120. Defines a serial console (TTY) to enable using getty. In this case,
  1121. the baud rate is "115200" and the device name is "ttyO0".
  1122. - :term:`PREFERRED_PROVIDER_virtual/kernel <PREFERRED_PROVIDER>`:
  1123. Specifies the recipe that provides "virtual/kernel" when more than
  1124. one provider is found. In this case, the recipe that provides
  1125. "virtual/kernel" is "linux-yocto", which exists in the layer's
  1126. ``recipes-kernel/linux`` directory.
  1127. - :term:`PREFERRED_VERSION_linux-yocto <PREFERRED_VERSION>`:
  1128. Defines the version of the recipe used to build the kernel, which is
  1129. "5.0" in this case.
  1130. - :term:`KERNEL_IMAGETYPE`:
  1131. The type of kernel to build for the device. In this case, the
  1132. OpenEmbedded build system creates a "zImage" image type.
  1133. - :term:`KERNEL_DEVICETREE`:
  1134. The names of the generated Linux kernel device trees (i.e. the
  1135. ``*.dtb``) files. All the device trees for the various BeagleBone
  1136. devices are included.
  1137. - :term:`KERNEL_EXTRA_ARGS`:
  1138. Additional ``make`` command-line arguments the OpenEmbedded build
  1139. system passes on when compiling the kernel. In this example,
  1140. ``LOADADDR=${UBOOT_ENTRYPOINT}`` is passed as a command-line argument.
  1141. - :term:`SPL_BINARY`: Defines the
  1142. Secondary Program Loader (SPL) binary type. In this case, the SPL
  1143. binary is set to "MLO", which stands for Multimedia card LOader.
  1144. The BeagleBone development board requires an SPL to boot and that SPL
  1145. file type must be MLO. Consequently, the machine configuration needs
  1146. to define ``SPL_BINARY`` as ``MLO``.
  1147. .. note::
  1148. For more information on how the SPL variables are used, see the u-boot.inc
  1149. include file.
  1150. - :term:`UBOOT_* <UBOOT_ENTRYPOINT>`: Defines
  1151. various U-Boot configurations needed to build a U-Boot image. In this
  1152. example, a U-Boot image is required to boot the BeagleBone device.
  1153. See the following variables for more information:
  1154. - :term:`UBOOT_SUFFIX`:
  1155. Points to the generated U-Boot extension.
  1156. - :term:`UBOOT_MACHINE`:
  1157. Specifies the value passed on the make command line when building
  1158. a U-Boot image.
  1159. - :term:`UBOOT_ENTRYPOINT`:
  1160. Specifies the entry point for the U-Boot image.
  1161. - :term:`UBOOT_LOADADDRESS`:
  1162. Specifies the load address for the U-Boot image.
  1163. - :term:`MACHINE_FEATURES`:
  1164. Specifies the list of hardware features the BeagleBone device is
  1165. capable of supporting. In this case, the device supports "usbgadget
  1166. usbhost vfat alsa".
  1167. - :term:`IMAGE_BOOT_FILES`:
  1168. Files installed into the device's boot partition when preparing the
  1169. image using the Wic tool with the ``bootimg-partition`` or
  1170. ``bootimg-efi`` source plugin.
  1171. BSP Kernel Recipe Example
  1172. -------------------------
  1173. The kernel recipe used to build the kernel image for the BeagleBone
  1174. device was established in the machine configuration: ::
  1175. PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
  1176. PREFERRED_VERSION_linux-yocto ?= "5.0%"
  1177. The ``meta-yocto-bsp/recipes-kernel/linux`` directory in the layer contains
  1178. metadata used to build the kernel. In this case, a kernel append file
  1179. (i.e. ``linux-yocto_5.0.bbappend``) is used to override an established
  1180. kernel recipe (i.e. ``linux-yocto_5.0.bb``), which is located in
  1181. https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/linux.
  1182. Following is the contents of the append file: ::
  1183. KBRANCH_genericx86 = "v5.0/standard/base"
  1184. KBRANCH_genericx86-64 = "v5.0/standard/base"
  1185. KBRANCH_edgerouter = "v5.0/standard/edgerouter"
  1186. KBRANCH_beaglebone-yocto = "v5.0/standard/beaglebone"
  1187. KMACHINE_genericx86 ?= "common-pc"
  1188. KMACHINE_genericx86-64 ?= "common-pc-64"
  1189. KMACHINE_beaglebone-yocto ?= "beaglebone"
  1190. SRCREV_machine_genericx86 ?= "3df4aae6074e94e794e27fe7f17451d9353cdf3d"
  1191. SRCREV_machine_genericx86-64 ?= "3df4aae6074e94e794e27fe7f17451d9353cdf3d"
  1192. SRCREV_machine_edgerouter ?= "3df4aae6074e94e794e27fe7f17451d9353cdf3d"
  1193. SRCREV_machine_beaglebone-yocto ?= "3df4aae6074e94e794e27fe7f17451d9353cdf3d"
  1194. COMPATIBLE_MACHINE_genericx86 = "genericx86"
  1195. COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
  1196. COMPATIBLE_MACHINE_edgerouter = "edgerouter"
  1197. COMPATIBLE_MACHINE_beaglebone-yocto = "beaglebone-yocto"
  1198. LINUX_VERSION_genericx86 = "5.0.3"
  1199. LINUX_VERSION_genericx86-64 = "5.0.3"
  1200. LINUX_VERSION_edgerouter = "5.0.3"
  1201. LINUX_VERSION_beaglebone-yocto = "5.0.3"
  1202. This particular append file works for all the machines that are
  1203. part of the ``meta-yocto-bsp`` layer. The relevant statements are
  1204. appended with the "beaglebone-yocto" string. The OpenEmbedded build
  1205. system uses these statements to override similar statements in the
  1206. kernel recipe:
  1207. - :term:`KBRANCH`: Identifies the
  1208. kernel branch that is validated, patched, and configured during the
  1209. build.
  1210. - :term:`KMACHINE`: Identifies the
  1211. machine name as known by the kernel, which is sometimes a different
  1212. name than what is known by the OpenEmbedded build system.
  1213. - :term:`SRCREV`: Identifies the
  1214. revision of the source code used to build the image.
  1215. - :term:`COMPATIBLE_MACHINE`:
  1216. A regular expression that resolves to one or more target machines
  1217. with which the recipe is compatible.
  1218. - :term:`LINUX_VERSION`: The
  1219. Linux version from kernel.org used by the OpenEmbedded build system
  1220. to build the kernel image.