From 026f1463292990672e88ca7623d42f7c63d33feb Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Thu, 21 Jul 2011 13:24:29 -0700 Subject: documentation/dev-manual/dev-manual-cases.xml: partial - more edits to the BSP case. These converted it to 1.1_M2. there were a lot of changes going from the original example that used to bernard to 1.1_M2. (From yocto-docs rev: c5dbc8da1ebc0b710e8133fcdd5893e33776148d) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/dev-manual/dev-manual-cases.xml | 305 +++++++++++++++----------- 1 file changed, 174 insertions(+), 131 deletions(-) (limited to 'documentation') diff --git a/documentation/dev-manual/dev-manual-cases.xml b/documentation/dev-manual/dev-manual-cases.xml index 83b02b1435..c1ebaf9ff7 100644 --- a/documentation/dev-manual/dev-manual-cases.xml +++ b/documentation/dev-manual/dev-manual-cases.xml @@ -65,7 +65,8 @@ The Linux Distributions section and The Packages section both - in the Yocto Project Quick Start for requirements. + in the Yocto Project Quick Start for requirements. + You will also need a release of Yocto Project installed on the host. Choose a BSP available with Yocto Project that most closely represents your hardware. Get set up with a base BSP. @@ -135,16 +136,17 @@ $ git branch -a $ git tag -l - For this example we are going to use the Yocto Project 1.0.1 Release, - which maps to the bernard branch in the repository. - These commands create a local branch named bernard + For this example we are going to use the Yocto Project 1.1 Release, + which maps to the [NEED BRANCH] branch in the repository. + These commands create a local branch named [NEED BRANCH] that tracks the remote branch of the same name. $ cd poky - $ git checkout -b bernard + $ git checkout -b bernard origin/bernard Switched to a new branch 'bernard' + [WRITER'S NOTE: I NEED THE REAL BRANCH NAMES IN THE EXAMPLE.] @@ -205,16 +207,17 @@ then you need to do the same for the BSP, which is located in the meta-intel Git repository. The meta-intel repository contains all the metadata - that supports BSP creation. + that supports BSP creation. + When you set up the meta-intel Git repository you can + set it up anywhere you want. + We will set up the meta-intel Git repository inside the + poky Git repository in this example. The following transcript shows the steps to clone the meta-intel Git repository inside the poky Git repository created earlier in this example. - While this example establishes the meta-intel Git repository inside - the poky Git repository, you are not required to have - meta-intel inside of poky: $cd poky $ git clone git://git.yoctoproject.org/meta-intel.git @@ -230,12 +233,13 @@ Because meta-intel is its own Git repository you will want to be sure you are in the appropriate branch for your work. - For this example we are going to use the bernard branch. + For this example we are going to use the [NEED BRANCH] branch. $ cd meta-intel - $ git checkout -b bernard + $ git checkout -b bernard origin/bernard Switched to a new branch 'bernard' + [WRITER'S NOTE: I NEED THE REAL BRANCH NAMES IN THE EXAMPLE.] @@ -264,9 +268,9 @@ Yocto Project release: atom-pc, beagleboard, mpc8315e, and routerstationpro. The recipes and configurations for these four BSPs are located and dispersed - within meta, which can be found in the Yocto Project source directory. + within meta-yocto, which can be found in the Yocto Project source directory. Consequently, they are not totally isolated in the spirit of layers unless you think - of meta as a layer itself. + of meta-yocto as a layer itself. On the other hand, the Yocto Project has isolated BSP layers within meta-intel for the Crown Bay, Emenlow, Jasper Forest, N450, and Sugar Bay. @@ -297,7 +301,9 @@ The following example assumes your working directory is meta-intel inside the meta-intel Git repository. If you downloaded and expanded a Crown Bay tarball then you simply copy the resulting - meta-crownbay directory structure to a location of your choice: + meta-crownbay directory structure to a location of your choice. + Good practice for a Git repository is to just copy the new layer alongside the existing + BSP layers in the meta-intel Git repository: $ cp -a meta-crownbay/ meta-mymachine @@ -333,75 +339,16 @@ The next step makes changes to mymachine.conf itself. - The only changes needed for this example are changes to the comment lines and to the - Source Revision (SRCREV) lines at the bottom of the file. + The only changes needed for this example are changes to the comment lines. + Here we simply substitute the Crown Bay name with an appropriate name. - For the comments the string crownbay-noemgd needs to be changed to - mymachine. - - - - To understand how to complete the changes to the SRCREV - statements we need to know which kernel we are using. - The PREFERRED_PROVIDER_virtual/kernel statement in the file specifies - the kernel we are going to use. - We are going to use linux-yocto. - The SRCREV statement pairs point to the exact machine branch - (commit) and meta branch in the poky Git repository. - Right now the SRCREV variables are as follows in - mymachine.conf: - - SRCREV_machine_pn-linux-yocto_crownbay-noemgd ?= \ "56fe215d3f1a2cc3a5a26482ac9809ba44495695" - SRCREV_meta_pn-linux-yocto_crownbay-noemgd ?= \ "e1f85a470934a0cf6abde5d95533e74501822c6b" - - SRCREV_machine_pn-linux-yocto-stable_crownbay-noemgd ?= \ "56fe215d3f1a2cc3a5a26482ac9809ba44495695" - SRCREV_meta_pn-linux-yocto-stable_crownbay-noemgd ?= \ "e1f85a470934a0cf6abde5d95533e74501822c6b" - - - - - You will notice that there are two pairs of SRCREV statements. - The first pair points to a current development kernel, which we don’t care about - in this example. - The bottom pair points to the stable kernel that we will use: - linux-yocto-stable. - At this point though, the unique commit strings all are still associated with - Crown Bay. - So the next changes we make to the configuration file gets rid of the pair that points - to the development kernel and provides new commit strings that points to the - atom-pc-standard, which we are choosing for the initial build of this BSP. - Here are the final SRCREV statements: - - SRCREV_machine_pn-linux-yocto-stable_mymachine ?= \ "72ca49ab08b8eb475cec82a10049503602325791" - SRCREV_meta_pn-linux-yocto-stable_mymachine ?= \ "ec26387cb168e9e0976999b528b5a9dd62e3157a" - - - - - If you are familiar with Git repositories you probably won’t have trouble locating the - exact commit strings you need to change the SRCREV statements. - You can find all the machine and meta - branch points (commits) for the linux-yocto-2.6.34 kernel - here. - - - - If you need a little more assistance after going to the link then do the following: - - Expand the list of branches by clicking […] - Click on the atom-pc-standard branch - Click on the commit column header to view the top commit - Copy the commit string for use in the mymachine.conf - file - - - - - For the SRCREV statement that points to the meta - branch use the same procedure except expand the wrs_meta - branch in step 2 above. + Note that inside the mymachine.conf is the + PREFERRED_PROVIDER_virtual/kernel statement. + This statement identifies the kernel that the BSP is going to use. + In this case the BSP is using linux-yocto, which is the + current Linux Yocto kernel based on the Linux 2.6.37 release. @@ -415,25 +362,16 @@ - First, remove these statements from the file: + The file contains these statements that reference the Crown Bay BSP: - BBFILE_COLLECTIONS_crownbayd += "crownbay" - BBFILE_PATTERN_crownbay := "^${LAYERDIR}/" + BBFILE_COLLECTIONS += "crownbay" + BBFILE_PATTERN_crownbay := "^${LAYERDIR}/" BBFILE_PRIORITY_crownbay = "6" - This leaves three similar statements that we care about: - - BBFILE_COLLECTIONS_crownbay-noemgd += "crownbay-noemgd" - BBFILE_PATTERN_crownbay-noemgd := "^${LAYERDIR}/" - BBFILE_PRIORITY_crownbay-noemgd = "6" - - - - - Simply substitute the machine string name crownbay-noemgd + Simply substitute the machine string name crownbay with the new machine name mymachine to get the following: BBFILE_COLLECTIONS_mymachine += "mymachine" @@ -444,84 +382,186 @@ Now we will take a look at the recipes in your new layer. - The standard BSP structure has areas for BSP, graphics, and kernel recipes. + The standard BSP structure has areas for BSP, graphics, core, and kernel recipes. When you create a BSP you use these areas for appropriate recipes and append files. Recipes take the form of .bb files. If you want to leverage off of existing recipes elsewhere in the Yocto Project source tree but change them you can use .bbappend files. All new recipes and append files for your layer go in the layer’s - recipes-bsp, recipes-kernel, and + recipes-bsp, recipes-kernel, + recipes-core, and recipes-graphics directories. + First, let us look at recipes-bsp. For this example we are not adding any new BSP recipes. And, we only need to remove the formfactor we do not want and change the name of the remaining one that supports no EMGD. These commands take care of the new layer’s BSP recipes: - $ rm -rf meta-mymachine/recipes-bsp/formfactor/formfactor/crownbay + $ rm ‐rf meta-mymachine/recipes-graphics/xorg-xserver/*emgd* $ mv meta-mymachine/recipes-bsp/formfactor/formfactor/crownbay-noemgd/ \ meta-mymachine/recipes-bsp/formfactor/formfactor/mymachine - For this example we want to remove anything that supports EMGD. - The following command cleans up the recipes-graphics directory: + Now let us look at recipes-graphics. + For this example we want to remove anything that supports EMGD and + be sure to rename remaining directories appropriately. + The following commands clean up the recipes-graphics directory: - $ rm –rf meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-emgd* + $ rm ‐rf meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-emgd* + $ rm ‐rf meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay + $ mv meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay-noemgd \ + meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-config/mymachine At this point the recipes-graphics directory just has files that support Video Electronics Standards Association (VESA) graphics modes. - However, we still need to rename a directory in the layer. - This command applies the final change to the recipes-graphics directory: + + + + Now let us look at changes in recipes-core. + The file task-core-tools.bbappend in + recipes-core/tasks appends the similarly named recipe + located in the Yocto Project Git repository at meta/recipes-core/tasks. + The "append" file in our layer right now is Crown Bay-specific and supports + EMGD and non-EMGD. + Here are the contents of the file: - $ mv meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay-noemgd \ - meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-config/mymachine + RRECOMMENDS_task-core-tools-profile_append_crownbay = " systemtap" + RRECOMMENDS_task-core-tools-profile_append_crownbay-noemgd = " systemtap" + + + + + The RRECOMMENDS statements list packages that + extend usability. + The first RRECOMMENDS statement can be removed, while the + second one can be changed to reflect meta-mymachine: + + RRECOMMENDS_task-core-tools-profile_append_mymachine = " systemtap" - Finally, let us look at the recipes-kernel directory in the example. - The only file we are concerned with for the example is - linux-yocto-stable_git.bbappend. - The other files all support the EMGD feature of Crown Bay. - These commands clean up the directory: + Finally, let us look at recipes-kernel changes. + Recall that the BSP uses the linux-yocto kernel as determined + earlier in the mymachine.conf. + The recipe for that kernel is located is not located in the + BSP layer but rather in Yocto Project Git repository at + meta/recipes-kernel/linux and is + named linux-yocto-2.6.37.bb. + The SRCREV_machine and SRCREV_meta + statements point to the exact commits in the Yocto Project Git repository from + which the source for the kernel can be found. + + + + However, in the meta-mymachine layer in + recipes-kernel/linux resides a .bbappend + file named linux-yocto-2.6.37.bbappend that + is appended to the recipe of the same name in meta/recipes-kernel/link. + Thus, the SRCREV statements in the "append" file override + the more general statements found in meta. + + + + The SRCREV statements in the "append" file currently point + to the kernel that supports the Crown Bay BSP with and without EMGD support. + Here are the statements: - $ rm –rf meta-mymachine/recipes-kernel/linux/linux-yocto - $ rm –rf meta-mymachine/recipes-kernel/linux/linux-yocto-stable - $ rm meta-mymachine/recipes-kernel/linux/linux-yocto_git.bbappend + SRCREV_machine_pn-linux-yocto_crownbay ?= \ + "372c0ab135978bd8ca3a77c88816a25c5ed8f303" + SRCREV_meta_pn-linux-yocto_crownbay ?= \ + "d5d3c6480d61f83503ccef7fbcd765f7aca8b71b" + + SRCREV_machine_pn-linux-yocto_crownbay-noemgd ?= \ + "372c0ab135978bd8ca3a77c88816a25c5ed8f303" + SRCREV_meta_pn-linux-yocto_crownbay-noemgd ?= \ + "d5d3c6480d61f83503ccef7fbcd765f7aca8b71b" - The linux-yocto-stable_git.bbappend file appends a Yocto Project - recipe having the same name. - The changes we need to make are to remove the statements that support EMGD - and change the remaining Crown Bay strings to be mymachine. - We also do not need to include the pointer to the EMGD licenses patch at the end of - the file. - Here is the original file: + You will notice that there are two pairs of SRCREV statements. + The top pair points to a kernel that supports + EMGD, which we don’t care about in this example. + The bottom pair points to the kernel that we will use: + linux-yocto. + At this point though, the unique commit strings all are still associated with + Crown Bay. + + + + So the next changes we make modify this linux-yocto-2.6.37.bbappend + file. + First, we delete the two SRCREV statements that support + EMGD (the top pair). + Next, we change the remaining pair to specify mymachine + and then we insert the commit identifier to point to the kernel in which we + are interested, which will be based on the atom-pc-standard + kernel. + Here are the final SRCREV statements: - FILESEXTRAPATHS := “${THISDIR}/${PN}” - COMPATIBLE_MACHINE_crownbay = “crownbay” - KMACHINE_CROWNBAY = “CROWNBAY” - COMPATIBLE_MACHINE_crownbay-noemgd = “crownbay-noemgd” - KMACHINE_crownbay-noemgd = “crownbay” - SRC_URI += file://0001-crownbay-update-a-handful-of-EMGD-licenses.patch + SRCREV_machine_pn-linux-yocto-_mymachine ?= \ + "fce17f046d3756045e4dfb49221d1cf60fcae329" + SRCREV_meta_pn-linux-yocto-stable_mymachine ?= \ + "84f1a422d7e21fbc23a687035bdf9d42471f19e0" - After editing the file it looks like this: + If you are familiar with Git repositories you probably won’t have trouble locating the + exact commit strings you need to change the SRCREV statements. + You can find all the machine and meta + branch points (commits) for the linux-yocto-2.6.37 kernel + here. + + + + If you need a little more assistance after going to the link then do the following: + + Expand the list of branches by clicking […] + Click on the yocto/standard/common-pc/atom-pc + branch + Click on the commit column header to view the top commit + Copy the commit string for use in the + linux-yocto-2.6.37.bbappend file + + + + + For the SRCREV statement that points to the meta + branch use the same procedure except expand the meta + branch in step 2 above. + + + + Also in the linux-yocto-2.6.47.bbappend file are + COMPATIBLE_MACHINE, KMACHINE, + and KERNEL_FEATURES statements. + Again, there are two sets of these: one for EMGD support and one for non-EMGD support. + Because we are not interested in supporting EMGD those three can be deleted. + The remaining three must be changed so that mymachine replaces + crownbay-noemgd and crownbay. + Here is the final linux-yocto-2.6.37.bbappend file after all + the edits: - FILESEXTRAPATHS := “${THISDIR}/${PN}” - COMPATIBLE_MACHINE_mymachine = “mymachine” - KMACHINE_mymachine = “mymachine + FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + + COMPATIBLE_MACHINE_mymachine = "mymachine" + KMACHINE_mymachine = "yocto/standard/mymachine" + KERNEL_FEATURES_append_mymachine += " cfg/smp.scc" + + SRCREV_machine_pn-linux-yocto_mymachine ?= \ + "fce17f046d3756045e4dfb49221d1cf60fcae329" + SRCREV_meta_pn-linux-yocto_mymachine ?= \ + "84f1a422d7e21fbc23a687035bdf9d42471f19e0" @@ -529,8 +569,10 @@ In summary, the edits to the layer’s recipe files result in removal of any files and statements that do not support your targeted hardware in addition to the inclusion of any new recipes you might need. - In this example, it was simply a matter of ridding the new layer meta-machine - of any code that supported the EMGD features. + In this example, it was simply a matter of ridding the new layer + meta-machine of any code that supported the EMGD features + and making sure we were pointing to the kernel that supports our example, which + is the atom-pc-standard kernel. We did not introduce any new recipes to the layer. @@ -555,7 +597,8 @@ Building an Image section of the Yocto Project Quick Start. You might want to reference this information. - The remainder of this section will apply to our example of the meta-mymachine layer. + The remainder of this section will apply to our example of the + meta-mymachine layer. -- cgit v1.2.3-54-g00ecf