summaryrefslogtreecommitdiffstats
path: root/documentation/kernel-manual
diff options
context:
space:
mode:
authorScott Rifenbark <scott.m.rifenbark@intel.com>2010-11-24 15:30:07 -0800
committerSaul Wold <Saul.Wold@intel.com>2010-12-10 22:01:12 -0800
commitb89a971761d0b07fa24cafff44f3716b81bc2e78 (patch)
tree07d90fa814a4c805e144c62e6e13a619b2533b29 /documentation/kernel-manual
parent7dbdd91eb997fa215a99eb51b1c4c39d8f29c099 (diff)
downloadpoky-b89a971761d0b07fa24cafff44f3716b81bc2e78.tar.gz
documentation/kernel-manual/yocto-project-kernel-manual.xml: Added a new section called "BSP: Creating:
this section is based on an email that Bruce Ashfield sent me. It replaces what was in there in the form of sub-sections for creating a new BSP, cloning one and bsp bootstrapping.
Diffstat (limited to 'documentation/kernel-manual')
-rw-r--r--documentation/kernel-manual/yocto-project-kernel-manual.xml151
1 files changed, 142 insertions, 9 deletions
diff --git a/documentation/kernel-manual/yocto-project-kernel-manual.xml b/documentation/kernel-manual/yocto-project-kernel-manual.xml
index 6d93975019..1c247bcd74 100644
--- a/documentation/kernel-manual/yocto-project-kernel-manual.xml
+++ b/documentation/kernel-manual/yocto-project-kernel-manual.xml
@@ -360,7 +360,7 @@ kernel toolkit:
360</section> --> 360</section> -->
361 361
362<section id='actions'> 362<section id='actions'>
363 <title>How to get things accomplished with the kernel</title> 363 <title>How to Get Things Accomplished with the Kernel</title>
364 <para> 364 <para>
365 This section describes how to accomplish tasks involving the kernel's tree structure. 365 This section describes how to accomplish tasks involving the kernel's tree structure.
366 The information covers the following: 366 The information covers the following:
@@ -1163,7 +1163,7 @@ The following example illustrates one variant of this workflow:
1163</literallayout> 1163</literallayout>
1164</para> --> 1164</para> -->
1165 </section> 1165 </section>
1166 </section> 1166 </section>
1167 1167
1168<!-- <section id='bsp-template-migration-from-2'> 1168<!-- <section id='bsp-template-migration-from-2'>
1169 <title>BSP: Template Migration from 2.0</title> 1169 <title>BSP: Template Migration from 2.0</title>
@@ -1240,7 +1240,140 @@ That's it. Configure and build.
1240</para> 1240</para>
1241 </section> --> 1241 </section> -->
1242 1242
1243 <section id='bsp-creating-a-new-bsp'> 1243
1244
1245 <section id='bsp-creating'>
1246 <title>BSP: Creating</title>
1247 <para>
1248 This section provides an example for creating a BSP based on an existing, and hopefully,
1249 similar one.
1250 Follow these steps and keep in mind your particular situation and differences:
1251 <orderedlist>
1252 <listitem><para>Get a machine configuration file that matches your machine.</para>
1253 <para>You can start with something in <filename>meta/conf/machine</filename>.
1254 Or, <filename>meta-emenlow/conf/machine</filename> has an example in its own layer.</para>
1255 <para>The most up-to-date machines that are probably most similar to yours and that you might want
1256 to look at are <filename>meta/conf/machine/atom-pc.conf</filename> and
1257 <filename>meta-emenlow/conf/machine/emenlow.conf</filename>.
1258 Both of these were either just added or upgraded to use the Yocto Project kernel
1259 at <ulink url='http://git.pokylinux.org/cgit/cgit.cgi/linux-2.6-windriver/'></ulink>.
1260 The main difference between them is that "emenlow" is in its own layer.
1261 It is in its own layer because it needs extra machine-specific packages such as its
1262 own video driver and other supporting packages.
1263 The "atom-pc" is simpler and does not need any special packages - everything it needs can
1264 be specified in the configuration file.
1265 The "atom-pc" machine also supports all of Asus eee901, Acer Aspire One, Toshiba NB305,
1266 and the Intel&reg; Embedded Development Board 1-N450 with no changes.</para>
1267 <para>If you want to make minor changes to support a slightly different machine, you can
1268 create a new configuration file for it and add it alongside the others.
1269 You might consider keeping the common stuff separate and including it.</para>
1270 <para>Similarly, you can also use multiple configuration files for different machines even
1271 if you do it as a separate layer like meta-emenlow.</para>
1272 <para>As an example consider this:
1273 <itemizedlist>
1274 <listitem><para>Copy meta-emenlow</para></listitem>
1275 <listitem><para>Fix or remove anything you do not need.
1276 For this example the only thing left was the kernel directory with a linux-yocto_git.bbappend
1277 file (linux-yocto is the kernel listed in
1278 <filename>meta-crownbay/conf/machine/crownbay.conf</filename>.
1279 Finally, a new entry to the <filename>build/donf/bblayers.conf</filename> was added so the
1280 new layer could be found by Bitbake.</para></listitem>
1281 </itemizedlist>
1282 </para></listitem>
1283 <listitem><para>Get an image with a working kernel built.</para>
1284 <para>For the kernel to compile successfully, you need to create a branch in the git repository
1285 specifically named for your machine.
1286 So first create a bare clone of the Yocto Project git repository, and then create a
1287 local clone of that:
1288 <literallayout class='monospaced'>
1289 $ git clone &dash;&dash;bare git://git.pokylinux.org/linux-2.6-windriver.git
1290 linux-2.6-windriver.git
1291 $ git clone linux-2.6-windriver.git linux-2.6-windriver
1292 </literallayout>
1293 </para>
1294 <para>Now create a branch in the local clone and push it to the bare clone:
1295 <literallayout class='monospaced'>
1296 $ git checkout -b crownbay-standard origin/standard $ git push origin crownbay-standard:crownbay-standard
1297 </literallayout>
1298 </para>
1299 <para>At this point, your git tree should be set up well enough to compile.</para></listitem>
1300 <listitem><para>Point the build at the new kernel git tree.</para>
1301 <para>You can do this by commenting out the SRC_URI variable in
1302 <filename>meta/recipes-kernel/linux/linux-yocto_git.bb</filename> and using a SRC_URI
1303 that points to your new bare git tree.
1304 You should also be able to do this in <filename>linux-yocto_git.bbappend</filename> in the layer:
1305 <literallayout class='monospaced'>
1306 # To use a staged, on-disk bare clone of a Wind River Kernel, use a variant of the
1307 # below SRC_URI = "git://///path/to/kernel/default_kernel.git;fullclone=1"
1308 #
1309 SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;fullclone=1;branch=${KBRANCH};name=machine
1310\
1311 git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;noclone=1;branch=wrs_meta;name=meta"
1312 </literallayout>
1313 </para>
1314 <para>After doing that, select the machine in <filename>build/conf/local.conf</filename>:
1315 <literallayout class='monospaced'>
1316 #
1317 MACHINE ?= "crownbay"
1318 #
1319 </literallayout>
1320 </para>
1321 <para>You should now be able to build and boot an image with the new kernel:
1322 <literallayout class='monospaced'>
1323 $ bitbake poky-image-sato-live
1324 </literallayout>
1325 </para>
1326 <para>Of course, that will give you a kernel with the default config, which is probably
1327 not what you want.
1328 If you just want to set some kernel config options, you can do that by putting them in a files.
1329 For example inserting the following into some <filename>.cfg</filename> file:
1330 <literallayout class='monospaced'>
1331 CONFIG_NETDEV_1000=y
1332 CONFIG_E1000E=y
1333 </literallayout>
1334 </para>
1335 <para>And, another <filename>.cfg</filename> file would contain:
1336 <literallayout class='monospaced'>
1337 CONFIG_LOG_BUF_SHIFT=18
1338
1339 http://git.pokylinux.org/cgit/cgit.cgi/linux-2.6-windriver/
1340
1341 SRC_URI_append_crownbay = " file://some.cfg \
1342 file://other.cfg \
1343 "
1344 </literallayout>
1345 </para>
1346 <para>You could also add these directly to the git repo's wrs_meta branch as well.
1347 However, the former method is probably easier.</para></listitem>
1348 <listitem><para>If you're also adding patches to the kernel, you can do the same thing.
1349 Put your patches in the SRC_URI as well (plus .cfg for their kernel config options if needed).</para>
1350 <para>Practically speaking, to generate the patches, you'd go to the source in the build tree:
1351 <literallayout class='monospaced'>
1352 build/tmp/work/crownbay-poky-linux/linux-yocto-2.6.34+git0+d1cd5c80ee97e81e130be8c3de3965b770f320d6_0+
13530431115c9d720fee5bb105f6a7411efb4f851d26-r13/linux
1354 </literallayout>
1355 </para>
1356 <para>Then, modify the code there, using quilt to save the changes, and recompile
1357 (bitbake -c compile -f)
1358 until it works.</para></listitem>
1359 <listitem><para>Once you have the final patch from quilt, copy it to the
1360 SRC_URI location, and it should be
1361 applied the next time you do a clean build.
1362 Of course, since you have a branch for the BSP in git, it would be better to put it there instead.
1363 For example, in this case, commit the patch to the crownbay-standard branch, and during the
1364 next build it will be applied from there.</para></listitem>
1365 </orderedlist>
1366 </para>
1367 </section>
1368
1369
1370
1371
1372
1373
1374
1375
1376<!-- <section id='bsp-creating-a-new-bsp'>
1244 <title>BSP: Creating a New BSP</title> 1377 <title>BSP: Creating a New BSP</title>
1245<para> 1378<para>
1246Although it is obvious that the structure of a new BSP uses the migrated 1379Although it is obvious that the structure of a new BSP uses the migrated
@@ -1260,7 +1393,7 @@ because the board template files are required to configure a project/build
1260and create the necessary environment to begin working directly with the 1393and create the necessary environment to begin working directly with the
1261kernel. If it is desired to start immediately with kernel development and 1394kernel. If it is desired to start immediately with kernel development and
1262then add LDAT bindings, see the "bootstrapping a BSP" section. 1395then add LDAT bindings, see the "bootstrapping a BSP" section.
1263</para> 1396</para>
1264 <section id='creating-from-scratch'> 1397 <section id='creating-from-scratch'>
1265 <title>Creating the BSP from Scratch</title> 1398 <title>Creating the BSP from Scratch</title>
1266<para> 1399<para>
@@ -1324,7 +1457,7 @@ Now you can configure a kernel:
1324You now have a kernel tree, which is branched and has no patches, ready for 1457You now have a kernel tree, which is branched and has no patches, ready for
1325development. 1458development.
1326</para> 1459</para>
1327 </section> 1460 </section> -->
1328 1461
1329<!-- <section id='cloning-an-existing-bsp'> 1462<!-- <section id='cloning-an-existing-bsp'>
1330 <title>Cloning an Existing BSP</title> 1463 <title>Cloning an Existing BSP</title>
@@ -1518,8 +1651,8 @@ Make changes, import patches, etc.
1518 the relevant branches and structures and the special build options are no 1651 the relevant branches and structures and the special build options are no
1519 longer required. 1652 longer required.
1520</para> 1653</para>
1521 </section> --> 1654 </section>
1522 </section> 1655 </section> -->
1523 1656
1524<!-- <section id='patching'> 1657<!-- <section id='patching'>
1525 <title>Patching</title> 1658 <title>Patching</title>
@@ -1992,9 +2125,9 @@ This creates a transition kernel layer to evaluate functionality
1992of some other kernel with the goal of easing transition to an 2125of some other kernel with the goal of easing transition to an
1993integrated and validated Yocto Project kernel. 2126integrated and validated Yocto Project kernel.
1994</para> 2127</para>
1995<para> 2128<!--<para>
1996The next few sections describe the process: 2129The next few sections describe the process:
1997</para> 2130</para> -->
1998 <!-- <section id='creating-a-custom-kernel-layer'> 2131 <!-- <section id='creating-a-custom-kernel-layer'>
1999 <title>Creating a Custom Kernel Layer</title> 2132 <title>Creating a Custom Kernel Layer</title>
2000<para> 2133<para>