diff options
Diffstat (limited to 'handbook/bsp.xml')
-rw-r--r-- | handbook/bsp.xml | 60 |
1 files changed, 45 insertions, 15 deletions
diff --git a/handbook/bsp.xml b/handbook/bsp.xml index 37dd166749..b897f0691d 100644 --- a/handbook/bsp.xml +++ b/handbook/bsp.xml | |||
@@ -28,18 +28,18 @@ | |||
28 | OpenEmbedded build systems. It is intended that this information can be | 28 | OpenEmbedded build systems. It is intended that this information can be |
29 | used by other systems besides Poky/OpenEmbedded and that it will be simple | 29 | used by other systems besides Poky/OpenEmbedded and that it will be simple |
30 | to extract information and convert to other formats if required. The format | 30 | to extract information and convert to other formats if required. The format |
31 | descriped can be directly accepted as a layer by Poky using its standard | 31 | described can be directly accepted as a layer by Poky using its standard |
32 | layers mechanism but its important to recognise that the BSP captures all | 32 | layers mechanism, but it is important to recognise that the BSP captures all |
33 | the hardware specific details in one place in a standard format which is | 33 | the hardware specific details in one place in a standard format, which is |
34 | useful for any person wishing to use the hardware platform regardless of | 34 | useful for any person wishing to use the hardware platform regardless of |
35 | the build system in use. | 35 | the build system in use. |
36 | </para> | 36 | </para> |
37 | 37 | ||
38 | <para> | 38 | <para> |
39 | The BSP specification does not include a build system or other tooling, | 39 | The BSP specification does not include a build system or other tools, |
40 | it is concerned with the hardware specific components only. At the end | 40 | it is concerned with the hardware specific components only. At the end |
41 | distribution point the BSP may be shipped combined with a build system | 41 | distribution point the BSP may be shipped combined with a build system |
42 | and other tools but it is important to maintain the distinction that these | 42 | and other tools, but it is important to maintain the distinction that these |
43 | are separate components which may just be combined in certain end products. | 43 | are separate components which may just be combined in certain end products. |
44 | </para> | 44 | </para> |
45 | 45 | ||
@@ -47,7 +47,7 @@ | |||
47 | <title>Example Filesystem Layout</title> | 47 | <title>Example Filesystem Layout</title> |
48 | 48 | ||
49 | <para> | 49 | <para> |
50 | The BSP consists of a file structure inside a base directory, meta-bsp in this example where "bsp" is a placeholder for the machine or platform name. Examples of some files that it could contain are: | 50 | The BSP consists of a file structure inside a base directory, meta-bsp in this example, where "bsp" is a placeholder for the machine or platform name. Examples of some files that it could contain are: |
51 | </para> | 51 | </para> |
52 | 52 | ||
53 | <para> | 53 | <para> |
@@ -108,9 +108,9 @@ BBPATH := "${BBPATH}${LAYERDIR}" | |||
108 | # We have a packages directory, add to BBFILES | 108 | # We have a packages directory, add to BBFILES |
109 | BBFILES := "${BBFILES} ${LAYERDIR}/packages/*/*.bb" | 109 | BBFILES := "${BBFILES} ${LAYERDIR}/packages/*/*.bb" |
110 | 110 | ||
111 | BBFILE_COLLECTIONS += "meta-bsp" | 111 | BBFILE_COLLECTIONS += "bsp" |
112 | BBFILE_PATTERN_meta-bsp := "^${LAYERDIR}/" | 112 | BBFILE_PATTERN_bsp := "^${LAYERDIR}/" |
113 | BBFILE_PRIORITY_meta-bsp = "5" | 113 | BBFILE_PRIORITY_bsp = "5" |
114 | </programlisting> | 114 | </programlisting> |
115 | </para> | 115 | </para> |
116 | 116 | ||
@@ -129,7 +129,7 @@ BBFILE_PRIORITY_meta-bsp = "5" | |||
129 | 129 | ||
130 | <para> | 130 | <para> |
131 | The machine files bind together all the information contained elsewhere | 131 | The machine files bind together all the information contained elsewhere |
132 | in the BSP into a format that Poky/OpenEmbedded can understand it in. If | 132 | in the BSP into a format that Poky/OpenEmbedded can understand. If |
133 | the BSP supports multiple machines, multiple machine configuration files | 133 | the BSP supports multiple machines, multiple machine configuration files |
134 | can be present. These filenames correspond to the values users set the | 134 | can be present. These filenames correspond to the values users set the |
135 | MACHINE variable to. | 135 | MACHINE variable to. |
@@ -139,7 +139,7 @@ BBFILE_PRIORITY_meta-bsp = "5" | |||
139 | These files would define things like which kernel package to use | 139 | These files would define things like which kernel package to use |
140 | (PREFERRED_PROVIDER of virtual/kernel), which hardware drivers to | 140 | (PREFERRED_PROVIDER of virtual/kernel), which hardware drivers to |
141 | include in different types of images, any special software components | 141 | include in different types of images, any special software components |
142 | that are needed, any bootloader information and also any special image | 142 | that are needed, any bootloader information, and also any special image |
143 | format requirements. | 143 | format requirements. |
144 | </para> | 144 | </para> |
145 | 145 | ||
@@ -165,7 +165,7 @@ TARGET_CC_ARCH = "-m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse" | |||
165 | </para> | 165 | </para> |
166 | <para> | 166 | <para> |
167 | which defines a new package architecture called "core2" and uses the | 167 | which defines a new package architecture called "core2" and uses the |
168 | optimisation flags specified which are carefully chosen to give best | 168 | optimization flags specified, which are carefully chosen to give best |
169 | performance on atom cpus. | 169 | performance on atom cpus. |
170 | </para> | 170 | </para> |
171 | <para> | 171 | <para> |
@@ -182,7 +182,7 @@ TARGET_CC_ARCH = "-m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse" | |||
182 | 182 | ||
183 | <para> | 183 | <para> |
184 | These files make up the definition of a kernel to use with this | 184 | These files make up the definition of a kernel to use with this |
185 | hardware. In this case its a complete self contained kernel with its own | 185 | hardware. In this case it is a complete self contained kernel with its own |
186 | configuration and patches but kernels can be shared between many | 186 | configuration and patches but kernels can be shared between many |
187 | machines as well. Taking some specific example files: | 187 | machines as well. Taking some specific example files: |
188 | </para> | 188 | </para> |
@@ -197,7 +197,7 @@ meta-bsp/packages/linux/linux-bsp_2.6.50.bb | |||
197 | be a release tarball, some git repository or source included in | 197 | be a release tarball, some git repository or source included in |
198 | the directory within the BSP itself. It then contains information about which | 198 | the directory within the BSP itself. It then contains information about which |
199 | patches to apply and how to configure and build it. It can reuse the main | 199 | patches to apply and how to configure and build it. It can reuse the main |
200 | Poky kernel build class meaning the definitions here can remain very simple. | 200 | Poky kernel build class, so the definitions here can remain very simple. |
201 | </para> | 201 | </para> |
202 | <para> | 202 | <para> |
203 | <programlisting> | 203 | <programlisting> |
@@ -229,7 +229,7 @@ meta-bsp/packages/linux/linux-bsp-2.6.50/defconfig-bsp | |||
229 | <para> | 229 | <para> |
230 | This area includes other pieces of software which the hardware may need for best | 230 | This area includes other pieces of software which the hardware may need for best |
231 | operation. These are just examples of the kind of things that may be | 231 | operation. These are just examples of the kind of things that may be |
232 | encountered. The are standard .bb file recipes in the usual Poky format | 232 | encountered. The are standard .bb file recipes in the usual Poky format, |
233 | so for examples, see standard Poky recipes. The source can be included directly, | 233 | so for examples, see standard Poky recipes. The source can be included directly, |
234 | referred to in source control systems or release tarballs of external software projects. | 234 | referred to in source control systems or release tarballs of external software projects. |
235 | </para> | 235 | </para> |
@@ -269,6 +269,36 @@ meta-bsp/packages/image-creator/image-creator-native_0.1.bb | |||
269 | </para> | 269 | </para> |
270 | </section> | 270 | </section> |
271 | 271 | ||
272 | <section id='bs-filelayout-bbappend'> | ||
273 | <title>Append BSP specific information to existing recipes</title> | ||
274 | |||
275 | <para> | ||
276 | Say you have a recipe like pointercal which has machine specific information in it, | ||
277 | and then you have your new bsp code in a layer. Before .bbappend extension is | ||
278 | introduced, you have to copy the whole pointercal recipe and files into your layer, | ||
279 | and then add the single file for your machine which is ugly. | ||
280 | |||
281 | .bbappend makes above work much easier, to allow bsp specific information merged | ||
282 | with original recipe easily. When bitbake finds any X.bbappend files, they will be | ||
283 | included after bitbake loads X.bb but before finalise and any anonymous methods run. | ||
284 | This allows bsp layer to poke around and do whatever it might want to customise | ||
285 | the original recipe. | ||
286 | |||
287 | .bbappend is expected to include below two lines in the head (which may be changed | ||
288 | in the future): | ||
289 | </para> | ||
290 | |||
291 | <programlisting> | ||
292 | THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" | ||
293 | FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:" | ||
294 | </programlisting> | ||
295 | |||
296 | <para> | ||
297 | Then bsp could add machine specific config files in layer directory, which will be | ||
298 | added by bitbake. You could look at meta-emenlow/packages/formfactor as example | ||
299 | </para> | ||
300 | </section> | ||
301 | |||
272 | <section id='bsp-filelayout-prebuilds'> | 302 | <section id='bsp-filelayout-prebuilds'> |
273 | <title>Prebuild Data (meta-bsp/prebuilds/*)</title> | 303 | <title>Prebuild Data (meta-bsp/prebuilds/*)</title> |
274 | 304 | ||