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